TenantAtlas/apps/platform/.pnpm-store/v10/files/65/afbfb7755f44042e95249c82e0857dfcd6b8a8cba0cf18d2488de03e449e107631b5ff82260e3a82791e379213639284c68003fa49c08de126acbb832d8a00
Ahmed Darrazi 9f74f7a658
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 51s
feat: compress governance operator outcomes
2026-04-19 14:15:11 +02:00

1 line
2.6 KiB
Plaintext

{"version":3,"sources":["../../src/gel-core/schema.ts"],"sourcesContent":["import { entityKind, is } from '~/entity.ts';\nimport { SQL, sql, type SQLWrapper } from '~/sql/sql.ts';\nimport type { gelSequence } from './sequence.ts';\nimport { gelSequenceWithSchema } from './sequence.ts';\nimport { type GelTableFn, gelTableWithSchema } from './table.ts';\n// import type { gelMaterializedView, gelView } from './view.ts';\n// import { gelMaterializedViewWithSchema, gelViewWithSchema } from './view.ts';\n\nexport class GelSchema<TName extends string = string> implements SQLWrapper {\n\tstatic readonly [entityKind]: string = 'GelSchema';\n\tconstructor(\n\t\tpublic readonly schemaName: TName,\n\t) {}\n\n\ttable: GelTableFn<TName> = ((name, columns, extraConfig) => {\n\t\treturn gelTableWithSchema(name, columns, extraConfig, this.schemaName);\n\t});\n\n\t// view = ((name, columns) => {\n\t// \treturn gelViewWithSchema(name, columns, this.schemaName);\n\t// }) as typeof gelView;\n\n\t// materializedView = ((name, columns) => {\n\t// \treturn gelMaterializedViewWithSchema(name, columns, this.schemaName);\n\t// }) as typeof gelMaterializedView;\n\n\t// enum: typeof gelEnum = ((name, values) => {\n\t// \treturn gelEnumWithSchema(name, values, this.schemaName);\n\t// });\n\n\tsequence: typeof gelSequence = ((name, options) => {\n\t\treturn gelSequenceWithSchema(name, options, this.schemaName);\n\t});\n\n\tgetSQL(): SQL {\n\t\treturn new SQL([sql.identifier(this.schemaName)]);\n\t}\n\n\tshouldOmitSQLParens(): boolean {\n\t\treturn true;\n\t}\n}\n\nexport function isGelSchema(obj: unknown): obj is GelSchema {\n\treturn is(obj, GelSchema);\n}\n\nexport function gelSchema<T extends string>(name: T) {\n\tif (name === 'public') {\n\t\tthrow new Error(\n\t\t\t`You can't specify 'public' as schema name. Postgres is using public schema by default. If you want to use 'public' schema, just use GelTable() instead of creating a schema`,\n\t\t);\n\t}\n\n\treturn new GelSchema(name);\n}\n"],"mappings":"AAAA,SAAS,YAAY,UAAU;AAC/B,SAAS,KAAK,WAA4B;AAE1C,SAAS,6BAA6B;AACtC,SAA0B,0BAA0B;AAI7C,MAAM,UAA+D;AAAA,EAE3E,YACiB,YACf;AADe;AAAA,EACd;AAAA,EAHH,QAAiB,UAAU,IAAY;AAAA,EAKvC,QAA4B,CAAC,MAAM,SAAS,gBAAgB;AAC3D,WAAO,mBAAmB,MAAM,SAAS,aAAa,KAAK,UAAU;AAAA,EACtE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,WAAgC,CAAC,MAAM,YAAY;AAClD,WAAO,sBAAsB,MAAM,SAAS,KAAK,UAAU;AAAA,EAC5D;AAAA,EAEA,SAAc;AACb,WAAO,IAAI,IAAI,CAAC,IAAI,WAAW,KAAK,UAAU,CAAC,CAAC;AAAA,EACjD;AAAA,EAEA,sBAA+B;AAC9B,WAAO;AAAA,EACR;AACD;AAEO,SAAS,YAAY,KAAgC;AAC3D,SAAO,GAAG,KAAK,SAAS;AACzB;AAEO,SAAS,UAA4B,MAAS;AACpD,MAAI,SAAS,UAAU;AACtB,UAAM,IAAI;AAAA,MACT;AAAA,IACD;AAAA,EACD;AAEA,SAAO,IAAI,UAAU,IAAI;AAC1B;","names":[]}