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))
1# VALL-E
2
3LLM code generation for vals! Make apps with a frontend, backend, and database.
4
5It's a bit of work to get this running, but it's worth it.
105 {
106 name: "Use Val Town SQLite to store data",
107 prompt: "Write a val that uses an SQLite database",
108 code: `import { sqlite } from "https://esm.town/v/std/sqlite?v=4";
109
33// }
34
35// Database querying.
36
37function parseResultSet<T>(row: ResultSet): T[] {
33}
34
35// DATABASE
36const kv = new DenoSyntheticKV("passkeys_example");
37
9## Contributing
10
11Forking this repo should mostly work, except for the sqlite database. You'll need to create the table & populate it with some data. [This script](https://www.val.town/v/stevekrouse/dateme_sqlite) *should* do it, but I think it has a couple bugs. If you're interested in contributing to this project contact me or comment on this val and I'll get it working for ya!
12
13## Todos
14
15- [ ] Make the SQLite database forkable and build a widget/workflow for that, ie fix @stevekrouse/dateme_sqlite
16- [ ] Require an email (that isn't shared publicly)
17 - [ ] Verify the email address with a "magic link"
9## Contributing
10
11Forking this repo should mostly work, except for the sqlite database. You'll need to create the table & populate it with some data. [This script](https://www.val.town/v/stevekrouse/dateme_sqlite) *should* do it, but I think it has a couple bugs. If you're interested in contributing to this project contact me or comment on this val and I'll get it working for ya!
12
13## Todos
14
15- [ ] Make the SQLite database forkable and build a widget/workflow for that, ie fix @stevekrouse/dateme_sqlite
16- [ ] Require an email (that isn't shared publicly)
17 - [ ] Verify the email address with a "magic link"
34}
35
36export async function setupDatabase() {
37 await createTable();
38 const docs = await fetchJSON(thisWebURL());
1# listSqliteTables
2
3Returns a flat array of the names of all tables in your Val Town SQLite database.
4
5```ts
1# SQLite Dump Util
2
3A utility function that generates SQL statements to dump the data and schema of tables in a SQLite database.
4
5## Usage