aboutsummaryrefslogtreecommitdiff
path: root/src/lib/server/db/schema.ts
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-07-27 16:54:28 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-07-27 16:54:28 +0200
commit71ca66bcba70f7a463df6ee9bdcb0e14b8e60595 (patch)
tree6e962f0d8c3346fd871cb337f9c5a14e4c0f0a08 /src/lib/server/db/schema.ts
parented39c60ebc10efe2b644172e7c82f943c4fba3cc (diff)
feat: minimal grocery list — add items, check them off
- Groceries DB schema (id, name, checked, created_at) with Drizzle + libsql - /+page.server.ts: load (unchecked items, newest first), add & toggle actions - /+page.svelte: text input + Add button, item list with toggle buttons - Mobile-first styling with scoped CSS classes - AGENTS.md: project-specific rules including UI validation
Diffstat (limited to 'src/lib/server/db/schema.ts')
-rw-r--r--src/lib/server/db/schema.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/server/db/schema.ts b/src/lib/server/db/schema.ts
new file mode 100644
index 0000000..a8527fd
--- /dev/null
+++ b/src/lib/server/db/schema.ts
@@ -0,0 +1,8 @@
+import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
+
+export const groceries = sqliteTable('groceries', {
+ id: integer('id').primaryKey({ autoIncrement: true }),
+ name: text('name').notNull(),
+ checked: integer('checked', { mode: 'boolean' }).notNull().default(false),
+ createdAt: text('created_at').notNull(),
+});