schema.js 848 B

1234567891011121314151617181920212223242526272829
  1. import { entityKind, is } from "../entity.js";
  2. import { singlestoreTableWithSchema } from "./table.js";
  3. class SingleStoreSchema {
  4. constructor(schemaName) {
  5. this.schemaName = schemaName;
  6. }
  7. static [entityKind] = "SingleStoreSchema";
  8. table = (name, columns, extraConfig) => {
  9. return singlestoreTableWithSchema(name, columns, extraConfig, this.schemaName);
  10. };
  11. /*
  12. view = ((name, columns) => {
  13. return singlestoreViewWithSchema(name, columns, this.schemaName);
  14. }) as typeof singlestoreView; */
  15. }
  16. function isSingleStoreSchema(obj) {
  17. return is(obj, SingleStoreSchema);
  18. }
  19. function singlestoreDatabase(name) {
  20. return new SingleStoreSchema(name);
  21. }
  22. const singlestoreSchema = singlestoreDatabase;
  23. export {
  24. SingleStoreSchema,
  25. isSingleStoreSchema,
  26. singlestoreDatabase,
  27. singlestoreSchema
  28. };
  29. //# sourceMappingURL=schema.js.map