4Specifically, this will support the full [@libsql/client interface](https://docs.turso.tech/sdk/ts/reference#simple-query)._
5
6[SQLite](https://www.sqlite.org/) is a lightweight, standard database. Every Val Town account comes with its own private SQLite database that is accessible from any of your vals via [`std/sqlite`](https://www.val.town/v/std/sqlite).
7
8Val Town SQLite is powered by [Turso](https://turso.tech/).
12* [ORMs](https://docs.val.town/std/sqlite/orms)
13
14We recommend these admin data viewers for managing your database – viewing or editing data or your database table schema:
15
16* [Outerbase Studio](https://libsqlstudio.com/) **(recommended)** - formely known as LibSQL Studio – see instructions [here](https://libsqlstudio.com/docs/connect-valtown)
58}
59
60async function setupDatabase() {
61 await sqlite.execute(`
62 CREATE TABLE IF NOT EXISTS ${KEY}_discord_links (
142
143export default async function server(request: Request) {
144 await setupDatabase();
145 return handleDiscordInteraction(request);
146}
20 <h1>notUber -- Its kinda like Lyft</h1>
21 <p>I built this as part of a larger project, as well a demo.</p>
22 <p>The stack consists of <a href="https://www.clerk.com">Clerk</a> for Auth, <a href="https://www.instantdb.com">InstantDB</a> for my database, and the <a href="https://developers.google.com/maps">Google maps api</a> for maps and routing etc.</p>
23 <p>All the vals are located <a href="https://vawogbemi-notuberfolder.web.val.run">here</a>.</p>
24 <h3>Getting Started</h3>
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
3I built this as part of a larger project, as well a demo.
4
5The stack consists of [Clerk](https://www.clerk.com) for Auth, [InstantDB](https://www.instantdb.com) for my database, and the [Google maps api](https://developers.google.com/maps) for maps and routing etc.
6
7All the vals are located [here](https://vawogbemi-notuberfolder.web.val.run).
2import { DB } from 'https://esm.town/v/@std/sqlite';
3
4// Initialize SQLite database
5const db = new DB();
6db.execute(`
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>,
1# SQLite - [Docs ↗](https://docs.val.town/std/sqlite)
2
3[SQLite](https://www.sqlite.org/) is a lightweight, standard database. Every Val Town account comes with its own private SQLite database that is accessible from any of your vals via [`std/sqlite`](https://www.val.town/v/std/sqlite).
4
5Val Town SQLite is powered by [Turso](https://turso.tech/).
9* [ORMs](https://docs.val.town/std/sqlite/orms)
10
11We recommend these admin data viewers for managing your database – viewing or editing data or your database table schema:
12
13* [Outerbase Studio](https://libsqlstudio.com/) **(recommended)** - formely known as LibSQL Studio – see instructions [here](https://libsqlstudio.com/docs/connect-valtown)
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))
7It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
8
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).