@uql/core 3.7.8 → 3.7.9
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/CHANGELOG.md +7 -5
- package/README.md +26 -7
- package/dist/migrate/bin.d.ts +1 -3
- package/dist/migrate/bin.d.ts.map +1 -1
- package/dist/migrate/bin.js +4 -14
- package/dist/migrate/bin.js.map +1 -1
- package/dist/type/config.d.ts +29 -2
- package/dist/type/config.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [3.7.
|
|
6
|
+
## [3.7.9](https://github.com/rogerpadilla/uql/compare/@uql/core@3.7.8...@uql/core@3.7.9) (2026-01-04)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Features
|
|
10
10
|
|
|
11
|
-
*
|
|
11
|
+
* Disable chat input and show loading state during message send and update operations. ([06b824b](https://github.com/rogerpadilla/uql/commit/06b824b79e2ab1f771ec79481e8d9cb1db159982))
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -20,9 +20,11 @@ All notable changes to this project will be documented in this file. Please add
|
|
|
20
20
|
|
|
21
21
|
date format is [yyyy-mm-dd]
|
|
22
22
|
|
|
23
|
-
## [3.7.
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
## [3.7.9] - 2026-01-04
|
|
24
|
+
- **Manual Migrations**: Updated the root README to explicitly document the `generate` command for creating manual incremental migrations (`npx uql-migrate generate <name>`), ensuring developers know how to create empty migration files efficiently.
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
- **CLI Entry Point**: Fixed a critical issue where the `uql-migrate` command would silently fail in certain environments (e.g., when run via `npx` or symlinks) due to brittle entry point detection. The CLI now reliably executes regardless of how it is invoked.
|
|
26
28
|
|
|
27
29
|
## [3.7.7] - 2026-01-04
|
|
28
30
|
### Refined Foreign Key Handling & Control
|
package/README.md
CHANGED
|
@@ -243,7 +243,7 @@ export const pool = new PgQuerierPool(
|
|
|
243
243
|
|
|
244
244
|
export default {
|
|
245
245
|
pool,
|
|
246
|
-
|
|
246
|
+
entities: [User, Profile, Post],
|
|
247
247
|
migrationsPath: './migrations',
|
|
248
248
|
} satisfies Config;
|
|
249
249
|
```
|
|
@@ -355,7 +355,7 @@ import type { Config } from '@uql/core';
|
|
|
355
355
|
|
|
356
356
|
export default {
|
|
357
357
|
pool: new PgQuerierPool({ /* ... */ }),
|
|
358
|
-
|
|
358
|
+
entities: [User, Profile, Post],
|
|
359
359
|
migrationsPath: './migrations',
|
|
360
360
|
} satisfies Config;
|
|
361
361
|
```
|
|
@@ -364,14 +364,33 @@ export default {
|
|
|
364
364
|
|
|
365
365
|
### 2. Manage via CLI
|
|
366
366
|
|
|
367
|
+
|
|
368
|
+
Use the CLI to manage your database schema evolution.
|
|
369
|
+
|
|
370
|
+
| Command | Description |
|
|
371
|
+
| :--- | :--- |
|
|
372
|
+
| `generate <name>` | Creates an empty timestamped file for **manual** SQL migrations (e.g., data backfills). |
|
|
373
|
+
| `generate:entities <name>` | **Auto-generates** a migration by diffing your entities against the current DB schema. |
|
|
374
|
+
| `up` | Applies all pending migrations. |
|
|
375
|
+
| `down` | Rolls back the last applied migration batch. |
|
|
376
|
+
| `status` | Shows which migrations have been executed and which are pending. |
|
|
377
|
+
|
|
378
|
+
#### Usage Examples
|
|
379
|
+
|
|
367
380
|
```bash
|
|
368
|
-
#
|
|
369
|
-
npx uql-migrate generate
|
|
370
|
-
|
|
381
|
+
# 1. Create a manual migration
|
|
382
|
+
npx uql-migrate generate seed_default_roles
|
|
383
|
+
|
|
384
|
+
# 2. Auto-generate schema changes from your code
|
|
385
|
+
npx uql-migrate generate:entities add_profile_table
|
|
386
|
+
|
|
387
|
+
# 3. Apply changes
|
|
371
388
|
npx uql-migrate up
|
|
372
|
-
|
|
389
|
+
|
|
390
|
+
# 4. Revert changes if needed
|
|
373
391
|
npx uql-migrate down
|
|
374
|
-
|
|
392
|
+
|
|
393
|
+
# 5. Run with custom config
|
|
375
394
|
npx uql-migrate up --config ./configs/uql.config.ts
|
|
376
395
|
```
|
|
377
396
|
|
package/dist/migrate/bin.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/migrate/bin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/migrate/bin.ts"],"names":[],"mappings":""}
|
package/dist/migrate/bin.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { pathToFileURL } from 'node:url';
|
|
3
2
|
import { main } from './cli.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const isMain = import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
9
|
-
if (isMain) {
|
|
10
|
-
main(process.argv.slice(2)).catch((err) => {
|
|
11
|
-
console.error(err);
|
|
12
|
-
process.exit(1);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
// Export for testing
|
|
16
|
-
export const _scriptLogic = { isMain };
|
|
3
|
+
main(process.argv.slice(2)).catch((err) => {
|
|
4
|
+
console.error(err);
|
|
5
|
+
process.exit(1);
|
|
6
|
+
});
|
|
17
7
|
//# sourceMappingURL=bin.js.map
|
package/dist/migrate/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/migrate/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/migrate/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACxC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/type/config.d.ts
CHANGED
|
@@ -2,12 +2,39 @@ import type { NamingStrategy } from './namingStrategy.js';
|
|
|
2
2
|
import type { Dialect } from './querier.js';
|
|
3
3
|
import type { QuerierPool } from './querierPool.js';
|
|
4
4
|
import type { Type } from './utility.js';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the UQL ORM and Migrator.
|
|
7
|
+
*/
|
|
5
8
|
export interface Config {
|
|
6
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The connection pool used to interact with the database.
|
|
11
|
+
* This is required for both the application and the migrations CLI.
|
|
12
|
+
*/
|
|
13
|
+
pool: QuerierPool;
|
|
14
|
+
/**
|
|
15
|
+
* List of entity classes to be managed by the ORM.
|
|
16
|
+
* If not provided, UQL will attempt to infer them from the `@Entity` decorators if `emitDecoratorMetadata` is enabled.
|
|
17
|
+
*/
|
|
18
|
+
entities?: Type<unknown>[];
|
|
19
|
+
/**
|
|
20
|
+
* The directory where migration files are stored.
|
|
21
|
+
* @default './migrations'
|
|
22
|
+
*/
|
|
7
23
|
migrationsPath?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The name of the table used to track executed migrations in the database.
|
|
26
|
+
* @default 'uql_migrations'
|
|
27
|
+
*/
|
|
8
28
|
tableName?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The SQL dialect to be used (e.g., 'postgres', 'mysql', 'sqlite').
|
|
31
|
+
* If not provided, it is inferred from the `pool` instance.
|
|
32
|
+
*/
|
|
9
33
|
dialect?: Dialect;
|
|
10
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The naming strategy for mapping class/property names to database table/column names.
|
|
36
|
+
* @default DefaultNamingStrategy (camelCase -> camelCase)
|
|
37
|
+
*/
|
|
11
38
|
namingStrategy?: NamingStrategy;
|
|
12
39
|
}
|
|
13
40
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/type/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,MAAM;IACrB,IAAI,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/type/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;;OAGG;IACH,IAAI,EAAE,WAAW,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;IAE3B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"homepage": "https://uql.app",
|
|
4
4
|
"description": "One Language. Frontend to Backend.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "3.7.
|
|
6
|
+
"version": "3.7.9",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"publishConfig": {
|
|
144
144
|
"access": "public"
|
|
145
145
|
},
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "7008a9dd2dcaaac969d077c4d8030b0b6d1354d3"
|
|
147
147
|
}
|