5/**
6 * Every Val Town account comes with its own private
7 * [SQLite database](https://www.sqlite.org/) that
8 * is accessible from any of your vals.
9 * ([Docs ↗](https://docs.val.town/std/sqlite))
115
116// adapted from
117// https://github.com/tursodatabase/libsql-client-ts/blob/17dd996b840c950dd22b871adfe4ba0eb4a5ead3/packages/libsql-client/src/sqlite3.ts#L314C1-L337C2
118function rowFromSql(
119 sqlRow: Array<unknown>,
286 const KEY = "aigeneratorblog";
287
288 // Initialize database
289 await sqlite.execute(`
290 CREATE TABLE IF NOT EXISTS ${KEY}_users_${SCHEMA_VERSION} (
286 const KEY = "seoKeywordResearchTool";
287
288 // Initialize database
289 await sqlite.execute(`
290 CREATE TABLE IF NOT EXISTS ${KEY}_users_${SCHEMA_VERSION} (
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
133}
134
135// Database Admin
136// https://libsqlstudio.com/client/s/valtown?p=d7880ed3-ad63-4258-a939-5a375f2c3ed8
137//
42
43 // Mock exchange rates to USD for testing.
44 // In a real scenario, these would come from an external API or database.
45 const mockRatesToUSD: Record<string, number> = {
46 USD: 1,
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
1Get vals that were created in the last month, augmented with all sorts of AI and screenshots, and shoved in a sqlite database for @stevekrouse/showcase.
159 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
160 const KEY = "GameAwards2024PredictionGame";
161 const SCHEMA_VERSION = 2; // Increment to reset database
162
163 await sqlite.execute(`