uql-orm 0.41.0 → 0.42.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 (50) hide show
  1. package/dist/browser/querier/httpQuerier.d.ts +4 -4
  2. package/dist/browser/querier/httpQuerier.js +21 -6
  3. package/dist/browser/uql-browser.min.js +2 -2
  4. package/dist/browser/uql-browser.min.js.map +4 -4
  5. package/dist/dialect/abstractSqlDialect.d.ts +1 -1
  6. package/dist/dialect/abstractSqlDialect.js +26 -21
  7. package/dist/dialect/mysqlLikeSqlDialect.d.ts +1 -1
  8. package/dist/dialect/mysqlLikeSqlDialect.js +2 -2
  9. package/dist/entity/decorator/members.d.ts +29 -3
  10. package/dist/entity/index.d.ts +1 -1
  11. package/dist/entity/index.js +1 -1
  12. package/dist/entity/metadata/definition.d.ts +18 -1
  13. package/dist/entity/metadata/definition.js +97 -38
  14. package/dist/http/handler.js +4 -4
  15. package/dist/maria/mariaDialect.d.ts +2 -2
  16. package/dist/maria/mariaDialect.js +2 -2
  17. package/dist/migrate/builder/migrationBuilder.js +2 -2
  18. package/dist/migrate/builder/tableBuilder.js +2 -2
  19. package/dist/migrate/schemaGenerator.d.ts +2 -2
  20. package/dist/migrate/schemaGenerator.js +12 -4
  21. package/dist/mongo/mongoDialect.js +17 -6
  22. package/dist/mongo/mongodbQuerier.js +6 -3
  23. package/dist/querier/abstractQuerier.d.ts +16 -12
  24. package/dist/querier/abstractQuerier.js +77 -40
  25. package/dist/querier/abstractQuerierPool.d.ts +8 -8
  26. package/dist/querier/abstractSqlQuerier.d.ts +1 -1
  27. package/dist/querier/abstractSqlQuerier.js +12 -7
  28. package/dist/querier/relationCount.js +40 -31
  29. package/dist/schema/schemaAST.js +1 -0
  30. package/dist/schema/schemaASTBuilder.js +37 -22
  31. package/dist/schema/types.d.ts +24 -0
  32. package/dist/type/entity.d.ts +85 -15
  33. package/dist/type/queryWhere.d.ts +7 -2
  34. package/dist/type/universalQuerier.d.ts +8 -8
  35. package/dist/util/ddlExpression.util.d.ts +15 -0
  36. package/dist/util/ddlExpression.util.js +27 -0
  37. package/dist/util/dialect.util.js +15 -14
  38. package/dist/util/index.d.ts +2 -1
  39. package/dist/util/index.js +2 -1
  40. package/dist/util/object.util.d.ts +6 -0
  41. package/dist/util/object.util.js +10 -0
  42. package/dist/util/relationQuery.util.d.ts +38 -7
  43. package/dist/util/relationQuery.util.js +50 -9
  44. package/dist/util/rowKey.util.d.ts +9 -0
  45. package/dist/util/rowKey.util.js +24 -0
  46. package/dist/util/sql.util.d.ts +2 -0
  47. package/dist/util/sql.util.js +4 -0
  48. package/package.json +2 -2
  49. package/dist/util/indexColumn.util.d.ts +0 -8
  50. package/dist/util/indexColumn.util.js +0 -30
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "homepage": "https://uql-orm.dev",
4
4
  "description": "JSON-native ORM for Node.js, Bun and Deno. Supports PostgreSQL, PGlite, MySQL, MariaDB, SQLite, CockroachDB, Turso, Neon, Cloudflare D1 and MongoDB. Queries are plain JSON, typed to the leaf.",
5
5
  "license": "MIT",
6
- "version": "0.41.0",
6
+ "version": "0.42.0",
7
7
  "type": "module",
8
8
  "engines": {
9
9
  "node": ">=24"
@@ -56,7 +56,7 @@
56
56
  "README.md"
57
57
  ],
58
58
  "scripts": {
59
- "prepack": "bun run verify-dist.ts && cp ../../README.md .",
59
+ "prepack": "bun run build && bun run verify-dist.ts && cp ../../README.md .",
60
60
  "postpack": "rm README.md && npm pkg delete gitHead",
61
61
  "compile.browser": "bun build src/browser/index.ts --minify --sourcemap=linked --format=esm --target=browser --outdir=dist/browser --entry-naming 'uql-browser.min.[ext]'",
62
62
  "build": "bun run clean && tsc -b tsconfig.build.json && bun run compile.browser && bun run verify-dist.ts",
@@ -1,8 +0,0 @@
1
- import { type IndexColumnInput, type IndexColumnSchema, QueryRaw } from '../type/index.js';
2
- /**
3
- * Reduces an authored index entry to its normalized form, so the three shapes users write - a column
4
- * name, `raw(expression)`, or an options object - reach the dialects as one.
5
- */
6
- export declare function normalizeIndexColumn(entry: IndexColumnInput): IndexColumnSchema;
7
- /** The partial-index predicate, as authored: `raw` for new code, a bare string for old. */
8
- export declare function normalizeIndexWhere(where: string | QueryRaw | undefined): string | undefined;
@@ -1,30 +0,0 @@
1
- import { QueryRaw, RAW_VALUE } from '../type/index.js';
2
- /**
3
- * Reduces an authored index entry to its normalized form, so the three shapes users write - a column
4
- * name, `raw(expression)`, or an options object - reach the dialects as one.
5
- */
6
- export function normalizeIndexColumn(entry) {
7
- if (typeof entry === 'string') {
8
- return { column: entry };
9
- }
10
- if (entry instanceof QueryRaw) {
11
- return { column: rawSql(entry), expression: true };
12
- }
13
- const { column, ...rest } = entry;
14
- return column instanceof QueryRaw ? { ...rest, column: rawSql(column), expression: true } : { ...rest, column };
15
- }
16
- /** The partial-index predicate, as authored: `raw` for new code, a bare string for old. */
17
- export function normalizeIndexWhere(where) {
18
- return where instanceof QueryRaw ? rawSql(where, 'a partial-index predicate') : where;
19
- }
20
- /**
21
- * Index DDL is evaluated once at creation time, so it cannot take the dialect-aware callback form of
22
- * `raw()` - there is no query context to hand it, and no placeholder a `CREATE INDEX` could bind.
23
- */
24
- function rawSql(value, what = 'an index expression') {
25
- const sql = value[RAW_VALUE];
26
- if (typeof sql !== 'string') {
27
- throw new TypeError(`${what} needs raw() with no interpolation, not a function or a bound value`);
28
- }
29
- return sql;
30
- }