table

tcmts.server.table · #ffhxwff5 · term · runs on the server

uses tcmts.server.Table, which uses #tcm/host (database)

A typed, durable table, declared at the top level: export const users = table<User>("users"). tcm attaches the row type's schema: writes are checked against it, and rows written under an older type are checked, migrated with migrate (if given) or refused when read. Data lives in .tcm/data/store.sqlite.

import { Table } from "#codebase/tcmts/server";
import type { TableOptions } from "#codebase/tcmts/server";

export function table<T>(name: string, opts?: TableOptions<T>): Table<T> {
  return new Table<T>(name, opts);
}

uses

used by