schema.cjs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 schema_exports = {};
  20. __export(schema_exports, {
  21. SingleStoreSchema: () => SingleStoreSchema,
  22. isSingleStoreSchema: () => isSingleStoreSchema,
  23. singlestoreDatabase: () => singlestoreDatabase,
  24. singlestoreSchema: () => singlestoreSchema
  25. });
  26. module.exports = __toCommonJS(schema_exports);
  27. var import_entity = require("../entity.cjs");
  28. var import_table = require("./table.cjs");
  29. class SingleStoreSchema {
  30. constructor(schemaName) {
  31. this.schemaName = schemaName;
  32. }
  33. static [import_entity.entityKind] = "SingleStoreSchema";
  34. table = (name, columns, extraConfig) => {
  35. return (0, import_table.singlestoreTableWithSchema)(name, columns, extraConfig, this.schemaName);
  36. };
  37. /*
  38. view = ((name, columns) => {
  39. return singlestoreViewWithSchema(name, columns, this.schemaName);
  40. }) as typeof singlestoreView; */
  41. }
  42. function isSingleStoreSchema(obj) {
  43. return (0, import_entity.is)(obj, SingleStoreSchema);
  44. }
  45. function singlestoreDatabase(name) {
  46. return new SingleStoreSchema(name);
  47. }
  48. const singlestoreSchema = singlestoreDatabase;
  49. // Annotate the CommonJS export names for ESM import in node:
  50. 0 && (module.exports = {
  51. SingleStoreSchema,
  52. isSingleStoreSchema,
  53. singlestoreDatabase,
  54. singlestoreSchema
  55. });
  56. //# sourceMappingURL=schema.cjs.map