qubu 0.0.0 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canonical-BbnqavJm.mjs +972 -0
- package/dist/codegen.d.mts +107 -0
- package/dist/codegen.mjs +1199 -0
- package/dist/column-CXMxx8Hq.mjs +118 -0
- package/dist/complete-D5Djh-zo.mjs +1788 -0
- package/dist/complete-types-BdFqUfbb.d.mts +371 -0
- package/dist/core.d.mts +33 -0
- package/dist/core.mjs +36 -0
- package/dist/ddl.d.mts +118 -0
- package/dist/ddl.mjs +1120 -0
- package/dist/dialect-b2-Z6uBF.mjs +13 -0
- package/dist/diff.d.mts +2 -0
- package/dist/diff.mjs +883 -0
- package/dist/drizzle-mysql.d.mts +24 -0
- package/dist/drizzle-mysql.mjs +72 -0
- package/dist/drizzle-postgres.d.mts +24 -0
- package/dist/drizzle-postgres.mjs +73 -0
- package/dist/drizzle-sqlite.d.mts +24 -0
- package/dist/drizzle-sqlite.mjs +82 -0
- package/dist/drizzle.d.mts +13 -0
- package/dist/drizzle.mjs +2 -0
- package/dist/errors-BGCoLe_r.mjs +14 -0
- package/dist/errors-Dxv73YJu.mjs +26 -0
- package/dist/explain-CkIK13L_.mjs +98 -0
- package/dist/index-Ds7-mhJi.d.mts +146 -0
- package/dist/index-Dug5HnLB.d.mts +204 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1276 -0
- package/dist/introspection.d.mts +117 -0
- package/dist/introspection.mjs +4341 -0
- package/dist/json-CUZlv4HT.mjs +169 -0
- package/dist/migration.d.mts +215 -0
- package/dist/migration.mjs +1161 -0
- package/dist/mysql-DqkqXB6A.mjs +355 -0
- package/dist/mysql.d.mts +5 -0
- package/dist/mysql.mjs +50 -0
- package/dist/naming-QVCOnSj2.mjs +20 -0
- package/dist/omit-OxV58AwX.mjs +5 -0
- package/dist/on-conflict-BxnxubMb.mjs +143 -0
- package/dist/postgres-DEBBeh52.mjs +235 -0
- package/dist/postgres.d.mts +123 -0
- package/dist/postgres.mjs +52 -0
- package/dist/registry-BufIskVN.mjs +569 -0
- package/dist/relational-DCZrrNia.mjs +77 -0
- package/dist/runtime-BTr-MTlo.mjs +193 -0
- package/dist/schema.d.mts +2 -0
- package/dist/schema.mjs +5 -0
- package/dist/serialize-PF1cfH2P.mjs +556 -0
- package/dist/snapshot-CWPgzxNx.mjs +392 -0
- package/dist/snapshot.d.mts +4 -0
- package/dist/snapshot.mjs +8 -0
- package/dist/source-DUoJVXmL.mjs +68 -0
- package/dist/sqlite-BU6DBxef.mjs +320 -0
- package/dist/sqlite.d.mts +5 -0
- package/dist/sqlite.mjs +48 -0
- package/dist/standard-BTVYKh_F.mjs +12 -0
- package/dist/table-llv9tsZ8.mjs +384 -0
- package/dist/types-4Q076HKo.d.mts +3636 -0
- package/dist/types-BX0mckiU.d.mts +644 -0
- package/dist/types-CO1KaRNc.d.mts +46 -0
- package/dist/types-Cec0xzo4.mjs +116 -0
- package/dist/value-BvilP0oz.mjs +29 -0
- package/dist/vite/ambient.d.ts +449 -0
- package/dist/vite.d.mts +35 -0
- package/dist/vite.mjs +498 -0
- package/docs/config.json +21 -0
- package/docs/dialects-and-execution.md +427 -0
- package/docs/getting-started.md +96 -0
- package/docs/guides/compose-queries.md +225 -0
- package/docs/guides/drizzle.md +129 -0
- package/docs/guides/extensions/dialects.md +40 -0
- package/docs/guides/extensions/overview.md +36 -0
- package/docs/guides/extensions/sources-and-clauses.md +82 -0
- package/docs/guides/extensions/typed-expressions.md +94 -0
- package/docs/guides/extensions/unsafe-syntax.md +27 -0
- package/docs/guides/json.md +65 -0
- package/docs/guides/mutations.md +138 -0
- package/docs/guides/select/conditions.md +110 -0
- package/docs/guides/select/grouping-and-windows.md +82 -0
- package/docs/guides/select/ordering-and-pagination.md +78 -0
- package/docs/guides/select/overview.md +139 -0
- package/docs/guides/sql-templates.md +157 -0
- package/docs/guides/vite-plugin.md +92 -0
- package/docs/index.md +111 -0
- package/docs/query-model/fragments.md +109 -0
- package/docs/query-model/result-shapes.md +125 -0
- package/docs/query-model/source-scope.md +182 -0
- package/docs/reference/introspection-support.md +196 -0
- package/docs/reference/mysql-snapshot.md +55 -0
- package/docs/reference/postgres-snapshot.md +61 -0
- package/docs/reference/sqlite-snapshot.md +53 -0
- package/docs/reference/supported-surface.md +104 -0
- package/docs/schema/catalog-model.md +58 -0
- package/docs/schema/code-generation.md +139 -0
- package/docs/schema/columns-and-writes.md +130 -0
- package/docs/schema/constraints-and-indexes.md +180 -0
- package/docs/schema/ddl-emission.md +75 -0
- package/docs/schema/diff.md +75 -0
- package/docs/schema/introspection.md +214 -0
- package/docs/schema/migration-plans.md +76 -0
- package/docs/schema/snapshots.md +93 -0
- package/docs/schema/storage-and-schema-sql.md +104 -0
- package/docs/schema/tables-and-names.md +106 -0
- package/docs/sql-semantic-types.md +141 -0
- package/docs/troubleshooting.md +151 -0
- package/package.json +132 -10
- package/skills/qubu/SKILL.md +42 -0
- package/skills/qubu/agents/openai.yaml +6 -0
- package/readme.md +0 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { St as IntrospectionDiagnostic, dt as IntrospectionResult, i as CatalogClassificationConfidence, p as CatalogDialect, z as CatalogPortableStorageType } from "./types-BX0mckiU.mjs";
|
|
2
|
+
//#region src/codegen/types.d.ts
|
|
3
|
+
/** TypeScript value types that the controlled source printer can emit. */
|
|
4
|
+
type CodegenApplicationType = 'unknown' | 'string' | 'number' | 'boolean' | 'bigint' | 'Date' | 'Uint8Array';
|
|
5
|
+
/** Qubu SQL semantic domains that generated columns can carry. */
|
|
6
|
+
type CodegenSqlDomain = 'unknown' | 'integer' | 'decimal' | 'text' | 'boolean' | 'date' | 'timestamp' | 'uuid' | 'json' | 'bigint' | 'binary';
|
|
7
|
+
/** One logical-name decision exposed to a generator naming callback. */
|
|
8
|
+
interface CodegenNameContext {
|
|
9
|
+
readonly kind: 'schema' | 'table' | 'column' | 'constraint' | 'index';
|
|
10
|
+
readonly physicalName: string;
|
|
11
|
+
readonly suggestedName: string;
|
|
12
|
+
readonly tablePhysicalName?: string;
|
|
13
|
+
readonly tableName?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Catalog facts available to a controlled column mapping callback. */
|
|
16
|
+
interface CodegenColumnContext {
|
|
17
|
+
readonly dialect: CatalogDialect;
|
|
18
|
+
readonly namespace: string;
|
|
19
|
+
readonly tablePhysicalName: string;
|
|
20
|
+
readonly tableName: string;
|
|
21
|
+
readonly columnPhysicalName: string;
|
|
22
|
+
readonly columnName: string;
|
|
23
|
+
readonly nativeType: string;
|
|
24
|
+
readonly portableType?: CatalogPortableStorageType;
|
|
25
|
+
readonly classificationConfidence?: CatalogClassificationConfidence;
|
|
26
|
+
readonly suggestedSqlDomain: CodegenSqlDomain;
|
|
27
|
+
}
|
|
28
|
+
/** Trusted type choices for one generated column. */
|
|
29
|
+
interface CodegenColumnMapping {
|
|
30
|
+
/** Selected application value type. Defaults to `unknown`. */
|
|
31
|
+
readonly output?: CodegenApplicationType;
|
|
32
|
+
/** Insert value type. Defaults to `unknown`. */
|
|
33
|
+
readonly insert?: CodegenApplicationType;
|
|
34
|
+
/** Update value type. Defaults to `unknown`. */
|
|
35
|
+
readonly update?: CodegenApplicationType;
|
|
36
|
+
/** SQL semantic domain. Defaults to the conservative catalog mapping. */
|
|
37
|
+
readonly sqlDomain?: CodegenSqlDomain;
|
|
38
|
+
}
|
|
39
|
+
/** Controlled customization points for generated logical names and types. */
|
|
40
|
+
interface SchemaCodegenOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Override one suggested camelCase name. The returned value must still be a
|
|
43
|
+
* safe camelCase logical ID, and table and schema names must be valid export
|
|
44
|
+
* bindings.
|
|
45
|
+
*/
|
|
46
|
+
readonly naming?: (context: CodegenNameContext) => string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Override trusted application types or a Qubu SQL domain for one column.
|
|
49
|
+
* The callback selects from fixed tokens and cannot inject source text.
|
|
50
|
+
*/
|
|
51
|
+
readonly mapColumn?: (context: CodegenColumnContext) => CodegenColumnMapping | undefined;
|
|
52
|
+
}
|
|
53
|
+
/** Stable generator findings added beside retained introspection diagnostics. */
|
|
54
|
+
type CodegenDiagnosticCode = IntrospectionDiagnostic['code'] | 'invalid-input' | 'lossy-input' | 'unsupported-snapshot' | 'omitted-fact' | 'unsafe-name' | 'name-collision' | 'invalid-option' | 'unrepresentable-fact' | 'excluded-object-family' | 'unsafe-source';
|
|
55
|
+
/** A path-addressed finding returned by schema source generation. */
|
|
56
|
+
interface CodegenDiagnostic extends Omit<IntrospectionDiagnostic, 'code'> {
|
|
57
|
+
readonly code: CodegenDiagnosticCode;
|
|
58
|
+
readonly relatedPaths?: readonly (readonly (string | number)[])[];
|
|
59
|
+
}
|
|
60
|
+
/** Successful source generation with all retained warnings and information. */
|
|
61
|
+
interface SchemaCodegenSuccess {
|
|
62
|
+
readonly ok: true;
|
|
63
|
+
readonly source: string;
|
|
64
|
+
readonly diagnostics: readonly CodegenDiagnostic[];
|
|
65
|
+
}
|
|
66
|
+
/** Failed generation. No partial source is returned. */
|
|
67
|
+
interface SchemaCodegenFailure {
|
|
68
|
+
readonly ok: false;
|
|
69
|
+
readonly source?: never;
|
|
70
|
+
readonly diagnostics: readonly CodegenDiagnostic[];
|
|
71
|
+
}
|
|
72
|
+
/** Non-throwing result returned by schema source generation. */
|
|
73
|
+
type SchemaCodegenResult = SchemaCodegenSuccess | SchemaCodegenFailure;
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/codegen/generate.d.ts
|
|
76
|
+
/**
|
|
77
|
+
* Generate a deterministic TypeScript module from one introspection result.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* Generation accepts only a successful, non-lossy Snapshot v1 result for one
|
|
81
|
+
* PostgreSQL, SQLite, or MySQL namespace. It is pure: it opens no connection,
|
|
82
|
+
* performs no filesystem writes, and never evaluates catalog SQL. Existing
|
|
83
|
+
* introspection diagnostics are copied into the result. Any error returns no
|
|
84
|
+
* source.
|
|
85
|
+
*
|
|
86
|
+
* The generated module exports every ordinary table plus one schema registry.
|
|
87
|
+
* Physical names and native declarations remain escaped string literals.
|
|
88
|
+
* Catalog expressions use dialect-tagged schema data, checks use
|
|
89
|
+
* `catalogCheck()`, and foreign keys use lazy `catalogForeignKey()` targets.
|
|
90
|
+
* Foreign keys must have equal local and target arity and target an exact
|
|
91
|
+
* primary key, strict unique key, or candidate index. Nullable database UNIQUE
|
|
92
|
+
* constraints do not provide that candidate-key proof and fail generation.
|
|
93
|
+
*
|
|
94
|
+
* Application output, insert, and update types default independently to
|
|
95
|
+
* `unknown`. The generator may attach a conservative SQL semantic domain, and
|
|
96
|
+
* {@link SchemaCodegenOptions.mapColumn} can override either type axis with a
|
|
97
|
+
* fixed token. Naming callbacks can replace suggested camelCase IDs, but they
|
|
98
|
+
* cannot supply source syntax.
|
|
99
|
+
*
|
|
100
|
+
* @param input A completed introspection operation. Failed and lossy results
|
|
101
|
+
* are reported as diagnostics rather than thrown errors.
|
|
102
|
+
* @param options Controlled logical-name and column-type mappings.
|
|
103
|
+
* @returns Generated source and diagnostics, or diagnostics without source.
|
|
104
|
+
*/
|
|
105
|
+
declare function generateSchemaSource(input: IntrospectionResult, options?: SchemaCodegenOptions): SchemaCodegenResult;
|
|
106
|
+
//#endregion
|
|
107
|
+
export { type CodegenApplicationType, type CodegenColumnContext, type CodegenColumnMapping, type CodegenDiagnostic, type CodegenDiagnosticCode, type CodegenNameContext, type CodegenSqlDomain, type SchemaCodegenFailure, type SchemaCodegenOptions, type SchemaCodegenResult, type SchemaCodegenSuccess, generateSchemaSource };
|