nullableIdColumnSqlite
nullableIdColumnSqlite<
Brand>(codec):SQLiteCustomColumnBuilder<{columnType:"SQLiteCustomColumn";data:Id<Brand> |null;dataType:"custom";driverParam:string|null;enumValues:undefined;name:""; }>
Defined in: src/adapters/drizzle.ts:290
Drizzle custom column type for a nullable Id<Brand> column in SQLite.
Behaves identically to idColumnSqlite except that null and undefined
driver values are passed through as null rather than throwing. Use for
optional foreign keys, LEFT JOIN results, and any column that is
legitimately absent.
Column type is always text and cannot be overridden in SQLite.
Type Parameters
Section titled “Type Parameters”Brand extends string
Parameters
Section titled “Parameters”IdColumnCodec<Brand>
The brand-scoped codec used to parse values read from the database.
Returns
Section titled “Returns”SQLiteCustomColumnBuilder<{ columnType: "SQLiteCustomColumn"; data: Id<Brand> | null; dataType: "custom"; driverParam: string | null; enumValues: undefined; name: ""; }>
Example
Section titled “Example”import { nullableIdColumnSqlite } from "@smonn/ids/drizzle";import { createTimestampId } from "@smonn/ids";
const usr = createTimestampId("usr");export const posts = sqliteTable("posts", { authorId: nullableIdColumnSqlite(usr),});// posts.authorId is Id<"usr"> | null end-to-end