Vals using kysely
Description from the NPM package:
Type safe SQL query builder
g
vtdb
Script
Val Town Database This val exports vtdb , a correctly typed Kysely instance
to query the @sqlite.db database containing public vals. Example usage: import { vtdb } from 'https://esm.town/v/g/vtdb';
const vals = await vtdb.selectFrom('vals')
.selectAll()
.orderBy('created_at desc')
.limit(5)
.execute();
console.log(vals.map((val) => val.name));
4

easrng
kyselyVtDialect
Script
Kysely Dialect for @std/sqlite Caveats It doesn't support transactions, there's no real way to do them on top of @std/sqlite AFAICT. Usage import { VtDialect } from "https://esm.town/v/easrng/kyselyVtDialect";
import { Kysely } from "npm:kysely";
const db = new Kysely({
dialect: new VtDialect(),
}); Demo See @easrng/kyselyVtDemo, which uses this along with @easrng/kyselyVtTypes to generate schema types.
1