CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
column.js54 linesDownload Raw Back to drizzle-orm
1import { entityKind } from "./entity.js";2class Column {3  constructor(table, config) {4    this.table = table;5    this.config = config;6    this.name = config.name;7    this.keyAsName = config.keyAsName;8    this.notNull = config.notNull;9    this.default = config.default;10    this.defaultFn = config.defaultFn;11    this.onUpdateFn = config.onUpdateFn;12    this.hasDefault = config.hasDefault;13    this.primary = config.primaryKey;14    this.isUnique = config.isUnique;15    this.uniqueName = config.uniqueName;16    this.uniqueType = config.uniqueType;17    this.dataType = config.dataType;18    this.columnType = config.columnType;19    this.generated = config.generated;20    this.generatedIdentity = config.generatedIdentity;21  }22  static [entityKind] = "Column";23  name;24  keyAsName;25  primary;26  notNull;27  default;28  defaultFn;29  onUpdateFn;30  hasDefault;31  isUnique;32  uniqueName;33  uniqueType;34  dataType;35  columnType;36  enumValues = void 0;37  generated = void 0;38  generatedIdentity = void 0;39  config;40  mapFromDriverValue(value) {41    return value;42  }43  mapToDriverValue(value) {44    return value;45  }46  // ** @internal */47  shouldDisableInsert() {48    return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";49  }50}51export {52  Column53};54//# sourceMappingURL=column.js.map