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.
Files changed (109) hide show
  1. package/dist/canonical-BbnqavJm.mjs +972 -0
  2. package/dist/codegen.d.mts +107 -0
  3. package/dist/codegen.mjs +1199 -0
  4. package/dist/column-CXMxx8Hq.mjs +118 -0
  5. package/dist/complete-D5Djh-zo.mjs +1788 -0
  6. package/dist/complete-types-BdFqUfbb.d.mts +371 -0
  7. package/dist/core.d.mts +33 -0
  8. package/dist/core.mjs +36 -0
  9. package/dist/ddl.d.mts +118 -0
  10. package/dist/ddl.mjs +1120 -0
  11. package/dist/dialect-b2-Z6uBF.mjs +13 -0
  12. package/dist/diff.d.mts +2 -0
  13. package/dist/diff.mjs +883 -0
  14. package/dist/drizzle-mysql.d.mts +24 -0
  15. package/dist/drizzle-mysql.mjs +72 -0
  16. package/dist/drizzle-postgres.d.mts +24 -0
  17. package/dist/drizzle-postgres.mjs +73 -0
  18. package/dist/drizzle-sqlite.d.mts +24 -0
  19. package/dist/drizzle-sqlite.mjs +82 -0
  20. package/dist/drizzle.d.mts +13 -0
  21. package/dist/drizzle.mjs +2 -0
  22. package/dist/errors-BGCoLe_r.mjs +14 -0
  23. package/dist/errors-Dxv73YJu.mjs +26 -0
  24. package/dist/explain-CkIK13L_.mjs +98 -0
  25. package/dist/index-Ds7-mhJi.d.mts +146 -0
  26. package/dist/index-Dug5HnLB.d.mts +204 -0
  27. package/dist/index.d.mts +2 -0
  28. package/dist/index.mjs +1276 -0
  29. package/dist/introspection.d.mts +117 -0
  30. package/dist/introspection.mjs +4341 -0
  31. package/dist/json-CUZlv4HT.mjs +169 -0
  32. package/dist/migration.d.mts +215 -0
  33. package/dist/migration.mjs +1161 -0
  34. package/dist/mysql-DqkqXB6A.mjs +355 -0
  35. package/dist/mysql.d.mts +5 -0
  36. package/dist/mysql.mjs +50 -0
  37. package/dist/naming-QVCOnSj2.mjs +20 -0
  38. package/dist/omit-OxV58AwX.mjs +5 -0
  39. package/dist/on-conflict-BxnxubMb.mjs +143 -0
  40. package/dist/postgres-DEBBeh52.mjs +235 -0
  41. package/dist/postgres.d.mts +123 -0
  42. package/dist/postgres.mjs +52 -0
  43. package/dist/registry-BufIskVN.mjs +569 -0
  44. package/dist/relational-DCZrrNia.mjs +77 -0
  45. package/dist/runtime-BTr-MTlo.mjs +193 -0
  46. package/dist/schema.d.mts +2 -0
  47. package/dist/schema.mjs +5 -0
  48. package/dist/serialize-PF1cfH2P.mjs +556 -0
  49. package/dist/snapshot-CWPgzxNx.mjs +392 -0
  50. package/dist/snapshot.d.mts +4 -0
  51. package/dist/snapshot.mjs +8 -0
  52. package/dist/source-DUoJVXmL.mjs +68 -0
  53. package/dist/sqlite-BU6DBxef.mjs +320 -0
  54. package/dist/sqlite.d.mts +5 -0
  55. package/dist/sqlite.mjs +48 -0
  56. package/dist/standard-BTVYKh_F.mjs +12 -0
  57. package/dist/table-llv9tsZ8.mjs +384 -0
  58. package/dist/types-4Q076HKo.d.mts +3636 -0
  59. package/dist/types-BX0mckiU.d.mts +644 -0
  60. package/dist/types-CO1KaRNc.d.mts +46 -0
  61. package/dist/types-Cec0xzo4.mjs +116 -0
  62. package/dist/value-BvilP0oz.mjs +29 -0
  63. package/dist/vite/ambient.d.ts +449 -0
  64. package/dist/vite.d.mts +35 -0
  65. package/dist/vite.mjs +498 -0
  66. package/docs/config.json +21 -0
  67. package/docs/dialects-and-execution.md +427 -0
  68. package/docs/getting-started.md +96 -0
  69. package/docs/guides/compose-queries.md +225 -0
  70. package/docs/guides/drizzle.md +129 -0
  71. package/docs/guides/extensions/dialects.md +40 -0
  72. package/docs/guides/extensions/overview.md +36 -0
  73. package/docs/guides/extensions/sources-and-clauses.md +82 -0
  74. package/docs/guides/extensions/typed-expressions.md +94 -0
  75. package/docs/guides/extensions/unsafe-syntax.md +27 -0
  76. package/docs/guides/json.md +65 -0
  77. package/docs/guides/mutations.md +138 -0
  78. package/docs/guides/select/conditions.md +110 -0
  79. package/docs/guides/select/grouping-and-windows.md +82 -0
  80. package/docs/guides/select/ordering-and-pagination.md +78 -0
  81. package/docs/guides/select/overview.md +139 -0
  82. package/docs/guides/sql-templates.md +157 -0
  83. package/docs/guides/vite-plugin.md +92 -0
  84. package/docs/index.md +111 -0
  85. package/docs/query-model/fragments.md +109 -0
  86. package/docs/query-model/result-shapes.md +125 -0
  87. package/docs/query-model/source-scope.md +182 -0
  88. package/docs/reference/introspection-support.md +196 -0
  89. package/docs/reference/mysql-snapshot.md +55 -0
  90. package/docs/reference/postgres-snapshot.md +61 -0
  91. package/docs/reference/sqlite-snapshot.md +53 -0
  92. package/docs/reference/supported-surface.md +104 -0
  93. package/docs/schema/catalog-model.md +58 -0
  94. package/docs/schema/code-generation.md +139 -0
  95. package/docs/schema/columns-and-writes.md +130 -0
  96. package/docs/schema/constraints-and-indexes.md +180 -0
  97. package/docs/schema/ddl-emission.md +75 -0
  98. package/docs/schema/diff.md +75 -0
  99. package/docs/schema/introspection.md +214 -0
  100. package/docs/schema/migration-plans.md +76 -0
  101. package/docs/schema/snapshots.md +93 -0
  102. package/docs/schema/storage-and-schema-sql.md +104 -0
  103. package/docs/schema/tables-and-names.md +106 -0
  104. package/docs/sql-semantic-types.md +141 -0
  105. package/docs/troubleshooting.md +151 -0
  106. package/package.json +132 -10
  107. package/skills/qubu/SKILL.md +42 -0
  108. package/skills/qubu/agents/openai.yaml +6 -0
  109. package/readme.md +0 -1
@@ -0,0 +1,118 @@
1
+ import { a as assertDialectCapability } from "./json-CUZlv4HT.mjs";
2
+ //#region src/core/fragment.ts
3
+ function fragment(render) {
4
+ return Object.freeze({ render });
5
+ }
6
+ function sequence(parts, separator = " ") {
7
+ return fragment((context) => {
8
+ let first = true;
9
+ for (const part of parts) {
10
+ if (!first) context.append(separator);
11
+ context.render(part);
12
+ first = false;
13
+ }
14
+ });
15
+ }
16
+ function parenthesize(part) {
17
+ return fragment((context) => {
18
+ context.append("(");
19
+ context.render(part);
20
+ context.append(")");
21
+ });
22
+ }
23
+ function isFragment(value) {
24
+ return typeof value === "object" && value !== null && "render" in value && typeof value.render === "function";
25
+ }
26
+ //#endregion
27
+ //#region src/expressions/types.ts
28
+ /** Runtime/type-level proof that an expression is safe to use in schema SQL. */
29
+ const schemaExpressionBrand = Symbol("qubu.schema-expression");
30
+ /** Add a concrete dialect requirement without dropping expression metadata. */
31
+ function withDialectCapability(expression, capability) {
32
+ const wrapped = makeExpression(expression.expressionKind, (context) => {
33
+ assertDialectCapability(context.dialect, capability);
34
+ context.render(expression);
35
+ });
36
+ return isSchemaExpression(expression) ? markSchemaExpression(wrapped) : wrapped;
37
+ }
38
+ function makeExpression(expressionKind, render, expressionCategory) {
39
+ return Object.freeze({
40
+ expressionKind,
41
+ ...expressionCategory ? { expressionCategory } : {},
42
+ ...fragment(render)
43
+ });
44
+ }
45
+ /** Mark a query-only expression category without changing its SQL renderer. */
46
+ function markExpressionCategory(expression, category) {
47
+ return Object.freeze({
48
+ ...expression,
49
+ expressionCategory: category
50
+ });
51
+ }
52
+ /**
53
+ * Mark a built-in or explicitly audited renderer as schema-deterministic.
54
+ * Prefer {@link defineSchemaExpression} for application extensions because it
55
+ * supplies a restricted schema rendering context.
56
+ */
57
+ function makeSchemaExpression(expressionKind, render) {
58
+ const expression = makeExpression(expressionKind, render);
59
+ return Object.freeze({
60
+ ...expression,
61
+ [schemaExpressionBrand]: true
62
+ });
63
+ }
64
+ /** Add the schema-determinism brand to an explicitly audited expression. */
65
+ function markSchemaExpression(expression) {
66
+ if (isSchemaExpression(expression)) return expression;
67
+ return Object.freeze({
68
+ ...expression,
69
+ [schemaExpressionBrand]: true
70
+ });
71
+ }
72
+ /** Test the runtime brand used by schema rendering and validation. */
73
+ function isSchemaExpression(value) {
74
+ return typeof value === "object" && value !== null && schemaExpressionBrand in value && value[schemaExpressionBrand] === true;
75
+ }
76
+ function isExpression(value) {
77
+ return typeof value === "object" && value !== null && "expressionKind" in value && "render" in value && typeof value.render === "function";
78
+ }
79
+ //#endregion
80
+ //#region src/core/primitives/identifier.ts
81
+ function identifier(name) {
82
+ return fragment((context) => context.append(context.dialect.quoteIdentifier(name)));
83
+ }
84
+ function qualifiedIdentifier(...parts) {
85
+ return fragment((context) => {
86
+ parts.forEach((part, index) => {
87
+ if (index > 0) context.append(".");
88
+ context.append(context.dialect.quoteIdentifier(part));
89
+ });
90
+ });
91
+ }
92
+ //#endregion
93
+ //#region src/expressions/column.ts
94
+ function createColumnReference(columnName, sourceReference, fieldName) {
95
+ const expression = makeSchemaExpression("column", (context) => {
96
+ if (context.renderColumnReference) {
97
+ context.renderColumnReference(columnName);
98
+ return;
99
+ }
100
+ context.render(sourceReference);
101
+ context.append(".");
102
+ context.render(identifier(columnName));
103
+ });
104
+ return Object.freeze({
105
+ ...expression,
106
+ fieldName,
107
+ columnName
108
+ });
109
+ }
110
+ function isColumnReference(value) {
111
+ return typeof value === "object" && value !== null && "expressionKind" in value && value.expressionKind === "column";
112
+ }
113
+ /** Turn an expression into a fragment that renders it without changing it. */
114
+ function expressionFragment(expression) {
115
+ return fragment((context) => context.render(expression));
116
+ }
117
+ //#endregion
118
+ export { qualifiedIdentifier as a, makeExpression as c, markSchemaExpression as d, withDialectCapability as f, sequence as g, parenthesize as h, identifier as i, makeSchemaExpression as l, isFragment as m, expressionFragment as n, isExpression as o, fragment as p, isColumnReference as r, isSchemaExpression as s, createColumnReference as t, markExpressionCategory as u };