column.cjs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 column_exports = {};
  20. __export(column_exports, {
  21. Column: () => Column
  22. });
  23. module.exports = __toCommonJS(column_exports);
  24. var import_entity = require("./entity.cjs");
  25. class Column {
  26. constructor(table, config) {
  27. this.table = table;
  28. this.config = config;
  29. this.name = config.name;
  30. this.keyAsName = config.keyAsName;
  31. this.notNull = config.notNull;
  32. this.default = config.default;
  33. this.defaultFn = config.defaultFn;
  34. this.onUpdateFn = config.onUpdateFn;
  35. this.hasDefault = config.hasDefault;
  36. this.primary = config.primaryKey;
  37. this.isUnique = config.isUnique;
  38. this.uniqueName = config.uniqueName;
  39. this.uniqueType = config.uniqueType;
  40. this.dataType = config.dataType;
  41. this.columnType = config.columnType;
  42. this.generated = config.generated;
  43. this.generatedIdentity = config.generatedIdentity;
  44. }
  45. static [import_entity.entityKind] = "Column";
  46. name;
  47. keyAsName;
  48. primary;
  49. notNull;
  50. default;
  51. defaultFn;
  52. onUpdateFn;
  53. hasDefault;
  54. isUnique;
  55. uniqueName;
  56. uniqueType;
  57. dataType;
  58. columnType;
  59. enumValues = void 0;
  60. generated = void 0;
  61. generatedIdentity = void 0;
  62. config;
  63. mapFromDriverValue(value) {
  64. return value;
  65. }
  66. mapToDriverValue(value) {
  67. return value;
  68. }
  69. // ** @internal */
  70. shouldDisableInsert() {
  71. return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
  72. }
  73. }
  74. // Annotate the CommonJS export names for ESM import in node:
  75. 0 && (module.exports = {
  76. Column
  77. });
  78. //# sourceMappingURL=column.cjs.map