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
2
3```ts
4import { setupDatabase } from "https://esm.town/v/stevekrouse/dateme_sqlite"
5
6await setupDatabase()
7```
8
1# datascript example
2
3An example using tonsky’s [datascript](https://github.com/tonsky/datascript) module, which implements a datalog-style database in JavaScript. The module itself is really written in ClojureScript, but they've helpfully produced an npm-compatible module for us to use. [Datalog](https://en.wikipedia.org/wiki/Datalog) languages are fascinating, and have some real-world use in Roam Research and Logseq.
1# Get a DuckDB database
2
3This method sets up a [duckdb-wasm](https://github.com/duckdb/duckdb-wasm) database that you can then use to store and retrieve data.
5- They're shorter, with a more customizable alphabet.
6- They use more different characters by default.
7- Unlike UUIDs, there aren't custom types for nanoids in databases
8- Nanoids never contain information. UUIDs sometimes do: some UUIDs contain timestamps and MAC addresses.
9