metal-orm 1.1.2 → 1.1.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.
Files changed (42) hide show
  1. package/README.md +728 -707
  2. package/dist/index.cjs +813 -75
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +277 -8
  5. package/dist/index.d.ts +277 -8
  6. package/dist/index.js +812 -75
  7. package/dist/index.js.map +1 -1
  8. package/package.json +8 -2
  9. package/scripts/naming-strategy.mjs +16 -1
  10. package/src/cache/adapters/keyv-cache-adapter.ts +5 -0
  11. package/src/cache/adapters/memory-cache-adapter.ts +5 -0
  12. package/src/cache/adapters/redis-cache-adapter.ts +233 -0
  13. package/src/cache/cache-interfaces.ts +11 -0
  14. package/src/cache/index.ts +2 -0
  15. package/src/core/ast/procedure.ts +21 -0
  16. package/src/core/ast/query.ts +47 -19
  17. package/src/core/ddl/introspect/utils.ts +56 -56
  18. package/src/core/dialect/abstract.ts +560 -547
  19. package/src/core/dialect/base/sql-dialect.ts +43 -29
  20. package/src/core/dialect/mssql/index.ts +369 -232
  21. package/src/core/dialect/mysql/index.ts +99 -7
  22. package/src/core/dialect/postgres/index.ts +121 -60
  23. package/src/core/dialect/sqlite/index.ts +97 -64
  24. package/src/core/execution/db-executor.ts +108 -90
  25. package/src/core/execution/executors/mssql-executor.ts +28 -24
  26. package/src/core/execution/executors/mysql-executor.ts +62 -27
  27. package/src/core/execution/executors/sqlite-executor.ts +10 -9
  28. package/src/index.ts +9 -6
  29. package/src/orm/execute-procedure.ts +77 -0
  30. package/src/orm/execute.ts +74 -73
  31. package/src/orm/interceptor-pipeline.ts +21 -17
  32. package/src/orm/pooled-executor-factory.ts +41 -20
  33. package/src/orm/unit-of-work.ts +6 -4
  34. package/src/query/index.ts +8 -5
  35. package/src/query-builder/delete.ts +3 -2
  36. package/src/query-builder/insert-query-state.ts +47 -19
  37. package/src/query-builder/insert.ts +142 -28
  38. package/src/query-builder/procedure-call.ts +122 -0
  39. package/src/query-builder/select/select-operations.ts +5 -2
  40. package/src/query-builder/select.ts +1146 -1105
  41. package/src/query-builder/update.ts +3 -2
  42. package/src/tree/tree-manager.ts +754 -754
@@ -9,7 +9,7 @@ import { UpdateQueryState } from './update-query-state.js';
9
9
  import { createJoinNode } from '../core/ast/join-node.js';
10
10
  import { buildColumnNode } from '../core/ast/builders.js';
11
11
  import { OrmSession } from '../orm/orm-session.js';
12
- import { QueryResult } from '../core/execution/db-executor.js';
12
+ import { payloadResultSets, QueryResult } from '../core/execution/db-executor.js';
13
13
 
14
14
  type UpdateDialectInput = Dialect | DialectKey;
15
15
 
@@ -140,7 +140,8 @@ export class UpdateQueryBuilder<T> {
140
140
  async execute(session: OrmSession): Promise<QueryResult[]> {
141
141
  const execCtx = session.getExecutionContext();
142
142
  const compiled = this.compile(execCtx.dialect);
143
- return execCtx.interceptors.run({ sql: compiled.sql, params: compiled.params }, execCtx.executor);
143
+ const payload = await execCtx.interceptors.run({ sql: compiled.sql, params: compiled.params }, execCtx.executor);
144
+ return payloadResultSets(payload);
144
145
  }
145
146
 
146
147
  /**