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 ORM · all subjects

arktype/data-types

89 notes in this subject, read out of this brain and free to use. This is page 1 of 2.

SQLite blob with buffer mode arktype mapping

SQLite sqlite.blob({ mode: 'buffer' }) maps to arktype type.instanceOf(Buffer) validating that the value is a Buffer instance.

PostgreSQL array arktype mapping

PostgreSQL pg.dataType().array(...) maps to the base data type schema with .array().exactlyLength(size) constraining the array to exact length.

PostgreSQL uuid arktype mapping

PostgreSQL pg.uuid() maps to arktype type with pattern /^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu validating UUID string format.

PostgreSQL char with length arktype mapping

PostgreSQL pg.char({ length: ... }) maps to arktype type.string.exactlyLength(length) requiring exact length match.

MySQL char with length arktype mapping

MySQL mysql.char({ length: ... }) maps to arktype type.string.exactlyLength(length) requiring exact length match.

PostgreSQL boolean arktype mapping

PostgreSQL pg.boolean() maps to arktype type.boolean schema.

MySQL boolean arktype mapping

MySQL mysql.boolean() maps to arktype type.boolean schema.

SQLite boolean arktype mapping

SQLite sqlite.integer({ mode: 'boolean' }) maps to arktype type.boolean schema.

PostgreSQL date and timestamp arktype mapping with date mode

PostgreSQL pg.date({ mode: 'date' }) and pg.timestamp({ mode: 'date' }) map to arktype type.Date schema.

SQLite timestamp arktype mapping

SQLite sqlite.integer({ mode: 'timestamp' }) and sqlite.integer({ mode: 'timestamp_ms' }) map to arktype type.Date schema.

PostgreSQL string-type columns arktype mapping

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

MySQL string-type columns arktype mapping

MySQL mysql.binary(), mysql.date({ mode: 'string' }), mysql.datetime({ mode: 'string' }), mysql.decimal(), mysql.time(), mysql.timestamp({ mode: 'string' }), and mysql.varbinary() map to arktype type.string schema.

SQLite text arktype mapping

SQLite sqlite.numeric() and sqlite.text({ mode: 'text' }) map to arktype type.string schema.

PostgreSQL bit type arktype mapping

PostgreSQL pg.bit({ dimensions: ... }) maps to arktype type with pattern /^[01]{${column.dimensions}}$/ validating a string of ones and zeros matching the bit length.

PostgreSQL varchar arktype mapping

PostgreSQL pg.varchar({ length: ... }) maps to arktype type.string.atMostLength(length) allowing strings up to the specified length.

MySQL varchar arktype mapping

MySQL mysql.varchar({ length: ... }) maps to arktype type.string.atMostLength(length) allowing strings up to the specified length.

SQLite text with length arktype mapping

SQLite sqlite.text({ mode: 'text', length: ... }) maps to arktype type.string.atMostLength(length) allowing strings up to the specified length.

Enum columns arktype mapping

PostgreSQL pg.text({ enum: ... }), pg.char({ enum: ... }), pg.varchar({ enum: ... }), MySQL mysql.tinytext({ enum: ... }), mysql.mediumtext({ enum: ... }), mysql.text({ enum: ... }), mysql.longtext({ enum: ... }), mysql.char({ enum: ... }), mysql.varchar({ enum: ... }), mysql.mysqlEnum(..., ...), and SQLite sqlite.text({ mode: 'text', enum: ... }) all map to arktype type.enumerated(...enum) validating against the enum values.

PostgreSQL smallint arktype mapping

PostgreSQL pg.smallint() and pg.smallserial() map to arktype type.keywords.number.integer.atLeast(-32_768).atMost(32_767) for 16-bit integer bounds.

PostgreSQL real arktype mapping

PostgreSQL pg.real() maps to arktype type.number.atLeast(-8_388_608).atMost(8_388_607) for 24-bit integer bounds.

PostgreSQL integer arktype mapping

PostgreSQL pg.integer() and pg.serial() map to arktype type.keywords.number.integer.atLeast(-2_147_483_648).atMost(2_147_483_647) for 32-bit integer bounds.

PostgreSQL doublePrecision arktype mapping

PostgreSQL pg.doublePrecision() maps to arktype type.number.atLeast(-140_737_488_355_328).atMost(140_737_488_355_327) for 48-bit integer bounds.

MySQL double arktype mapping

MySQL mysql.double() maps to arktype type.number.atLeast(-140_737_488_355_328).atMost(140_737_488_355_327) for 48-bit integer bounds.

MySQL real arktype mapping

MySQL mysql.real() maps to arktype type.number.atLeast(-140_737_488_355_328).atMost(140_737_488_355_327) for 48-bit integer bounds.

SQLite real arktype mapping

SQLite sqlite.real() maps to arktype type.number.atLeast(-140_737_488_355_328).atMost(140_737_488_355_327) for 48-bit integer bounds.

MySQL unsigned double arktype mapping

MySQL mysql.double({ unsigned: true }) maps to arktype type.number.atLeast(0).atMost(281_474_976_710_655) for unsigned 48-bit integer bounds.

PostgreSQL bigint with number mode arktype mapping

PostgreSQL pg.bigint({ mode: 'number' }) and pg.bigserial({ mode: 'number' }) map to arktype type.keywords.number.integer.atLeast(-9_007_199_254_740_991).atMost(9_007_199_254_740_991) for JavaScript safe integer bounds.

MySQL bigint with number mode arktype mapping

MySQL mysql.bigint({ mode: 'number' }) and mysql.bigserial({ mode: 'number' }) map to arktype type.keywords.number.integer.atLeast(-9_007_199_254_740_991).atMost(9_007_199_254_740_991) for JavaScript safe integer bounds.

SQLite integer with number mode arktype mapping

SQLite sqlite.integer({ mode: 'number' }) maps to arktype type.keywords.number.integer.atLeast(-9_007_199_254_740_991).atMost(9_007_199_254_740_991) for JavaScript safe integer bounds.

PostgreSQL bigint with bigint mode arktype mapping

PostgreSQL pg.bigint({ mode: 'bigint' }) and pg.bigserial({ mode: 'bigint' }) map to arktype type.bigint.narrow with validation for 64-bit integer bounds (-9_223_372_036_854_775_808n to 9_223_372_036_854_775_807n).

MySQL bigint with bigint mode arktype mapping

MySQL mysql.bigint({ mode: 'bigint' }) maps to arktype type.bigint.narrow with validation for 64-bit integer bounds (-9_223_372_036_854_775_808n to 9_223_372_036_854_775_807n).

SQLite blob with bigint mode arktype mapping

SQLite sqlite.blob({ mode: 'bigint' }) maps to arktype type.bigint.narrow with validation for 64-bit integer bounds (-9_223_372_036_854_775_808n to 9_223_372_036_854_775_807n).

MySQL unsigned bigint arktype mapping

MySQL mysql.bigint({ mode: 'bigint', unsigned: true }) maps to arktype type.bigint.narrow with validation for unsigned 64-bit integer bounds (0n to 18_446_744_073_709_551_615n).

PostgreSQL point with tuple mode arktype mapping

PostgreSQL pg.geometry({ type: 'point', mode: 'tuple' }) and pg.point({ mode: 'tuple' }) map to arktype type([type.number, type.number]) validating a tuple of two numbers.

PostgreSQL point with xy mode arktype mapping

PostgreSQL pg.geometry({ type: 'point', mode: 'xy' }) and pg.point({ mode: 'xy' }) map to arktype type({ x: type.number, y: type.number }) validating an object with x and y number properties.

PostgreSQL halfvec arktype mapping

PostgreSQL pg.halfvec({ dimensions: ... }) maps to arktype type.number.array().exactlyLength(dimensions) validating an array of numbers with exact length.

PostgreSQL vector arktype mapping

PostgreSQL pg.vector({ dimensions: ... }) maps to arktype type.number.array().exactlyLength(dimensions) validating an array of numbers with exact length.

PostgreSQL line with abc mode arktype mapping

PostgreSQL pg.line({ mode: 'abc' }) maps to arktype type({ a: type.number, b: type.number, c: type.number }) validating an object with a, b, and c number properties.

PostgreSQL line with tuple mode arktype mapping

PostgreSQL pg.line({ mode: 'tuple' }) maps to arktype type([type.number, type.number, type.number]) validating a tuple of three numbers.

PostgreSQL jsonb arktype mapping

PostgreSQL pg.jsonb() maps to arktype type allowing string | number | boolean | null or unknown.any[] | Record<string, unknown.any>.

MySQL json arktype mapping

MySQL mysql.json() maps to arktype type allowing string | number | boolean | null or unknown.any[] | Record<string, unknown.any>.

SQLite text with json mode arktype mapping

SQLite sqlite.text({ mode: 'json' }) maps to arktype type allowing string | number | boolean | null or unknown.any[] | Record<string, unknown.any>.

SingleStore year to arktype schema

SingleStore year maps to arktype type.keywords.number.integer.atLeast(1_901).atMost(2_155).

SingleStore bigint number mode to arktype schema

SingleStore bigint with mode 'number' maps to arktype type.keywords.number.integer.atLeast(-9_007_199_254_740_991).atMost(9_007_199_254_740_991) representing JavaScript minimum and maximum safe integers.

SingleStore serial to arktype schema

SingleStore serial maps to arktype type.keywords.number.integer.atLeast(0).atMost(9_007_199_254_740_991) representing JavaScript maximum safe integer.

SingleStore boolean column to arktype schema mapping

SingleStore boolean columns map to arktype type.boolean schema.

SingleStore date/time columns to arktype Date schema

SingleStore date, datetime, and timestamp columns with mode 'date' map to arktype type.Date schema.

SingleStore binary and string columns to arktype string schema

SingleStore binary, date/datetime/timestamp with mode 'string', decimal, time, and varbinary columns map to arktype type.string schema.

SingleStore char column to arktype exactlyLength schema

SingleStore char columns with a specified length map to arktype type.string.exactlyLength(length) schema.

SingleStore varchar column to arktype atMostLength schema

SingleStore varchar columns with a specified length map to arktype type.string.atMostLength(length) schema.

SingleStore text column to arktype string schema

SingleStore text columns map to arktype type.string.atMostLength(65_535) schema, reflecting the unsigned 16-bit integer limit for text length.

SingleStore enum columns to arktype enumerated schema

SingleStore text, char, and varchar columns with enum values, as well as singlestoreEnum, map to arktype type.enumerated(...enum) schema.

SingleStore float and mediumint to arktype schema range mapping

SingleStore float and mediumint map to arktype type.keywords.number.integer.atLeast(-8_388_608).atMost(8_388_607) representing 24-bit integer limits. SingleStore float unsigned and mediumint unsigned map to arktype type.number.atLeast(0).atMost(16_777_215) representing unsigned 24-bit integer limits.

SingleStore int to arktype schema range mapping

SingleStore int maps to arktype type.keywords.number.integer.atLeast(-2_147_483_648).atMost(2_147_483_647) representing 32-bit integer limits. SingleStore int unsigned maps to arktype type.keywords.number.integer.atLeast(0).atMost(4_294_967_295) representing unsigned 32-bit integer limits.

SingleStore bigint bigint mode to arktype schema

SingleStore bigint with mode 'bigint' maps to arktype type.bigint with a narrow function validating values between -9_223_372_036_854_775_808n and 9_223_372_036_854_775_807n representing 64-bit integer limits. SingleStore bigint unsigned with mode 'bigint' validates values between 0n and 18_446_744_073_709_551_615n representing unsigned 64-bit integer limits.

SingleStore double and real to arktype schema range mapping

SingleStore double and real map to arktype type.number.atLeast(-140_737_488_355_328).atMost(140_737_488_355_327) representing 48-bit integer limits. SingleStore double unsigned maps to arktype type.number.atLeast(0).atMost(281_474_976_710_655) representing unsigned 48-bit integer limits.

SingleStore json to arktype schema

SingleStore json columns map to arktype type('string | number | boolean | null').or(type('unknown.any[] | Record<string, unknown.any>')) allowing strings, numbers, booleans, null, arrays, or objects.

MySQL enum type maps to arktype enumerated

MySQL mysqlEnum('name', ['val1', 'val2']) column type maps to arktype type.enumerated('val1', 'val2') schema.

MySQL boolean type maps to arktype boolean

MySQL boolean column type maps to arktype type.boolean schema.

MySQL date, datetime, timestamp with mode date map to arktype Date

MySQL date({ mode: 'date' }), datetime({ mode: 'date' }), and timestamp({ mode: 'date' }) column types map to arktype type.Date schema.

Give your agent this brain