drizzle-orm
Version:
Drizzle ORM package for SQL databases
33 lines • 764 B
JavaScript
import { entityKind } from "../../entity.js";
import { PgColumn, PgColumnBuilder } from "./common.js";
class PgSmallIntBuilder extends PgColumnBuilder {
static [entityKind] = "PgSmallIntBuilder";
constructor(name) {
super(name, "number", "PgSmallInt");
}
/** @internal */
build(table) {
return new PgSmallInt(table, this.config);
}
}
class PgSmallInt extends PgColumn {
static [entityKind] = "PgSmallInt";
getSQLType() {
return "smallint";
}
mapFromDriverValue = (value) => {
if (typeof value === "string") {
return Number(value);
}
return value;
};
}
function smallint(name) {
return new PgSmallIntBuilder(name);
}
export {
PgSmallInt,
PgSmallIntBuilder,
smallint
};
//# sourceMappingURL=smallint.js.map