qubu 0.3.3 → 0.3.4
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/ddl.d.mts +1 -1
- package/dist/drizzle-mysql.d.mts +2 -2
- package/dist/drizzle-postgres.d.mts +2 -2
- package/dist/drizzle-sqlite.d.mts +2 -2
- package/dist/drizzle.d.mts +1 -1
- package/dist/postgres.d.mts +1 -1
- package/dist/{types-CO1KaRNc.d.mts → types-H4vyCw8_.d.mts} +1 -2
- package/docs/guides/drizzle.md +7 -6
- package/package.json +3 -3
package/dist/ddl.d.mts
CHANGED
|
@@ -110,7 +110,7 @@ declare function ddlEmitterForDialect(dialect: SchemaDialect): DdlEmitter;
|
|
|
110
110
|
declare function emitMigrationPlan(plan: MigrationPlan, dialect: SchemaDialect, options?: DdlEmissionOptions): DdlEmission;
|
|
111
111
|
/** Convenient defaults for callers that already selected a plan dialect. */
|
|
112
112
|
declare const ddlDialects: Readonly<{
|
|
113
|
-
postgresql: SchemaDialect<"
|
|
113
|
+
postgresql: SchemaDialect<"json" | "ilike" | "on-conflict" | "row-locking">;
|
|
114
114
|
sqlite: SchemaDialect<"json" | "on-conflict">;
|
|
115
115
|
mysql: SchemaDialect<"json" | "row-locking">;
|
|
116
116
|
}>;
|
package/dist/drizzle-mysql.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Pt as AnyTable, Xr as Schema, ni as SchemaTableRecord } from "./types-4Q076HKo.mjs";
|
|
2
|
-
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-
|
|
2
|
+
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-H4vyCw8_.mjs";
|
|
3
3
|
import { MySqlColumn, MySqlTableWithColumns } from "drizzle-orm/mysql-core";
|
|
4
4
|
//#region src/drizzle/mysql.d.ts
|
|
5
|
-
type MysqlDrizzleColumn<TTableName extends string, TDefinition> = MySqlColumn<DrizzleColumnConfig<TTableName, TDefinition
|
|
5
|
+
type MysqlDrizzleColumn<TTableName extends string, TDefinition> = MySqlColumn<DrizzleColumnConfig<TTableName, TDefinition>>;
|
|
6
6
|
type MysqlDrizzleColumns<TTable extends AnyTable> = { [TKey in keyof TTable['definitions']]: MysqlDrizzleColumn<TTable['tableName'], TTable['definitions'][TKey]>; };
|
|
7
7
|
/** The Drizzle MySQL table produced for one Qubu table. */
|
|
8
8
|
type MysqlDrizzleTable<TTable extends AnyTable> = MySqlTableWithColumns<{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Pt as AnyTable, Xr as Schema, ni as SchemaTableRecord } from "./types-4Q076HKo.mjs";
|
|
2
|
-
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-
|
|
2
|
+
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-H4vyCw8_.mjs";
|
|
3
3
|
import { PgColumn, PgTableWithColumns } from "drizzle-orm/pg-core";
|
|
4
4
|
//#region src/drizzle/postgres.d.ts
|
|
5
|
-
type PostgresDrizzleColumn<TTableName extends string, TDefinition> = PgColumn<DrizzleColumnConfig<TTableName, TDefinition
|
|
5
|
+
type PostgresDrizzleColumn<TTableName extends string, TDefinition> = PgColumn<'custom', DrizzleColumnConfig<TTableName, TDefinition>>;
|
|
6
6
|
type PostgresDrizzleColumns<TTable extends AnyTable> = { [TKey in keyof TTable['definitions']]: PostgresDrizzleColumn<TTable['tableName'], TTable['definitions'][TKey]>; };
|
|
7
7
|
/** The Drizzle PostgreSQL table produced for one Qubu table. */
|
|
8
8
|
type PostgresDrizzleTable<TTable extends AnyTable> = PgTableWithColumns<{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Pt as AnyTable, Xr as Schema, ni as SchemaTableRecord } from "./types-4Q076HKo.mjs";
|
|
2
|
-
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-
|
|
2
|
+
import { r as DrizzleSchemaValidation, t as DrizzleColumnConfig } from "./types-H4vyCw8_.mjs";
|
|
3
3
|
import { SQLiteColumn, SQLiteTableWithColumns } from "drizzle-orm/sqlite-core";
|
|
4
4
|
//#region src/drizzle/sqlite.d.ts
|
|
5
|
-
type SqliteDrizzleColumn<TTableName extends string, TDefinition> = SQLiteColumn<DrizzleColumnConfig<TTableName, TDefinition
|
|
5
|
+
type SqliteDrizzleColumn<TTableName extends string, TDefinition> = SQLiteColumn<DrizzleColumnConfig<TTableName, TDefinition>>;
|
|
6
6
|
type SqliteDrizzleColumns<TTable extends AnyTable> = { [TKey in keyof TTable['definitions']]: SqliteDrizzleColumn<TTable['tableName'], TTable['definitions'][TKey]>; };
|
|
7
7
|
/** The Drizzle SQLite table produced for one Qubu table. */
|
|
8
8
|
type SqliteDrizzleTable<TTable extends AnyTable> = SQLiteTableWithColumns<{
|
package/dist/drizzle.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as DrizzleDialect } from "./types-
|
|
1
|
+
import { n as DrizzleDialect } from "./types-H4vyCw8_.mjs";
|
|
2
2
|
//#region src/drizzle/errors.d.ts
|
|
3
3
|
/** Stable failure categories raised while building a Drizzle schema. */
|
|
4
4
|
type DrizzleSchemaConversionErrorCode = 'missing-storage' | 'unsupported-metadata';
|
package/dist/postgres.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { Cl as ExpressionMeta, Cn as ExcludedSource, Dn as excluded, En as doUpd
|
|
|
4
4
|
* PostgreSQL's only core rendering difference is positional parameters.
|
|
5
5
|
* PostgreSQL-specific expressions and clauses should remain separate modules.
|
|
6
6
|
*/
|
|
7
|
-
declare function postgresDialect(): Dialect<"
|
|
7
|
+
declare function postgresDialect(): Dialect<"json" | "ilike" | "on-conflict" | "row-locking">;
|
|
8
8
|
/** PostgreSQL's case-insensitive pattern-match operator. */
|
|
9
9
|
declare function ilike<TLeft extends ExpressionWithOutput<string>, R extends Operand<string>>(left: TLeft & ComparisonValidation<TLeft, R, 'ILIKE'>, pattern: R): SchemaExpression<ResultMeta<boolean, ((MetadataOf<TLeft & SqlCapabilityValidation<(MetadataOf<TLeft> extends (infer T) ? T extends MetadataOf<TLeft> ? T extends {
|
|
10
10
|
readonly kind: "result";
|
|
@@ -21,11 +21,10 @@ type DrizzleColumnGenerated<TDefinition> = ColumnIsGenerated<TDefinition> extend
|
|
|
21
21
|
readonly type: 'always';
|
|
22
22
|
} : undefined;
|
|
23
23
|
type DrizzleColumnHasDefault<TDefinition> = ColumnIsGenerated<TDefinition> extends true ? true : ColumnHasDefault<TDefinition>;
|
|
24
|
-
type DrizzleColumnConfig<TTableName extends string, TDefinition
|
|
24
|
+
type DrizzleColumnConfig<TTableName extends string, TDefinition> = {
|
|
25
25
|
readonly name: string;
|
|
26
26
|
readonly tableName: TTableName;
|
|
27
27
|
readonly dataType: 'custom';
|
|
28
|
-
readonly columnType: TColumnType;
|
|
29
28
|
readonly data: ColumnOutput<TDefinition>;
|
|
30
29
|
readonly driverParam: ColumnInsertInput<TDefinition>;
|
|
31
30
|
readonly enumValues: undefined;
|
package/docs/guides/drizzle.md
CHANGED
|
@@ -9,11 +9,11 @@ Install Drizzle next to Qubu. The Drizzle entrypoints use an optional peer
|
|
|
9
9
|
dependency, so importing the rest of Qubu does not load the ORM.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
pnpm add qubu drizzle-orm
|
|
12
|
+
pnpm add qubu drizzle-orm@rc
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
The converter supports PostgreSQL, MySQL, and SQLite with Drizzle 0.
|
|
16
|
-
|
|
15
|
+
The converter supports PostgreSQL, MySQL, and SQLite with Drizzle 1.0.0-rc.4
|
|
16
|
+
and later 1.x releases.
|
|
17
17
|
|
|
18
18
|
## Convert the schema
|
|
19
19
|
|
|
@@ -50,13 +50,14 @@ not import a dialect core or provide a universal runtime converter.
|
|
|
50
50
|
physical `user_records` name, `app` namespace, field keys, and physical column
|
|
51
51
|
names all come from the Qubu declaration.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Use the converted tables in ordinary Drizzle queries. Table objects do not need
|
|
54
|
+
to be passed to `drizzle()`:
|
|
54
55
|
|
|
55
56
|
```ts
|
|
56
57
|
import { eq } from 'drizzle-orm'
|
|
57
58
|
import { drizzle } from 'drizzle-orm/node-postgres'
|
|
58
59
|
|
|
59
|
-
const db = drizzle(pool
|
|
60
|
+
const db = drizzle(pool)
|
|
60
61
|
|
|
61
62
|
const rows = await db
|
|
62
63
|
.select({ id: drizzleTables.users.id, name: drizzleTables.users.name })
|
|
@@ -110,7 +111,7 @@ const tables = toPostgresDrizzleSchema(schema({ records }))
|
|
|
110
111
|
```
|
|
111
112
|
|
|
112
113
|
Conversion first runs Qubu's snapshot validation for the selected dialect.
|
|
113
|
-
Metadata that Drizzle 0
|
|
114
|
+
Metadata that Drizzle 1.0 cannot express, such as deferred constraints or
|
|
114
115
|
included index columns, raises `DrizzleSchemaConversionError` with a `code` and
|
|
115
116
|
`path`.
|
|
116
117
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qubu",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/aleclarson/qubu"
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@types/bun": "^1.3.0",
|
|
93
93
|
"@types/node": "^24.6.2",
|
|
94
94
|
"@types/pg": "^8.23.1",
|
|
95
|
-
"drizzle-orm": "0.
|
|
95
|
+
"drizzle-orm": "1.0.0-rc.4",
|
|
96
96
|
"lildocs": "^0.1.27",
|
|
97
97
|
"mysql2": "^3.23.4",
|
|
98
98
|
"pg": "^8.23.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@standard-schema/spec": "^1.0.0"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
|
-
"drizzle-orm": "
|
|
113
|
+
"drizzle-orm": "^1.0.0-rc.4"
|
|
114
114
|
},
|
|
115
115
|
"peerDependenciesMeta": {
|
|
116
116
|
"drizzle-orm": {
|