Skip to content

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.

Brand extends string

IdColumnCodec<Brand>

The brand-scoped codec used to parse values read from the database.

SQLiteCustomColumnBuilder<{ columnType: "SQLiteCustomColumn"; data: Id<Brand> | null; dataType: "custom"; driverParam: string | null; enumValues: undefined; name: ""; }>

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