From e448e68c1d4b8eb458745de3e4fe97ec0313b09d Mon Sep 17 00:00:00 2001 From: June Date: Mon, 12 Jan 2026 11:50:33 +1300 Subject: [PATCH] add table n stuff --- db/config.ts | 14 +++++++++++++- src/pages/index.astro | 19 +++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/db/config.ts b/db/config.ts index 0932e2a..93433e8 100644 --- a/db/config.ts +++ b/db/config.ts @@ -1,4 +1,16 @@ -import { defineDb } from 'astro:db'; +import { defineDb, column, defineTable, NOW } from 'astro:db'; + +const Entry = defineTable({ + columns: { + id: column.number({ primaryKey: true }), + date: column.date({ default: NOW }), + location: column.json(), + content: column.json({ default: {} }) + }, + indexes: [ + { on: ['date', 'content'] } + ] +}) // https://astro.build/db/config export default defineDb({ diff --git a/src/pages/index.astro b/src/pages/index.astro index 912a5b3..fa5733c 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -2,13 +2,13 @@ import "../styles/global.css" --- - @@ -37,13 +45,12 @@ import "../styles/global.css"


- + -
+
-