{"version":3,"file":"schema.cjs","names":["entityKind","singlestoreTableWithSchema"],"sources":["../../src/singlestore-core/schema.ts"],"sourcesContent":["import type { Casing } from '~/casing.ts';\nimport { entityKind, is } from '~/entity.ts';\nimport { type SingleStoreTableFn, singlestoreTableWithSchema } from './table.ts';\n/* import { type singlestoreView, singlestoreViewWithSchema } from './view.ts'; */\n\nexport class SingleStoreSchema<TName extends string = string> {\n\tstatic readonly [entityKind]: string = 'SingleStoreSchema';\n\n\tconstructor(\n\t\tpublic readonly schemaName: TName,\n\t\tprotected casing: Casing | undefined,\n\t) {}\n\n\ttable: SingleStoreTableFn<TName> = (name, columns, extraConfig) => {\n\t\treturn singlestoreTableWithSchema(name, columns, extraConfig, this.schemaName, this.casing);\n\t};\n\t/*\n\tview = ((name, columns) => {\n\t\treturn singlestoreViewWithSchema(name, columns, this.schemaName);\n\t}) as typeof singlestoreView; */\n}\n\n/** @deprecated - use `instanceof SingleStoreSchema` */\nexport function isSingleStoreSchema(obj: unknown): obj is SingleStoreSchema {\n\treturn is(obj, SingleStoreSchema);\n}\n\n/**\n * Create a SingleStore schema.\n * https://docs.singlestore.com/cloud/create-a-database/\n *\n * @param name singlestore use schema name\n * @returns SingleStore schema\n */\nexport function singlestoreDatabase<TName extends string>(name: TName): SingleStoreSchema<TName>;\n/** @internal */\nexport function singlestoreDatabase<TName extends string>(name: TName, casing?: Casing): SingleStoreSchema<TName>;\n/** @internal */\nexport function singlestoreDatabase<TName extends string>(name: TName, casing?: Casing): SingleStoreSchema<TName> {\n\treturn new SingleStoreSchema(name, casing);\n}\n\n/**\n * @see singlestoreDatabase\n */\nexport const singlestoreSchema = singlestoreDatabase;\n"],"mappings":";;;;;;AAKA,IAAa,oBAAb,MAA8D;CAC7D,QAAiBA,0BAAsB;CAEvC,YACC,AAAgB,YAChB,AAAU,QACT;EAFe;EACN;;CAGX,SAAoC,MAAM,SAAS,gBAAgB;AAClE,SAAOC,0DAA2B,MAAM,SAAS,aAAa,KAAK,YAAY,KAAK,OAAO;;;;AAS7F,SAAgB,oBAAoB,KAAwC;AAC3E,4BAAU,KAAK,kBAAkB;;;AAclC,SAAgB,oBAA0C,MAAa,QAA2C;AACjH,QAAO,IAAI,kBAAkB,MAAM,OAAO;;;;;AAM3C,MAAa,oBAAoB"}