Skip to content

IdGeneratingCodec

IdGeneratingCodec<Brand> = IdColumnCodec<Brand> & object

Defined in: src/adapters/adapter-types.ts:23

Structural interface required by idField() (Prisma, MikroORM), the generatedIdColumn family (Drizzle), insertId (Kysely), and beforeInsertHook (TypeORM) — extends IdColumnCodec with a synchronous generate(). Only the Timestamp codec and Reverse Timestamp codec satisfy this; async-generate codecs (Opaque, Signed, Wrapped, Digest) do not. Re-exported from all five ORM adapter subpaths (@smonn/ids/drizzle, @smonn/ids/kysely, @smonn/ids/mikro-orm, @smonn/ids/prisma, @smonn/ids/typeorm) as a public type.

generate(): Id<Brand>

Id<Brand>

Brand extends string