smallserial.js 764 B

1234567891011121314151617181920212223242526272829303132
  1. import { entityKind } from "../../entity.js";
  2. import { PgColumn, PgColumnBuilder } from "./common.js";
  3. class PgSmallSerialBuilder extends PgColumnBuilder {
  4. static [entityKind] = "PgSmallSerialBuilder";
  5. constructor(name) {
  6. super(name, "number", "PgSmallSerial");
  7. this.config.hasDefault = true;
  8. this.config.notNull = true;
  9. }
  10. /** @internal */
  11. build(table) {
  12. return new PgSmallSerial(
  13. table,
  14. this.config
  15. );
  16. }
  17. }
  18. class PgSmallSerial extends PgColumn {
  19. static [entityKind] = "PgSmallSerial";
  20. getSQLType() {
  21. return "smallserial";
  22. }
  23. }
  24. function smallserial(name) {
  25. return new PgSmallSerialBuilder(name ?? "");
  26. }
  27. export {
  28. PgSmallSerial,
  29. PgSmallSerialBuilder,
  30. smallserial
  31. };
  32. //# sourceMappingURL=smallserial.js.map