new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Drizzle · PostgreSQL · all subjects

arktype/type-mappings

19 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Arktype schema for pg.boolean()

The Drizzle pg.boolean() column type maps to arktype type.boolean schema.

Arktype schema for pgEnum

The Drizzle pgEnum column type maps to arktype type.enumerated() schema with enum values as arguments.

Arktype schema for date and timestamp with date mode

The Drizzle pg.date({ mode: 'date' }) and pg.timestamp({ mode: 'date' }) column types map to arktype type.Date schema.

Arktype schema for date and timestamp with string mode

The Drizzle pg.date({ mode: 'string' }), pg.timestamp({ mode: 'string' }), and other string-based types (cidr, inet, interval, macaddr, macaddr8, numeric, text, sparsevec, time) map to arktype type.string schema.

Arktype schema for pg.bit()

The Drizzle pg.bit({ dimensions: ... }) column type maps to arktype type(`/^[01]{${column.dimensions}}$/`) schema, validating a binary string of the specified length.

Arktype schema for pg.uuid()

The Drizzle pg.uuid() column type maps to arktype type(/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu) schema, validating UUID format.

Arktype schema for pg.varchar()

The Drizzle pg.varchar({ length: ... }) column type maps to arktype type.string.atMostLength(length) schema.

Arktype schema for text/char/varchar with enum

The Drizzle pg.text({ enum: ... }), pg.char({ enum: ... }), and pg.varchar({ enum: ... }) column types map to arktype type.enumerated(...enum) schema with enum values.

Arktype schema for pg.real()

The Drizzle pg.real() column type maps to arktype type.number.atLeast(-8_388_608).atMost(8_388_607) schema for 24-bit integer limits.

Arktype schema for pg.integer() and pg.serial()

The Drizzle pg.integer() and pg.serial() column types map to arktype type.keywords.number.integer.atLeast(-2_147_483_648).atMost(2_147_483_647) schema for 32-bit integer validation.

Arktype schema for pg.doublePrecision()

The Drizzle pg.doublePrecision() column type maps to arktype type.number.atLeast(-140_737_488_355_328).atMost(140_737_488_355_327) schema for 48-bit integer limits.

Arktype schema for pg.bigint() and pg.bigserial() with number mode

The Drizzle pg.bigint({ mode: 'number' }) and pg.bigserial({ mode: 'number' }) column types map to arktype type.keywords.number.integer.atLeast(-9_007_199_254_740_991).atMost(9_007_199_254_740_991) schema for JavaScript safe integer limits.

Arktype schema for pg.bigint() and pg.bigserial() with bigint mode

The Drizzle pg.bigint({ mode: 'bigint' }) and pg.bigserial({ mode: 'bigint' }) column types map to arktype type.bigint.narrow() schema that validates 64-bit integer boundaries (-9_223_372_036_854_775_808n to 9_223_372_036_854_775_807n).

Arktype schema for pg.point() and pg.geometry() with xy mode

The Drizzle pg.point({ mode: 'xy' }) and pg.geometry({ type: 'point', mode: 'xy' }) column types map to arktype type({ x: type.number, y: type.number }) schema.

Arktype schema for pg.halfvec() and pg.vector()

The Drizzle pg.halfvec({ dimensions: ... }) and pg.vector({ dimensions: ... }) column types map to arktype type.number.array().exactlyLength(dimensions) schema.

Arktype schema for pg.line() with tuple mode

The Drizzle pg.line({ mode: 'tuple' }) column type maps to arktype type([type.number, type.number, type.number]) schema.

Arktype schema for pg.json() and pg.jsonb()

The Drizzle pg.json() and pg.jsonb() column types map to arktype type('string | number | boolean | null').or(type('unknown.any[] | Record<string, unknown.any>')) schema, validating JSON primitives or objects/arrays.

Arktype schema for array columns

The Drizzle pg.dataType().array(...) column type maps to arktype baseDataTypeSchema.array().exactlyLength(size) schema where size matches the array dimension specification.

Arktype schema for pg.bytea()

The Drizzle pg.bytea() column type maps to arktype type.unknown.narrow((value) => value instanceof Buffer).as<Buffer>() schema, validating Buffer instances.

Give your agent this brain