@uql/core 3.9.1 → 3.9.2

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 (77) hide show
  1. package/CHANGELOG.md +9 -2
  2. package/dist/browser/querier/querier.util.d.ts +1 -1
  3. package/dist/browser/querier/querier.util.d.ts.map +1 -1
  4. package/dist/browser/querier/querier.util.js.map +1 -1
  5. package/dist/browser/uql-browser.min.js +11 -5
  6. package/dist/browser/uql-browser.min.js.map +1 -1
  7. package/dist/dialect/abstractSqlDialect.d.ts.map +1 -1
  8. package/dist/dialect/abstractSqlDialect.js +13 -4
  9. package/dist/dialect/abstractSqlDialect.js.map +1 -1
  10. package/dist/entity/decorator/definition.d.ts.map +1 -1
  11. package/dist/entity/decorator/definition.js +8 -6
  12. package/dist/entity/decorator/definition.js.map +1 -1
  13. package/dist/entity/decorator/entity.d.ts.map +1 -1
  14. package/dist/entity/decorator/field.d.ts.map +1 -1
  15. package/dist/entity/decorator/id.d.ts.map +1 -1
  16. package/dist/entity/decorator/index-decorator.d.ts.map +1 -1
  17. package/dist/entity/decorator/index-decorator.js +2 -1
  18. package/dist/entity/decorator/index-decorator.js.map +1 -1
  19. package/dist/entity/decorator/relation.d.ts.map +1 -1
  20. package/dist/express/querierMiddleware.d.ts +2 -2
  21. package/dist/express/querierMiddleware.d.ts.map +1 -1
  22. package/dist/express/querierMiddleware.js +8 -5
  23. package/dist/express/querierMiddleware.js.map +1 -1
  24. package/dist/migrate/generator/mongoSchemaGenerator.d.ts.map +1 -1
  25. package/dist/migrate/generator/mongoSchemaGenerator.js +3 -2
  26. package/dist/migrate/generator/mongoSchemaGenerator.js.map +1 -1
  27. package/dist/migrate/introspection/mysqlIntrospector.d.ts +33 -5
  28. package/dist/migrate/introspection/mysqlIntrospector.d.ts.map +1 -1
  29. package/dist/migrate/introspection/mysqlIntrospector.js +9 -8
  30. package/dist/migrate/introspection/mysqlIntrospector.js.map +1 -1
  31. package/dist/migrate/introspection/postgresIntrospector.d.ts +36 -6
  32. package/dist/migrate/introspection/postgresIntrospector.d.ts.map +1 -1
  33. package/dist/migrate/introspection/postgresIntrospector.js +5 -7
  34. package/dist/migrate/introspection/postgresIntrospector.js.map +1 -1
  35. package/dist/migrate/introspection/sqliteIntrospector.d.ts +36 -6
  36. package/dist/migrate/introspection/sqliteIntrospector.d.ts.map +1 -1
  37. package/dist/migrate/introspection/sqliteIntrospector.js +3 -3
  38. package/dist/migrate/introspection/sqliteIntrospector.js.map +1 -1
  39. package/dist/mongo/mongoDialect.d.ts +8 -5
  40. package/dist/mongo/mongoDialect.d.ts.map +1 -1
  41. package/dist/mongo/mongoDialect.js +94 -46
  42. package/dist/mongo/mongoDialect.js.map +1 -1
  43. package/dist/mongo/mongodbQuerier.d.ts.map +1 -1
  44. package/dist/mongo/mongodbQuerier.js.map +1 -1
  45. package/dist/querier/abstractQuerier.d.ts +28 -28
  46. package/dist/querier/abstractQuerier.d.ts.map +1 -1
  47. package/dist/querier/abstractQuerier.js +5 -4
  48. package/dist/querier/abstractQuerier.js.map +1 -1
  49. package/dist/querier/abstractSqlQuerier.d.ts +6 -6
  50. package/dist/querier/abstractSqlQuerier.d.ts.map +1 -1
  51. package/dist/querier/abstractSqlQuerier.js +2 -1
  52. package/dist/querier/abstractSqlQuerier.js.map +1 -1
  53. package/dist/querier/decorator/injectQuerier.d.ts.map +1 -1
  54. package/dist/querier/decorator/log.d.ts.map +1 -1
  55. package/dist/querier/decorator/serialized.d.ts.map +1 -1
  56. package/dist/querier/decorator/transactional.d.ts.map +1 -1
  57. package/dist/sqlite/sqliteQuerierPool.d.ts +0 -4
  58. package/dist/sqlite/sqliteQuerierPool.d.ts.map +1 -1
  59. package/dist/type/entity.d.ts +6 -0
  60. package/dist/type/entity.d.ts.map +1 -1
  61. package/dist/type/querier.d.ts +22 -22
  62. package/dist/type/querier.d.ts.map +1 -1
  63. package/dist/type/querier.js.map +1 -1
  64. package/dist/type/universalQuerier.d.ts +14 -14
  65. package/dist/type/universalQuerier.d.ts.map +1 -1
  66. package/dist/type/utility.d.ts +0 -4
  67. package/dist/type/utility.d.ts.map +1 -1
  68. package/dist/util/dialect.util.js +3 -3
  69. package/dist/util/dialect.util.js.map +1 -1
  70. package/dist/util/object.util.d.ts +2 -2
  71. package/dist/util/object.util.d.ts.map +1 -1
  72. package/dist/util/object.util.js +1 -1
  73. package/dist/util/object.util.js.map +1 -1
  74. package/dist/util/sql.util.d.ts +3 -3
  75. package/dist/util/sql.util.d.ts.map +1 -1
  76. package/dist/util/sql.util.js.map +1 -1
  77. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
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.9.1](https://github.com/rogerpadilla/uql/compare/@uql/core@3.9.0...@uql/core@3.9.1) (2026-02-13)
6
+ ## [3.9.2](https://github.com/rogerpadilla/uql/compare/@uql/core@3.9.1...@uql/core@3.9.2) (2026-02-13)
7
7
 
8
8
  **Note:** Version bump only for package @uql/core
9
9
 
@@ -17,6 +17,14 @@ All notable changes to this project will be documented in this file. Please add
17
17
 
18
18
  date format is [yyyy-mm-dd]
19
19
 
20
+ ## [3.9.1] - 2026-02-13
21
+ ### Improvements & Refactoring
22
+ - **TypeScript Upgrade**: Upgraded to TypeScript ^5.9.3 and hardened `tsconfig.json` with strict flags (`noPropertyAccessFromIndexSignature`, `verbatimModuleSyntax`, etc.).
23
+ - **Type Safety Polish**: Propagated `E extends object` constraint across the `Querier` hierarchy and refined driver signatures to eliminate type casts (`as any`).
24
+
25
+ ### Bug Fixes
26
+ - **MySQL Introspection Fix**: Fixed a bug where string default values were returned with surrounding quotes (e.g., `'active'`) during schema discovery in MySQL and MariaDB.
27
+
20
28
  ## [3.9.0] - 2026-02-13
21
29
  ### New Features
22
30
  - **New Query Operators**: Added `$between`, `$isNull`, `$isNotNull`, `$all`, `$size`, and `$elemMatch` operators with full support across PostgreSQL, MySQL, SQLite, and MongoDB.
@@ -26,7 +34,6 @@ date format is [yyyy-mm-dd]
26
34
  - **Structured Slow-Query Config**: Replaced flat `slowQueryThreshold: number` with a `slowQuery: { threshold, logParams? }` object. Use `logParams: false` to suppress sensitive query parameters from slow-query logs.
27
35
  - **DRY Dialect Refactor**: Extracted shared `$elemMatch` field-condition logic into `buildJsonFieldCondition` in `AbstractSqlDialect` with a `JsonFieldConfig` type. Each SQL dialect now passes a small config object (~10 lines) instead of duplicating a ~60-line switch across MySQL, PostgreSQL, and SQLite.
28
36
  - **Safer Abstract Base**: `$all`, `$size`, and `$elemMatch` now throw in the abstract SQL dialect base class, forcing each dialect subclass to provide its own implementation. This prevents silent inheritance of dialect-specific syntax.
29
- - **Type Safety**: Removed `$entity` from base `QuerySearch` type; it now exists only in dedicated intersection types (`QueryWithEntity`, `QueryOneWithEntity`, `QuerySearchWithEntity`), preventing it from leaking into unrelated query contexts.
30
37
 
31
38
  ### Bug Fixes
32
39
  - **SQLite `$in`/`$nin` Fix**: Fixed a critical bug where `buildJsonFieldOperator` used `vals.shift()` inside `.map()`, mutating the input array and only processing half the values.
@@ -1,3 +1,3 @@
1
1
  export declare function stringifyQueryParameter(key: string, value?: unknown, useQuestionMark?: boolean): string;
2
- export declare function stringifyQuery(query: object): string;
2
+ export declare function stringifyQuery(query: Record<string, unknown>): string;
3
3
  //# sourceMappingURL=querier.util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"querier.util.d.ts","sourceRoot":"","sources":["../../../src/browser/querier/querier.util.ts"],"names":[],"mappings":"AAEA,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAGvG;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUpD"}
1
+ {"version":3,"file":"querier.util.d.ts","sourceRoot":"","sources":["../../../src/browser/querier/querier.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E,CAAC;AACnD,CAAC"}
@@ -910,7 +910,11 @@ function getMappedByRelationKey(relOpts) {
910
910
  return relOpts.mappedBy;
911
911
  }
912
912
  function getRelationKeyMap(meta) {
913
- return getKeys(meta.fields).concat(getKeys(meta.relations)).reduce((acc, key)=>{
913
+ const keys = [
914
+ ...getKeys(meta.fields),
915
+ ...getKeys(meta.relations)
916
+ ];
917
+ return keys.reduce((acc, key)=>{
914
918
  acc[key] = key;
915
919
  return acc;
916
920
  }, {});
@@ -4776,12 +4780,14 @@ function createTestCases(spec) {
4776
4780
  for (const key of Object.getOwnPropertyNames(proto)){
4777
4781
  const isProcessed = processedMethodsMap[key];
4778
4782
  processedMethodsMap[key] = true;
4779
- if (isProcessed || key === 'constructor' || typeof spec[key] !== 'function') {
4783
+ const method = spec[key];
4784
+ if (isProcessed || key === 'constructor' || typeof method !== 'function') {
4780
4785
  continue;
4781
4786
  }
4782
- const callback = spec[key].bind(spec);
4783
- if (hooks[key]) {
4784
- hooks[key](callback);
4787
+ const callback = method.bind(spec);
4788
+ const hookFn = hooks[key];
4789
+ if (hookFn) {
4790
+ hookFn(callback);
4785
4791
  } else if (key.startsWith('should')) {
4786
4792
  it(key, callback);
4787
4793
  } else if (key.startsWith('fffShould')) {