/** * Value coercion shared by the SQLite-family drivers. * * `node:sqlite` and D1 both reject JavaScript booleans outright ("Provided value cannot be bound * to SQLite parameter N"), and neither understands `Date` or `undefined`. Rather than making every * call site remember that, the drivers normalise parameters on the way in. */ /** Values a SQLite-family driver will accept as a bound parameter. */ export type SqlValue = string | number | bigint | null | Uint8Array; /** * Normalise a single query parameter into something SQLite/D1 will bind. * * Booleans become 0/1, dates become ISO-8601 strings (matching the `Timestamp` column type), * and `undefined` becomes NULL so optional fields do not blow up at the driver boundary. */ export declare function toSqlValue(value: unknown): SqlValue; export declare function toSqlParameters(parameters: readonly unknown[]): SqlValue[]; /** Read a SQLite integer-backed boolean column. */ export declare function toBool(value: number | boolean | null | undefined): boolean; /** Write a boolean to an integer-backed column. */ export declare function fromBool(value: boolean | undefined | null): number; /** * Parse a JSON text column, falling back rather than throwing. * * A malformed `data` blob should not take down an entire admin list view; the caller gets the * fallback and the row stays visible and editable. */ export declare function parseJson(value: string | null | undefined, fallback: T): T; /** Serialise a value for a JSON text column. */ export declare function stringifyJson(value: unknown): string; /** Current time in the ISO-8601 form used by every `Timestamp` column. */ export declare function now(): string;