
status text NOT NULL DEFAULT 'active' assuming that the status would default to active but it's not working, I could swear this worked in the past but I'm having issues right now
insert licenses (id) values (1); while the dash ui is trying to run this:SELECT * from test WHERE id=100 returns "rows_read": 1 from 150-row table at this moment.EXPLAIN QUERY PLAN, you'll see that your index on id results in SEARCH being used which is only scanning a subset of tables, whereas other keys will show SCAN which is a full table scan.
A prepared SQL statement must contain only one statement; at the end' ' or '\n' then it'll reject it as it thinks there's more statements to come.wrangler d1 execute ... --command?wrangler d1 execute my-db --local --file=path/to/file.sqlstatus text NOT NULL DEFAULT 'active'insert licenses (id) values (1);{"sql":"INSERT INTO [licenses] (\"id\", \"status\", \"plan\", \"created_at\", \"expires_at\") VALUES ($0,$1,$2,$3,$4)","params":["2",null,null,null,null]}SELECT * from test WHERE id=100"rows_read": 1EXPLAIN QUERY PLANidSEARCHSCANA prepared SQL statement must contain only one statement;;' ''\n'wrangler d1 execute ... --commandwrangler d1 execute my-db --local --file=path/to/file.sql SELECT
posts.id,
posts.title,
posts.updatedOn,
substr(posts.body, 0, 20) as body,
users.firstName || ' ' || users.lastName as author,
count(comments.id) as commentCount,
categories.title as category,
COUNT() OVER() as total
FROM posts
left outer join users
on posts.userid = users.id
left outer join comments
on comments.postId = posts.id
left outer join categoriesToPosts
on categoriesToPosts.postId = posts.id
left outer join categories
on categoriesToPosts.categoryId = categories.id
group by posts.id
order by posts.updatedOn desc
limit 10
offset 0CREATE TABLE IF NOT EXISTS licenses (
id integer PRIMARY KEY AUTOINCREMENT,
status text NOT NULL DEFAULT 'active',
plan text NOT NULL DEFAULT 'basic',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
expires_at DATETIME DEFAULT CURRENT_TIMESTAMP
);INSERT INTO verification_keys (id, content, account_name) VALUES ('6de221d9-4546-4599-ae7a-956632c9f6c9', 'c9948fff-9da3-4713-a169-9c434dbb1681', 'user1');