Skip to content

IdColumnType

IdColumnType<Brand> = ColumnType<Id<Brand>, Id<Brand>, Id<Brand>>

Defined in: src/adapters/kysely.ts:40

Kysely column type mapping for Id<Brand>.

Use this in your Kysely Database interface to type a column as Id<Brand> at the TypeScript level. Pair it with idColumn(codec) for runtime read/write transformation.

Brand extends string

import type { IdColumnType } from "@smonn/ids/kysely";
import type { Id } from "@smonn/ids";
interface Database {
users: { id: IdColumnType<"usr"> };
}