1
2
3
4
5
6
7
8
9
10
11
import type { DB } from "https://easrng-kyselyvttypes.web.val.run/?tables=contacts";
import { VtDialect } from "https://esm.town/v/easrng/kyselyVtDialect";
import { Kysely } from "npm:kysely@0.27.3";
// ^ pinned version because val.town's editor doesn't
// load version ranges.
const db = new Kysely<DB>({
dialect: new VtDialect(),
});
const rows = await db.selectFrom("contacts").selectAll().execute();
// ^ { contact_id: number; email: string; first_name: string; ... }[]
console.log(rows);