qubu 0.6.2 → 0.7.0

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 (73) hide show
  1. package/dist/codegen.d.mts +1 -1
  2. package/dist/codegen.mjs +1 -1
  3. package/dist/core.d.mts +1 -1
  4. package/dist/diff.d.mts +1 -1
  5. package/dist/index-DB07P2X8.d.mts +2 -0
  6. package/dist/index.d.mts +1 -1
  7. package/dist/introspection/mysql.d.mts +1 -1
  8. package/dist/introspection/postgres.d.mts +1 -1
  9. package/dist/introspection/sqlite.d.mts +1 -1
  10. package/dist/introspection.d.mts +3 -2
  11. package/dist/introspection.mjs +1 -1
  12. package/dist/mysql.d.mts +2 -2
  13. package/dist/postgres.d.mts +2 -2
  14. package/dist/schema.d.mts +1 -1
  15. package/dist/{serialize-Du2UPZMt.d.mts → serialize-Dg-Q55YQ.d.mts} +1 -1
  16. package/dist/snapshot/mysql.d.mts +2 -2
  17. package/dist/snapshot/postgres.d.mts +2 -2
  18. package/dist/snapshot/sqlite.d.mts +2 -2
  19. package/dist/{snapshot-mIb-Zzb5.mjs → snapshot-C1x2R-iK.mjs} +25 -9
  20. package/dist/snapshot.d.mts +3 -3
  21. package/dist/sqlite.d.mts +2 -2
  22. package/dist/{types-CiMvKi5V.d.mts → types-CdcYI0lU.d.mts} +1 -1
  23. package/dist/{types-Dqr4o2I1.d.mts → types-DcIiNePM.d.mts} +7 -0
  24. package/docs/dialects-and-execution.md +54 -25
  25. package/docs/getting-started.md +9 -9
  26. package/docs/guides/better-auth.md +16 -5
  27. package/docs/guides/compose-queries.md +21 -9
  28. package/docs/guides/drizzle.md +8 -3
  29. package/docs/guides/extensions/dialects.md +1 -1
  30. package/docs/guides/extensions/overview.md +1 -1
  31. package/docs/guides/extensions/sources-and-clauses.md +7 -3
  32. package/docs/guides/extensions/typed-expressions.md +25 -13
  33. package/docs/guides/extensions/unsafe-syntax.md +10 -6
  34. package/docs/guides/json.md +52 -27
  35. package/docs/guides/mutations.md +15 -6
  36. package/docs/guides/select/conditions.md +18 -11
  37. package/docs/guides/select/grouping-and-windows.md +5 -2
  38. package/docs/guides/select/ordering-and-pagination.md +5 -3
  39. package/docs/guides/select/overview.md +6 -3
  40. package/docs/guides/sql-templates.md +11 -5
  41. package/docs/guides/valtio-sync.md +11 -5
  42. package/docs/guides/vite-plugin.md +2 -2
  43. package/docs/index.md +24 -17
  44. package/docs/migrations/adapters.md +58 -22
  45. package/docs/migrations/adopt.md +331 -0
  46. package/docs/migrations/artifacts-and-policy.md +49 -20
  47. package/docs/migrations/index.md +18 -9
  48. package/docs/migrations/operations.md +60 -70
  49. package/docs/migrations/recovery.md +34 -17
  50. package/docs/query-model/fragments.md +13 -5
  51. package/docs/query-model/result-shapes.md +2 -2
  52. package/docs/query-model/source-scope.md +5 -3
  53. package/docs/reference/introspection-support.md +26 -19
  54. package/docs/reference/mysql-snapshot.md +19 -4
  55. package/docs/reference/postgres-snapshot.md +17 -4
  56. package/docs/reference/sqlite-snapshot.md +19 -2
  57. package/docs/reference/supported-surface.md +221 -85
  58. package/docs/schema/catalog-model.md +24 -7
  59. package/docs/schema/code-generation.md +40 -21
  60. package/docs/schema/columns-and-writes.md +21 -11
  61. package/docs/schema/constraints-and-indexes.md +12 -5
  62. package/docs/schema/ddl-emission.md +16 -5
  63. package/docs/schema/diff.md +12 -4
  64. package/docs/schema/introspection.md +47 -21
  65. package/docs/schema/migration-plans.md +18 -10
  66. package/docs/schema/snapshots.md +57 -29
  67. package/docs/schema/storage-and-schema-sql.md +10 -4
  68. package/docs/schema/tables-and-names.md +1 -1
  69. package/docs/sql-semantic-types.md +11 -8
  70. package/docs/troubleshooting.md +14 -6
  71. package/package.json +1 -1
  72. package/dist/index-CaxrMD1A.d.mts +0 -1
  73. package/docs/migrations/lotta-adoption.md +0 -50
@@ -1,6 +1,6 @@
1
1
  # SQL semantic types
2
2
 
3
- > Use SQL domains to constrain valid query composition without conflating database semantics with driver-decoded application values.
3
+ > Understand which SQL operations a column supports, even when its JavaScript type looks the same as another column’s.
4
4
 
5
5
  Qubu tracks four independent facts for a field or result expression:
6
6
 
@@ -11,7 +11,7 @@ Qubu tracks four independent facts for a field or result expression:
11
11
  | Nullability | Can the selected value be `null`? | `false` |
12
12
  | SQL domain | Which portable SQL operations may consume the expression? | `SqlText` or `SqlUuid` |
13
13
 
14
- The axes are deliberately separate. Both `text()` and `uuid()` decode to a
14
+ These facts are separate. Both `text()` and `uuid()` decode to a
15
15
  JavaScript `string`, but their SQL behavior differs. Likewise, two
16
16
  `timestamp()` definitions may share `SqlTimestamp` while a custom column uses
17
17
  different JavaScript output and write types for its driver.
@@ -111,12 +111,15 @@ target is vendor-specific.
111
111
 
112
112
  ## Known incompatibility is rejected
113
113
 
114
- Qubu checks capabilities and compatibility when it knows both SQL domains.
115
- Arithmetic and `SUM`/`AVG` require numeric-like expressions; text functions,
116
- concatenation, `LIKE`, and PostgreSQL `ILIKE` require text-like expressions;
117
- ordering and range comparisons require compatible ordering groups; and
118
- equality, `IN`, `CASE`, `COALESCE`, and set-operation fields require compatible
119
- equality groups. Boolean clauses require a boolean SQL domain.
114
+ When Qubu knows both SQL domains, it checks these rules:
115
+
116
+ - Arithmetic and `SUM`/`AVG` require numeric-like expressions.
117
+ - Text functions, concatenation, and pattern matching (`LIKE` or `ILIKE`)
118
+ require text-like expressions.
119
+ - Ordering and range comparisons require compatible ordering groups.
120
+ - Equality comparisons and `IN` require compatible equality groups. The same
121
+ rule applies to `CASE`, `COALESCE`, and set-operation fields.
122
+ - Boolean clauses require a boolean SQL domain.
120
123
 
121
124
  These checks model portable capability and group relationships, not every
122
125
  database's implicit casts. An expression accepted by one database after an
@@ -1,6 +1,6 @@
1
1
  # Troubleshooting
2
2
 
3
- > Start from the observed error or output, verify the boundary that produced it, and apply the smallest fix that changes the result.
3
+ > Find a common error, check its cause, and fix the query.
4
4
 
5
5
  ## Column is not available in this query scope
6
6
 
@@ -73,9 +73,13 @@ driver that expects `?` placeholders.
73
73
  ## Read and repair query diagnostics
74
74
 
75
75
  Type-level query failures carry stable properties in the diagnostic type, and
76
- runtime authoring failures throw `QueryValidationError`. Read the code, context,
77
- path, and hint before changing the query. The hint names the repair boundary;
78
- the path points to the clause or field that needs attention.
76
+ runtime authoring failures throw `QueryValidationError`. Check these fields
77
+ before changing the query:
78
+
79
+ - `code`: the kind of error.
80
+ - `context`: where the error occurred.
81
+ - `path`: the clause or field that needs attention.
82
+ - `hint`: how to fix it.
79
83
 
80
84
  ```ts
81
85
  import { QueryValidationError, fetchFirst } from "qubu"
@@ -130,8 +134,12 @@ Verify all three opt-ins:
130
134
  3. TypeScript includes `qubu/globals` in its `types` list or includes the
131
135
  declaration explicitly.
132
136
 
133
- The transform skips non-script files, dependencies under `node_modules`, files
134
- excluded by filters, and modules that reference no eligible Qubu global.
137
+ The transform skips:
138
+
139
+ - Non-script files.
140
+ - Dependencies under `node_modules`.
141
+ - Files excluded by filters.
142
+ - Modules that reference no eligible Qubu global.
135
143
 
136
144
  ## Parameters are in an unexpected order
137
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qubu",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/aleclarson/qubu"
@@ -1 +0,0 @@
1
- export {}
@@ -1,50 +0,0 @@
1
- # Lotta Games adoption
2
-
3
- > Replace Lotta's provisional runner with Qubu while preserving product-owned deployment policy and historical truth.
4
-
5
- Adopt the released `@qubu/migrate`, `@qubu/cli`, and libSQL migration entrypoint
6
- as a hard cutover. Do not add an upstream decoder for Lotta's provisional JSON,
7
- FNV artifact digests, journal, or broad unsafe flags.
8
-
9
- Before changing downstream state, inspect every environment for a provisional
10
- journal or baseline row. Regenerate unreleased migrations in the Qubu artifact
11
- format. For an existing database, create one standard baseline only after strict
12
- live introspection matches the intended Qubu snapshot. That baseline records a
13
- verified starting state; it does not claim that old migrations ran through
14
- Qubu.
15
-
16
- Keep these concerns in Lotta:
17
-
18
- - Turso credentials and environment selection;
19
- - Cloudflare deployment waiting and migrate-first/migrate-last prompts;
20
- - the destructive-deny approval policy and product-specific custom programs;
21
- - rollout timing and the one-time legacy journal cutover decision.
22
-
23
- Replace the private migration and runner modules with thin configuration and
24
- CLI/library invocation. Make the release script apply the complete pending
25
- repository chain and preserve non-zero failures. Generate fresh local test
26
- databases with `schema bootstrap`; keep connection PRAGMAs in the test harness.
27
-
28
- > [!WARNING]
29
- > Keep Drizzle migration SQL and snapshots read-only. Do not import or replay
30
- > Drizzle history. A verified baseline is the handoff from historical state to
31
- > Qubu lineage.
32
-
33
- The downstream verification set should cover a fresh bootstrap, an already
34
- baselined database, a no-op deploy, pending migrations in both deployment
35
- timing modes, drift refusal, concurrent invocation, rollback, and explicit
36
- recovery.
37
-
38
- ## Combo-matrix release blocker
39
-
40
- The main repository currently pins the `combos` submodule gitlink to
41
- `2e2856e5692ef5cbef03a055fa71e5baab8ec10a`. Commit `d9d2e02` added and verified
42
- migration profiles in the main repository without advancing that gitlink, so
43
- the orphan-branch adapter × environment matrix is not yet synchronized with the
44
- new profile claims. This is an unresolved pinned-SHA issue, not evidence that
45
- the matrix has verified the new migration entrypoints.
46
-
47
- Do not edit the gitlink or matrix as part of Lotta adoption. Before release,
48
- update the `combos` branch in its own review, run the declared environments and
49
- real database round trips, classify every candidate pair, then advance the main
50
- repository gitlink to that reviewed commit in a separate change.