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.
- package/dist/codegen.d.mts +1 -1
- package/dist/codegen.mjs +1 -1
- package/dist/core.d.mts +1 -1
- package/dist/diff.d.mts +1 -1
- package/dist/index-DB07P2X8.d.mts +2 -0
- package/dist/index.d.mts +1 -1
- package/dist/introspection/mysql.d.mts +1 -1
- package/dist/introspection/postgres.d.mts +1 -1
- package/dist/introspection/sqlite.d.mts +1 -1
- package/dist/introspection.d.mts +3 -2
- package/dist/introspection.mjs +1 -1
- package/dist/mysql.d.mts +2 -2
- package/dist/postgres.d.mts +2 -2
- package/dist/schema.d.mts +1 -1
- package/dist/{serialize-Du2UPZMt.d.mts → serialize-Dg-Q55YQ.d.mts} +1 -1
- package/dist/snapshot/mysql.d.mts +2 -2
- package/dist/snapshot/postgres.d.mts +2 -2
- package/dist/snapshot/sqlite.d.mts +2 -2
- package/dist/{snapshot-mIb-Zzb5.mjs → snapshot-C1x2R-iK.mjs} +25 -9
- package/dist/snapshot.d.mts +3 -3
- package/dist/sqlite.d.mts +2 -2
- package/dist/{types-CiMvKi5V.d.mts → types-CdcYI0lU.d.mts} +1 -1
- package/dist/{types-Dqr4o2I1.d.mts → types-DcIiNePM.d.mts} +7 -0
- package/docs/dialects-and-execution.md +54 -25
- package/docs/getting-started.md +9 -9
- package/docs/guides/better-auth.md +16 -5
- package/docs/guides/compose-queries.md +21 -9
- package/docs/guides/drizzle.md +8 -3
- package/docs/guides/extensions/dialects.md +1 -1
- package/docs/guides/extensions/overview.md +1 -1
- package/docs/guides/extensions/sources-and-clauses.md +7 -3
- package/docs/guides/extensions/typed-expressions.md +25 -13
- package/docs/guides/extensions/unsafe-syntax.md +10 -6
- package/docs/guides/json.md +52 -27
- package/docs/guides/mutations.md +15 -6
- package/docs/guides/select/conditions.md +18 -11
- package/docs/guides/select/grouping-and-windows.md +5 -2
- package/docs/guides/select/ordering-and-pagination.md +5 -3
- package/docs/guides/select/overview.md +6 -3
- package/docs/guides/sql-templates.md +11 -5
- package/docs/guides/valtio-sync.md +11 -5
- package/docs/guides/vite-plugin.md +2 -2
- package/docs/index.md +24 -17
- package/docs/migrations/adapters.md +58 -22
- package/docs/migrations/adopt.md +331 -0
- package/docs/migrations/artifacts-and-policy.md +49 -20
- package/docs/migrations/index.md +18 -9
- package/docs/migrations/operations.md +60 -70
- package/docs/migrations/recovery.md +34 -17
- package/docs/query-model/fragments.md +13 -5
- package/docs/query-model/result-shapes.md +2 -2
- package/docs/query-model/source-scope.md +5 -3
- package/docs/reference/introspection-support.md +26 -19
- package/docs/reference/mysql-snapshot.md +19 -4
- package/docs/reference/postgres-snapshot.md +17 -4
- package/docs/reference/sqlite-snapshot.md +19 -2
- package/docs/reference/supported-surface.md +221 -85
- package/docs/schema/catalog-model.md +24 -7
- package/docs/schema/code-generation.md +40 -21
- package/docs/schema/columns-and-writes.md +21 -11
- package/docs/schema/constraints-and-indexes.md +12 -5
- package/docs/schema/ddl-emission.md +16 -5
- package/docs/schema/diff.md +12 -4
- package/docs/schema/introspection.md +47 -21
- package/docs/schema/migration-plans.md +18 -10
- package/docs/schema/snapshots.md +57 -29
- package/docs/schema/storage-and-schema-sql.md +10 -4
- package/docs/schema/tables-and-names.md +1 -1
- package/docs/sql-semantic-types.md +11 -8
- package/docs/troubleshooting.md +14 -6
- package/package.json +1 -1
- package/dist/index-CaxrMD1A.d.mts +0 -1
- package/docs/migrations/lotta-adoption.md +0 -50
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SQL semantic types
|
|
2
2
|
|
|
3
|
-
>
|
|
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
|
-
|
|
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
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
package/docs/troubleshooting.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Troubleshooting
|
|
2
2
|
|
|
3
|
-
>
|
|
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`.
|
|
77
|
-
|
|
78
|
-
|
|
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
|
|
134
|
-
|
|
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 +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.
|