UNPKG

alinea

Version:
47 lines (44 loc) 877 B
import { column } from "./chunk-H54PGW2N.js"; import { sql } from "./chunk-PNILF4WM.js"; // node_modules/rado/dist/universal/columns.js var idType = sql.universal({ sqlite: sql`integer`, postgres: sql`integer generated always as identity`, mysql: sql`int not null auto_increment` }); var blobType = sql.universal({ postgres: sql`bytea`, default: sql`blob` }); var numberType = sql.universal({ mysql: sql`double`, default: sql`numeric` }); var jsonbType = sql.universal({ mysql: sql`json`, default: sql`jsonb` }); function text(name) { return column({ name, type: column.text() }); } function integer(name) { return column({ name, type: column.integer() }); } function blob(name) { return column({ name, type: blobType, mapFromDriverValue(value) { return new Uint8Array(value); } }); } export { text, integer, blob };