int.common.cjs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. "use strict";
  2. var __defProp = Object.defineProperty;
  3. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  4. var __getOwnPropNames = Object.getOwnPropertyNames;
  5. var __hasOwnProp = Object.prototype.hasOwnProperty;
  6. var __export = (target, all) => {
  7. for (var name in all)
  8. __defProp(target, name, { get: all[name], enumerable: true });
  9. };
  10. var __copyProps = (to, from, except, desc) => {
  11. if (from && typeof from === "object" || typeof from === "function") {
  12. for (let key of __getOwnPropNames(from))
  13. if (!__hasOwnProp.call(to, key) && key !== except)
  14. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  15. }
  16. return to;
  17. };
  18. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  19. var int_common_exports = {};
  20. __export(int_common_exports, {
  21. PgIntColumnBaseBuilder: () => PgIntColumnBaseBuilder
  22. });
  23. module.exports = __toCommonJS(int_common_exports);
  24. var import_entity = require("../../entity.cjs");
  25. var import_common = require("./common.cjs");
  26. class PgIntColumnBaseBuilder extends import_common.PgColumnBuilder {
  27. static [import_entity.entityKind] = "PgIntColumnBaseBuilder";
  28. generatedAlwaysAsIdentity(sequence) {
  29. if (sequence) {
  30. const { name, ...options } = sequence;
  31. this.config.generatedIdentity = {
  32. type: "always",
  33. sequenceName: name,
  34. sequenceOptions: options
  35. };
  36. } else {
  37. this.config.generatedIdentity = {
  38. type: "always"
  39. };
  40. }
  41. this.config.hasDefault = true;
  42. this.config.notNull = true;
  43. return this;
  44. }
  45. generatedByDefaultAsIdentity(sequence) {
  46. if (sequence) {
  47. const { name, ...options } = sequence;
  48. this.config.generatedIdentity = {
  49. type: "byDefault",
  50. sequenceName: name,
  51. sequenceOptions: options
  52. };
  53. } else {
  54. this.config.generatedIdentity = {
  55. type: "byDefault"
  56. };
  57. }
  58. this.config.hasDefault = true;
  59. this.config.notNull = true;
  60. return this;
  61. }
  62. }
  63. // Annotate the CommonJS export names for ESM import in node:
  64. 0 && (module.exports = {
  65. PgIntColumnBaseBuilder
  66. });
  67. //# sourceMappingURL=int.common.cjs.map