MySQL binary, date string, datetime string, decimal, time, timestamp string map to arktype string
MySQL binary(), date({ mode: 'string' }), datetime({ mode: 'string' }), decimal(), time(), timestamp({ mode: 'string' }), and varbinary() column types map to arktype type.string schema.
MySQL blob maps to arktype string with length constraint
MySQL blob({ mode: 'string' }) and blob() column types map to arktype type.string.atMostLength(65_535) schema.
MySQL mediumblob maps to arktype string with length constraint
MySQL mediumblob({ mode: 'string' }) and mediumblob() column types map to arktype type.string.atMostLength(16_777_215) schema.
MySQL longblob maps to arktype string with length constraint
MySQL longblob({ mode: 'string' }) and longblob() column types map to arktype type.string.atMostLength(4_294_967_295) schema.
MySQL char maps to arktype string with exact length
MySQL char({ length: ... }) column type maps to arktype type.string.exactlyLength(length) schema.
MySQL varchar maps to arktype string with max length
MySQL varchar({ length: ... }) column type maps to arktype type.string.atMostLength(length) schema.
MySQL varbinary with length maps to arktype regex
MySQL varbinary({ length: ... }) column type maps to arktype type(`/^[01]{0,${length ?? "*"}}$/`) schema, validating a string of 0s and 1s up to the specified length.
MySQL tinytext maps to arktype string
MySQL tinytext() column type maps to arktype type.string.atMostLength(255) schema, based on unsigned 8-bit integer limit.
MySQL mediumtext maps to arktype string
MySQL mediumtext() column type maps to arktype type.string.atMostLength(16_777_215) schema, based on unsigned 24-bit integer limit.
MySQL longtext maps to arktype string
MySQL longtext() column type maps to arktype type.string.atMostLength(4_294_967_295) schema, based on unsigned 32-bit integer limit.
MySQL text types with enum option map to enumerated
MySQL tinytext({ enum: ... }), mediumtext({ enum: ... }), text({ enum: ... }), longtext({ enum: ... }), char({ enum: ... }), and varchar({ enum: ... }) column types with enum option map to arktype type.enumerated(...enum) schema.
MySQL smallint maps to arktype integer
MySQL smallint() column type maps to arktype type.keywords.number.integer.atLeast(-32_768).atMost(32_767) schema, representing 16-bit signed integer limits.
MySQL float maps to arktype number
MySQL float() column type maps to arktype type.number.atLeast(-8_388_608).atMost(8_388_607) schema, representing 24-bit integer limits.
MySQL mediumint maps to arktype integer
MySQL mediumint() column type maps to arktype type.keywords.number.integer.atLeast(-8_388_608).atMost(8_388_607) schema, representing 24-bit signed integer limits.
MySQL unsigned float maps to arktype number
MySQL float({ unsigned: true }) column type maps to arktype type.number.atLeast(0).atMost(16_777_215) schema, representing unsigned 24-bit integer limits.
MySQL unsigned mediumint maps to arktype integer
MySQL mediumint({ unsigned: true }) column type maps to arktype type.keywords.number.integer.atLeast(0).atMost(16_777_215) schema, representing unsigned 24-bit integer limits.
MySQL int maps to arktype integer
MySQL int() column type maps to arktype type.keywords.number.integer.atLeast(-2_147_483_648).atMost(2_147_483_647) schema, representing 32-bit signed integer limits.
MySQL unsigned int maps to arktype integer
MySQL int({ unsigned: true }) column type maps to arktype type.keywords.number.integer.atLeast(0).atMost(4_294_967_295) schema, representing unsigned 32-bit integer limits.
MySQL double and real map to arktype number
MySQL double() and real() column types map to arktype type.number.atLeast(-140_737_488_355_328).atMost(140_737_488_355_327) schema, representing 48-bit integer limits.
MySQL unsigned double and real map to arktype number
MySQL double({ unsigned: true }) and real() column types map to arktype type.number.atLeast(0).atMost(281_474_976_710_655) schema, representing unsigned 48-bit integer limits.
MySQL unsigned decimal with mode number maps to arktype number
MySQL decimal({ mode: 'number', unsigned: true }) column type maps to arktype type.number.atLeast(0).atMost(9_007_199_254_740_991) schema.
MySQL unsigned bigint with mode number maps to arktype integer
MySQL bigint({ mode: 'number', unsigned: true }) column type maps to arktype type.keywords.number.integer.atLeast(0).atMost(9_007_199_254_740_991) schema, using JavaScript safe integers.
MySQL bigint with mode string maps to arktype string with validation
MySQL bigint({ mode: 'string' }) column type maps to arktype type.string.narrow() schema that validates the string represents a number within 64-bit signed integer range (-9_223_372_036_854_775_808n to 9_223_372_036_854_775_807n).
MySQL unsigned bigint with mode string maps to arktype string
MySQL bigint({ mode: 'string', unsigned: true }) column type maps to arktype type.string.narrow() schema that validates the string represents a non-negative number within unsigned 64-bit integer range (0n to 18_446_744_073_709_551_615n).
MySQL bigint with mode bigint maps to arktype bigint
MySQL bigint({ mode: 'bigint' }) column type maps to arktype type.bigint.narrow() schema with 64-bit signed integer validation ranging from -9_223_372_036_854_775_808n to 9_223_372_036_854_775_807n.
MySQL unsigned bigint with mode bigint maps to arktype bigint
MySQL bigint({ mode: 'bigint', unsigned: true }) column type maps to arktype type.bigint.narrow() schema with unsigned 64-bit integer validation ranging from 0n to 18_446_744_073_709_551_615n.
MySQL serial maps to arktype integer
MySQL serial() column type maps to arktype type.keywords.number.integer.atLeast(0).atMost(9_007_199_254_740_991) schema, representing JavaScript max safe integer.
MySQL year maps to arktype integer
MySQL year() column type maps to arktype type.keywords.number.integer.atLeast(1_901).atMost(2_155) schema.
MySQL json maps to arktype string or unknown array or object
MySQL json() column type maps to arktype type('string | number | boolean | null').or(type('unknown.any[] | Record<string, unknown.any>')) schema, accepting primitive values or arrays/objects.