Files
bun-sqlite/dist/lib/schema/create-db-schema.d.ts

12 lines
605 B
TypeScript

import type { CreateDBSchemaParams } from "../../types";
/**
* # Sync the database to the schema
* @description Changed tables are rebuilt by copying into a new table and
* dropping the old one. With foreign keys ON, `DROP TABLE` runs an implicit
* `DELETE FROM` that fires `ON DELETE CASCADE` on child tables, so keys are
* disabled for the sync and checked before committing. (`PRAGMA
* foreign_keys` is a no-op inside a transaction.) With `dry_run` the
* transaction is rolled back, so `changes` is the exact plan.
*/
export default function createDBSchema(params: CreateDBSchemaParams): void;