?
Table
TypeThe typed handle that `db.defineTable` returns. Every read and write hangs off it.
The typed handle for one table, returned by db.defineTable. Its type parameter is your row interface, so reads return that shape and writes accept a partial of it, checked at compile time. Every method in this section is a member of it, alongside the db-level helpers for batching, raw SQL, and time.
Table.ts
interface Table<T> { // reads: get, filter, findOne, count, sum, avg, aggregate… // writes: push, update, upsert, remove, removeAll, clear }
Define and use a table
interface Vendor { name: string; status: 'pending' | 'approved'; } export const Vendors = db.defineTable<Vendor>('vendors'); // reads return Vendor, writes accept Partial<Vendor> const v = await Vendors.push({ name: 'Acme', status: 'pending' });