joist-core 2.3.0-next.97 → 2.3.0-next.99

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 (747) hide show
  1. package/build/BaseEntity.cjs.map +1 -1
  2. package/build/BaseEntity.js.map +1 -1
  3. package/build/Entity.cjs.map +1 -1
  4. package/build/Entity.js.map +1 -1
  5. package/build/EntityManager.cjs +45 -46
  6. package/build/EntityManager.cjs.map +1 -1
  7. package/build/EntityManager.d.cts +7 -7
  8. package/build/EntityManager.d.cts.map +1 -1
  9. package/build/EntityManager.d.mts +7 -7
  10. package/build/EntityManager.d.mts.map +1 -1
  11. package/build/EntityManager.js +27 -28
  12. package/build/EntityManager.js.map +1 -1
  13. package/build/EntityMetadata.cjs +0 -2
  14. package/build/EntityMetadata.cjs.map +1 -1
  15. package/build/EntityMetadata.d.cts +3 -3
  16. package/build/EntityMetadata.d.mts +3 -3
  17. package/build/EntityMetadata.js +0 -2
  18. package/build/EntityMetadata.js.map +1 -1
  19. package/build/IndexManager.cjs +1 -1
  20. package/build/IndexManager.cjs.map +1 -1
  21. package/build/IndexManager.js +1 -1
  22. package/build/IndexManager.js.map +1 -1
  23. package/build/InstanceData.cjs.map +1 -1
  24. package/build/InstanceData.js.map +1 -1
  25. package/build/PluginManager.cjs +0 -1
  26. package/build/PluginManager.cjs.map +1 -1
  27. package/build/PluginManager.d.cts +1 -1
  28. package/build/PluginManager.d.mts +1 -1
  29. package/build/PluginManager.js +0 -1
  30. package/build/PluginManager.js.map +1 -1
  31. package/build/batchloaders/enumCollectionBatchLoader.cjs +1 -1
  32. package/build/batchloaders/enumCollectionBatchLoader.cjs.map +1 -1
  33. package/build/batchloaders/enumCollectionBatchLoader.d.cts +1 -1
  34. package/build/batchloaders/enumCollectionBatchLoader.d.mts +1 -1
  35. package/build/batchloaders/enumCollectionBatchLoader.js +1 -1
  36. package/build/batchloaders/enumCollectionBatchLoader.js.map +1 -1
  37. package/build/batchloaders/loadBatchLoader.cjs +3 -4
  38. package/build/batchloaders/loadBatchLoader.cjs.map +1 -1
  39. package/build/batchloaders/loadBatchLoader.d.cts +1 -1
  40. package/build/batchloaders/loadBatchLoader.d.mts +1 -1
  41. package/build/batchloaders/loadBatchLoader.js +2 -3
  42. package/build/batchloaders/loadBatchLoader.js.map +1 -1
  43. package/build/batchloaders/manyToManyBatchLoader.cjs +1 -1
  44. package/build/batchloaders/manyToManyBatchLoader.cjs.map +1 -1
  45. package/build/batchloaders/manyToManyBatchLoader.d.cts +1 -1
  46. package/build/batchloaders/manyToManyBatchLoader.d.mts +1 -1
  47. package/build/batchloaders/manyToManyBatchLoader.js +1 -1
  48. package/build/batchloaders/manyToManyBatchLoader.js.map +1 -1
  49. package/build/batchloaders/oneToManyBatchLoader.cjs +1 -1
  50. package/build/batchloaders/oneToManyBatchLoader.cjs.map +1 -1
  51. package/build/batchloaders/oneToManyBatchLoader.js +1 -1
  52. package/build/batchloaders/oneToManyBatchLoader.js.map +1 -1
  53. package/build/batchloaders/oneToOneBatchLoader.cjs +1 -1
  54. package/build/batchloaders/oneToOneBatchLoader.cjs.map +1 -1
  55. package/build/batchloaders/oneToOneBatchLoader.js +1 -1
  56. package/build/batchloaders/oneToOneBatchLoader.js.map +1 -1
  57. package/build/batchloaders/populateBatchLoader.cjs +11 -12
  58. package/build/batchloaders/populateBatchLoader.cjs.map +1 -1
  59. package/build/batchloaders/populateBatchLoader.d.cts +1 -1
  60. package/build/batchloaders/populateBatchLoader.d.mts +1 -1
  61. package/build/batchloaders/populateBatchLoader.js +7 -8
  62. package/build/batchloaders/populateBatchLoader.js.map +1 -1
  63. package/build/batchloaders/recursiveChildrenBatchLoader.cjs +2 -2
  64. package/build/batchloaders/recursiveChildrenBatchLoader.cjs.map +1 -1
  65. package/build/batchloaders/recursiveChildrenBatchLoader.js +2 -2
  66. package/build/batchloaders/recursiveChildrenBatchLoader.js.map +1 -1
  67. package/build/batchloaders/recursiveM2mBatchLoader.cjs +2 -2
  68. package/build/batchloaders/recursiveM2mBatchLoader.cjs.map +1 -1
  69. package/build/batchloaders/recursiveM2mBatchLoader.js +2 -2
  70. package/build/batchloaders/recursiveM2mBatchLoader.js.map +1 -1
  71. package/build/batchloaders/recursiveParentsBatchLoader.cjs +2 -2
  72. package/build/batchloaders/recursiveParentsBatchLoader.cjs.map +1 -1
  73. package/build/batchloaders/recursiveParentsBatchLoader.js +2 -2
  74. package/build/batchloaders/recursiveParentsBatchLoader.js.map +1 -1
  75. package/build/changes.cjs +2 -3
  76. package/build/changes.cjs.map +1 -1
  77. package/build/changes.js +2 -3
  78. package/build/changes.js.map +1 -1
  79. package/build/config.cjs +3 -3
  80. package/build/config.cjs.map +1 -1
  81. package/build/config.d.cts +2 -2
  82. package/build/config.d.mts +2 -2
  83. package/build/config.js +1 -1
  84. package/build/config.js.map +1 -1
  85. package/build/configure.cjs +10 -10
  86. package/build/configure.cjs.map +1 -1
  87. package/build/configure.js +5 -5
  88. package/build/configure.js.map +1 -1
  89. package/build/dataloaders/fastWhereFilterHash.cjs +8 -8
  90. package/build/dataloaders/fastWhereFilterHash.cjs.map +1 -1
  91. package/build/dataloaders/fastWhereFilterHash.d.cts.map +1 -1
  92. package/build/dataloaders/fastWhereFilterHash.d.mts.map +1 -1
  93. package/build/dataloaders/fastWhereFilterHash.js +3 -3
  94. package/build/dataloaders/fastWhereFilterHash.js.map +1 -1
  95. package/build/dataloaders/findByUniqueDataLoader.cjs.map +1 -1
  96. package/build/dataloaders/findByUniqueDataLoader.d.cts.map +1 -1
  97. package/build/dataloaders/findByUniqueDataLoader.d.mts.map +1 -1
  98. package/build/dataloaders/findByUniqueDataLoader.js.map +1 -1
  99. package/build/dataloaders/findCountDataLoader.cjs +2 -2
  100. package/build/dataloaders/findCountDataLoader.cjs.map +1 -1
  101. package/build/dataloaders/findCountDataLoader.js +1 -1
  102. package/build/dataloaders/findCountDataLoader.js.map +1 -1
  103. package/build/dataloaders/findDataLoader.cjs +6 -6
  104. package/build/dataloaders/findDataLoader.cjs.map +1 -1
  105. package/build/dataloaders/findDataLoader.d.cts +1 -1
  106. package/build/dataloaders/findDataLoader.d.mts +1 -1
  107. package/build/dataloaders/findDataLoader.js +3 -3
  108. package/build/dataloaders/findDataLoader.js.map +1 -1
  109. package/build/dataloaders/findIdsDataLoader.cjs +3 -3
  110. package/build/dataloaders/findIdsDataLoader.cjs.map +1 -1
  111. package/build/dataloaders/findIdsDataLoader.js +2 -2
  112. package/build/dataloaders/findIdsDataLoader.js.map +1 -1
  113. package/build/dataloaders/findOrCreateDataLoader.cjs +1 -1
  114. package/build/dataloaders/findOrCreateDataLoader.cjs.map +1 -1
  115. package/build/dataloaders/findOrCreateDataLoader.d.cts.map +1 -1
  116. package/build/dataloaders/findOrCreateDataLoader.d.mts.map +1 -1
  117. package/build/dataloaders/findOrCreateDataLoader.js +1 -1
  118. package/build/dataloaders/findOrCreateDataLoader.js.map +1 -1
  119. package/build/dataloaders/findPaginatedDataLoader.cjs +6 -6
  120. package/build/dataloaders/findPaginatedDataLoader.cjs.map +1 -1
  121. package/build/dataloaders/findPaginatedDataLoader.d.cts +1 -1
  122. package/build/dataloaders/findPaginatedDataLoader.d.mts +1 -1
  123. package/build/dataloaders/findPaginatedDataLoader.js +3 -3
  124. package/build/dataloaders/findPaginatedDataLoader.js.map +1 -1
  125. package/build/dataloaders/lensDataLoader.cjs +3 -3
  126. package/build/dataloaders/lensDataLoader.cjs.map +1 -1
  127. package/build/dataloaders/lensDataLoader.d.cts.map +1 -1
  128. package/build/dataloaders/lensDataLoader.d.mts.map +1 -1
  129. package/build/dataloaders/lensDataLoader.js +2 -2
  130. package/build/dataloaders/lensDataLoader.js.map +1 -1
  131. package/build/dataloaders/manyToManyFindDataLoader.cjs +1 -1
  132. package/build/dataloaders/manyToManyFindDataLoader.cjs.map +1 -1
  133. package/build/dataloaders/manyToManyFindDataLoader.d.cts.map +1 -1
  134. package/build/dataloaders/manyToManyFindDataLoader.d.mts.map +1 -1
  135. package/build/dataloaders/manyToManyFindDataLoader.js +1 -1
  136. package/build/dataloaders/manyToManyFindDataLoader.js.map +1 -1
  137. package/build/dataloaders/oneToManyFindDataLoader.cjs +1 -1
  138. package/build/dataloaders/oneToManyFindDataLoader.cjs.map +1 -1
  139. package/build/dataloaders/oneToManyFindDataLoader.d.cts.map +1 -1
  140. package/build/dataloaders/oneToManyFindDataLoader.d.mts.map +1 -1
  141. package/build/dataloaders/oneToManyFindDataLoader.js +1 -1
  142. package/build/dataloaders/oneToManyFindDataLoader.js.map +1 -1
  143. package/build/defaults.cjs +5 -5
  144. package/build/defaults.cjs.map +1 -1
  145. package/build/defaults.d.cts +1 -1
  146. package/build/defaults.d.cts.map +1 -1
  147. package/build/defaults.d.mts +1 -1
  148. package/build/defaults.d.mts.map +1 -1
  149. package/build/defaults.js +4 -4
  150. package/build/defaults.js.map +1 -1
  151. package/build/drivers/Driver.cjs +0 -1
  152. package/build/drivers/Driver.d.cts +1 -1
  153. package/build/drivers/Driver.d.mts +1 -1
  154. package/build/drivers/Driver.js +0 -1
  155. package/build/drivers/EntityWriter.cjs +6 -7
  156. package/build/drivers/EntityWriter.cjs.map +1 -1
  157. package/build/drivers/EntityWriter.d.cts +1 -1
  158. package/build/drivers/EntityWriter.d.mts +1 -1
  159. package/build/drivers/EntityWriter.js +2 -3
  160. package/build/drivers/EntityWriter.js.map +1 -1
  161. package/build/drivers/IdAssigner.cjs +0 -1
  162. package/build/drivers/IdAssigner.cjs.map +1 -1
  163. package/build/drivers/IdAssigner.d.cts +1 -1
  164. package/build/drivers/IdAssigner.d.mts +1 -1
  165. package/build/drivers/IdAssigner.js +0 -1
  166. package/build/drivers/IdAssigner.js.map +1 -1
  167. package/build/drivers/driverApi.cjs +19 -0
  168. package/build/drivers/driverApi.cjs.map +1 -0
  169. package/build/drivers/driverApi.d.cts +22 -0
  170. package/build/drivers/driverApi.d.cts.map +1 -0
  171. package/build/drivers/driverApi.d.mts +22 -0
  172. package/build/drivers/driverApi.d.mts.map +1 -0
  173. package/build/drivers/driverApi.js +18 -0
  174. package/build/drivers/driverApi.js.map +1 -0
  175. package/build/fields.cjs +3 -3
  176. package/build/fields.cjs.map +1 -1
  177. package/build/fields.js +2 -2
  178. package/build/fields.js.map +1 -1
  179. package/build/{FlushLock.cjs → flush/FlushLock.cjs} +1 -1
  180. package/build/flush/FlushLock.cjs.map +1 -0
  181. package/build/{FlushLock.d.cts → flush/FlushLock.d.cts} +1 -1
  182. package/build/flush/FlushLock.d.cts.map +1 -0
  183. package/build/{FlushLock.d.mts → flush/FlushLock.d.mts} +1 -1
  184. package/build/flush/FlushLock.d.mts.map +1 -0
  185. package/build/{FlushLock.js → flush/FlushLock.js} +1 -1
  186. package/build/flush/FlushLock.js.map +1 -0
  187. package/build/{JoinRows.cjs → flush/JoinRows.cjs} +5 -8
  188. package/build/flush/JoinRows.cjs.map +1 -0
  189. package/build/{JoinRows.d.cts → flush/JoinRows.d.cts} +5 -5
  190. package/build/flush/JoinRows.d.cts.map +1 -0
  191. package/build/{JoinRows.d.mts → flush/JoinRows.d.mts} +5 -5
  192. package/build/flush/JoinRows.d.mts.map +1 -0
  193. package/build/{JoinRows.js → flush/JoinRows.js} +5 -8
  194. package/build/flush/JoinRows.js.map +1 -0
  195. package/build/{PendingChanges.cjs → flush/PendingChanges.cjs} +0 -1
  196. package/build/{PendingChanges.d.cts → flush/PendingChanges.d.cts} +2 -2
  197. package/build/flush/PendingChanges.d.cts.map +1 -0
  198. package/build/{PendingChanges.d.mts → flush/PendingChanges.d.mts} +2 -2
  199. package/build/flush/PendingChanges.d.mts.map +1 -0
  200. package/build/flush/PendingChanges.js +1 -0
  201. package/build/{Todo.cjs → flush/Todo.cjs} +4 -6
  202. package/build/flush/Todo.cjs.map +1 -0
  203. package/build/{Todo.d.cts → flush/Todo.d.cts} +3 -3
  204. package/build/flush/Todo.d.cts.map +1 -0
  205. package/build/{Todo.d.mts → flush/Todo.d.mts} +3 -3
  206. package/build/flush/Todo.d.mts.map +1 -0
  207. package/build/{Todo.js → flush/Todo.js} +4 -6
  208. package/build/flush/Todo.js.map +1 -0
  209. package/build/getProperties.cjs.map +1 -1
  210. package/build/getProperties.js.map +1 -1
  211. package/build/index.cjs +100 -100
  212. package/build/index.cjs.map +1 -1
  213. package/build/index.d.cts +15 -15
  214. package/build/index.d.mts +15 -15
  215. package/build/index.js +42 -42
  216. package/build/index.js.map +1 -1
  217. package/build/json.cjs +4 -4
  218. package/build/json.cjs.map +1 -1
  219. package/build/json.js +3 -3
  220. package/build/json.js.map +1 -1
  221. package/build/keys.cjs +1 -1
  222. package/build/keys.cjs.map +1 -1
  223. package/build/keys.js +1 -1
  224. package/build/keys.js.map +1 -1
  225. package/build/{HintTree.cjs → loading/HintTree.cjs} +2 -5
  226. package/build/loading/HintTree.cjs.map +1 -0
  227. package/build/{HintTree.d.cts → loading/HintTree.d.cts} +3 -3
  228. package/build/loading/HintTree.d.cts.map +1 -0
  229. package/build/{HintTree.d.mts → loading/HintTree.d.mts} +3 -3
  230. package/build/loading/HintTree.d.mts.map +1 -0
  231. package/build/{HintTree.js → loading/HintTree.js} +2 -5
  232. package/build/loading/HintTree.js.map +1 -0
  233. package/build/{IsLoadedCache.cjs → loading/IsLoadedCache.cjs} +2 -3
  234. package/build/loading/IsLoadedCache.cjs.map +1 -0
  235. package/build/{IsLoadedCache.d.cts → loading/IsLoadedCache.d.cts} +2 -2
  236. package/build/loading/IsLoadedCache.d.cts.map +1 -0
  237. package/build/{IsLoadedCache.d.mts → loading/IsLoadedCache.d.mts} +2 -2
  238. package/build/loading/IsLoadedCache.d.mts.map +1 -0
  239. package/build/{IsLoadedCache.js → loading/IsLoadedCache.js} +2 -3
  240. package/build/{IsLoadedCache.cjs.map → loading/IsLoadedCache.js.map} +1 -1
  241. package/build/{loadHints.cjs → loading/loadHints.cjs} +6 -11
  242. package/build/loading/loadHints.cjs.map +1 -0
  243. package/build/{loadHints.d.cts → loading/loadHints.d.cts} +14 -14
  244. package/build/loading/loadHints.d.cts.map +1 -0
  245. package/build/{loadHints.d.mts → loading/loadHints.d.mts} +14 -14
  246. package/build/loading/loadHints.d.mts.map +1 -0
  247. package/build/{loadHints.js → loading/loadHints.js} +3 -8
  248. package/build/loading/loadHints.js.map +1 -0
  249. package/build/{loadLens.cjs → loading/loadLens.cjs} +8 -9
  250. package/build/loading/loadLens.cjs.map +1 -0
  251. package/build/{loadLens.d.cts → loading/loadLens.d.cts} +3 -3
  252. package/build/loading/loadLens.d.cts.map +1 -0
  253. package/build/{loadLens.d.mts → loading/loadLens.d.mts} +3 -3
  254. package/build/loading/loadLens.d.mts.map +1 -0
  255. package/build/{loadLens.js → loading/loadLens.js} +8 -9
  256. package/build/loading/loadLens.js.map +1 -0
  257. package/build/{withLoaded.cjs → loading/withLoaded.cjs} +12 -13
  258. package/build/loading/withLoaded.cjs.map +1 -0
  259. package/build/{withLoaded.d.cts → loading/withLoaded.d.cts} +9 -9
  260. package/build/loading/withLoaded.d.cts.map +1 -0
  261. package/build/{withLoaded.d.mts → loading/withLoaded.d.mts} +9 -9
  262. package/build/loading/withLoaded.d.mts.map +1 -0
  263. package/build/{withLoaded.js → loading/withLoaded.js} +10 -11
  264. package/build/loading/withLoaded.js.map +1 -0
  265. package/build/logging/FactoryLogger.cjs.map +1 -1
  266. package/build/logging/FactoryLogger.d.cts.map +1 -1
  267. package/build/logging/FactoryLogger.d.mts.map +1 -1
  268. package/build/logging/FactoryLogger.js.map +1 -1
  269. package/build/logging/FieldLogger.cjs.map +1 -1
  270. package/build/logging/FieldLogger.d.cts.map +1 -1
  271. package/build/logging/FieldLogger.d.mts.map +1 -1
  272. package/build/logging/FieldLogger.js.map +1 -1
  273. package/build/logging/ReactionLogger.cjs +0 -2
  274. package/build/logging/ReactionLogger.cjs.map +1 -1
  275. package/build/logging/ReactionLogger.d.cts +2 -2
  276. package/build/logging/ReactionLogger.d.cts.map +1 -1
  277. package/build/logging/ReactionLogger.d.mts +2 -2
  278. package/build/logging/ReactionLogger.d.mts.map +1 -1
  279. package/build/logging/ReactionLogger.js +0 -2
  280. package/build/logging/ReactionLogger.js.map +1 -1
  281. package/build/newEntity.cjs.map +1 -1
  282. package/build/newEntity.js.map +1 -1
  283. package/build/newTestInstance.cjs +3 -3
  284. package/build/newTestInstance.cjs.map +1 -1
  285. package/build/newTestInstance.d.cts +1 -1
  286. package/build/newTestInstance.d.cts.map +1 -1
  287. package/build/newTestInstance.d.mts +1 -1
  288. package/build/newTestInstance.d.mts.map +1 -1
  289. package/build/newTestInstance.js +2 -2
  290. package/build/newTestInstance.js.map +1 -1
  291. package/build/normalizeHints.cjs +0 -2
  292. package/build/normalizeHints.cjs.map +1 -1
  293. package/build/normalizeHints.d.cts +2 -2
  294. package/build/normalizeHints.d.mts +2 -2
  295. package/build/normalizeHints.js +0 -2
  296. package/build/normalizeHints.js.map +1 -1
  297. package/build/nowUTC.cjs +2 -2
  298. package/build/nowUTC.cjs.map +1 -1
  299. package/build/nowUTC.d.cts +1 -1
  300. package/build/nowUTC.d.mts +1 -1
  301. package/build/nowUTC.js +1 -1
  302. package/build/nowUTC.js.map +1 -1
  303. package/build/plugins/ImmutableEntitiesPlugin.cjs.map +1 -1
  304. package/build/plugins/ImmutableEntitiesPlugin.js.map +1 -1
  305. package/build/plugins/PreloadPlugin.cjs +0 -2
  306. package/build/plugins/PreloadPlugin.d.cts +2 -2
  307. package/build/plugins/PreloadPlugin.d.mts +2 -2
  308. package/build/plugins/PreloadPlugin.js +0 -2
  309. package/build/preloading/JsonAggregatePreloader.cjs +1 -4
  310. package/build/preloading/JsonAggregatePreloader.cjs.map +1 -1
  311. package/build/preloading/JsonAggregatePreloader.d.cts +2 -2
  312. package/build/preloading/JsonAggregatePreloader.d.cts.map +1 -1
  313. package/build/preloading/JsonAggregatePreloader.d.mts +2 -2
  314. package/build/preloading/JsonAggregatePreloader.d.mts.map +1 -1
  315. package/build/preloading/JsonAggregatePreloader.js +1 -4
  316. package/build/preloading/JsonAggregatePreloader.js.map +1 -1
  317. package/build/preloading/canPreload.cjs.map +1 -1
  318. package/build/preloading/canPreload.js.map +1 -1
  319. package/build/preloading/partitionHint.cjs +2 -3
  320. package/build/preloading/partitionHint.cjs.map +1 -1
  321. package/build/preloading/partitionHint.d.cts +1 -1
  322. package/build/preloading/partitionHint.d.mts +1 -1
  323. package/build/preloading/partitionHint.js +2 -3
  324. package/build/preloading/partitionHint.js.map +1 -1
  325. package/build/queries/ConditionBuilder.cjs.map +1 -1
  326. package/build/queries/ConditionBuilder.d.cts +1 -1
  327. package/build/queries/ConditionBuilder.d.mts +1 -1
  328. package/build/queries/ConditionBuilder.js.map +1 -1
  329. package/build/queries/conditions.cjs.map +1 -1
  330. package/build/queries/conditions.js.map +1 -1
  331. package/build/queries/entityQueryUtils.cjs.map +1 -1
  332. package/build/queries/entityQueryUtils.js.map +1 -1
  333. package/build/queries/find/Aliases.cjs +1 -1
  334. package/build/queries/find/Aliases.cjs.map +1 -1
  335. package/build/queries/find/Aliases.d.cts.map +1 -1
  336. package/build/queries/find/Aliases.d.mts.map +1 -1
  337. package/build/queries/find/Aliases.js +1 -1
  338. package/build/queries/find/Aliases.js.map +1 -1
  339. package/build/queries/find/DeferredAlias.cjs.map +1 -1
  340. package/build/queries/find/DeferredAlias.js.map +1 -1
  341. package/build/queries/find/EntityFilter.cjs.map +1 -1
  342. package/build/queries/find/EntityFilter.js.map +1 -1
  343. package/build/queries/find/EntityGraphQLFilter.cjs.map +1 -1
  344. package/build/queries/find/EntityGraphQLFilter.js.map +1 -1
  345. package/build/queries/find/QueryParser.cjs +2 -2
  346. package/build/queries/find/QueryParser.cjs.map +1 -1
  347. package/build/queries/find/QueryParser.collectionJoins.cjs.map +1 -1
  348. package/build/queries/find/QueryParser.collectionJoins.js.map +1 -1
  349. package/build/queries/find/QueryParser.d.cts.map +1 -1
  350. package/build/queries/find/QueryParser.d.mts.map +1 -1
  351. package/build/queries/find/QueryParser.js +2 -2
  352. package/build/queries/find/QueryParser.js.map +1 -1
  353. package/build/queries/find/QueryParser.pruning.cjs.map +1 -1
  354. package/build/queries/find/QueryParser.pruning.js.map +1 -1
  355. package/build/queries/find/QueryVisitor.cjs.map +1 -1
  356. package/build/queries/find/QueryVisitor.js.map +1 -1
  357. package/build/queries/find/buildFindQuery.cjs.map +1 -1
  358. package/build/queries/find/buildFindQuery.js.map +1 -1
  359. package/build/queries/find/scopes.cjs.map +1 -1
  360. package/build/queries/find/scopes.d.cts +1 -1
  361. package/build/queries/find/scopes.d.mts +1 -1
  362. package/build/queries/find/scopes.js.map +1 -1
  363. package/build/queries/parsedConditions.cjs.map +1 -1
  364. package/build/queries/parsedConditions.js.map +1 -1
  365. package/build/queries/renderConditions.cjs.map +1 -1
  366. package/build/queries/renderConditions.js.map +1 -1
  367. package/build/queries/skipCondition.cjs.map +1 -1
  368. package/build/queries/skipCondition.js.map +1 -1
  369. package/build/queries/sql/AliasAssigner.cjs.map +1 -1
  370. package/build/queries/sql/AliasAssigner.js.map +1 -1
  371. package/build/queries/sql/Expr.cjs +2 -2
  372. package/build/queries/sql/Expr.cjs.map +1 -1
  373. package/build/queries/sql/Expr.d.cts +1 -1
  374. package/build/queries/sql/Expr.d.mts +1 -1
  375. package/build/queries/sql/Expr.js +1 -1
  376. package/build/queries/sql/Expr.js.map +1 -1
  377. package/build/queries/sql/Tables.cjs +1 -1
  378. package/build/queries/sql/Tables.cjs.map +1 -1
  379. package/build/queries/sql/Tables.d.cts.map +1 -1
  380. package/build/queries/sql/Tables.d.mts.map +1 -1
  381. package/build/queries/sql/Tables.js +1 -1
  382. package/build/queries/sql/Tables.js.map +1 -1
  383. package/build/queries/sql/execute.cjs +1 -1
  384. package/build/queries/sql/execute.cjs.map +1 -1
  385. package/build/queries/sql/execute.js +1 -1
  386. package/build/queries/sql/execute.js.map +1 -1
  387. package/build/queries/sql/expressions/arrayAgg.cjs.map +1 -1
  388. package/build/queries/sql/expressions/arrayAgg.js.map +1 -1
  389. package/build/queries/sql/expressions/case.cjs.map +1 -1
  390. package/build/queries/sql/expressions/case.js.map +1 -1
  391. package/build/queries/sql/expressions/coalesce.cjs.map +1 -1
  392. package/build/queries/sql/expressions/coalesce.js.map +1 -1
  393. package/build/queries/sql/expressions/codecs.cjs +2 -2
  394. package/build/queries/sql/expressions/codecs.cjs.map +1 -1
  395. package/build/queries/sql/expressions/codecs.js +1 -1
  396. package/build/queries/sql/expressions/codecs.js.map +1 -1
  397. package/build/queries/sql/expressions/expression.cjs.map +1 -1
  398. package/build/queries/sql/expressions/expression.d.cts.map +1 -1
  399. package/build/queries/sql/expressions/expression.d.mts.map +1 -1
  400. package/build/queries/sql/expressions/expression.js.map +1 -1
  401. package/build/queries/sql/expressions/greatest.cjs.map +1 -1
  402. package/build/queries/sql/expressions/greatest.js.map +1 -1
  403. package/build/queries/sql/expressions/least.cjs.map +1 -1
  404. package/build/queries/sql/expressions/least.js.map +1 -1
  405. package/build/queries/sql/expressions/nullIf.cjs.map +1 -1
  406. package/build/queries/sql/expressions/nullIf.js.map +1 -1
  407. package/build/queries/sql/expressions/parseExpression.cjs.map +1 -1
  408. package/build/queries/sql/expressions/parseExpression.js.map +1 -1
  409. package/build/queries/sql/expressions/types.d.cts.map +1 -1
  410. package/build/queries/sql/expressions/types.d.mts.map +1 -1
  411. package/build/queries/sql/query.cjs +1 -1
  412. package/build/queries/sql/query.cjs.map +1 -1
  413. package/build/queries/sql/query.d.cts +1 -1
  414. package/build/queries/sql/query.d.mts +1 -1
  415. package/build/queries/sql/query.js +1 -1
  416. package/build/queries/sql/query.js.map +1 -1
  417. package/build/{unnest.cjs → queries/unnest.cjs} +1 -2
  418. package/build/queries/unnest.cjs.map +1 -0
  419. package/build/{unnest.d.cts → queries/unnest.d.cts} +3 -3
  420. package/build/queries/unnest.d.cts.map +1 -0
  421. package/build/{unnest.d.mts → queries/unnest.d.mts} +3 -3
  422. package/build/queries/unnest.d.mts.map +1 -0
  423. package/build/{unnest.js → queries/unnest.js} +1 -2
  424. package/build/queries/unnest.js.map +1 -0
  425. package/build/queries/valueFilters.cjs.map +1 -1
  426. package/build/queries/valueFilters.d.cts +1 -1
  427. package/build/queries/valueFilters.d.cts.map +1 -1
  428. package/build/queries/valueFilters.d.mts +1 -1
  429. package/build/queries/valueFilters.d.mts.map +1 -1
  430. package/build/queries/valueFilters.js.map +1 -1
  431. package/build/{ReactionsManager.cjs → reactivity/ReactionsManager.cjs} +8 -10
  432. package/build/reactivity/ReactionsManager.cjs.map +1 -0
  433. package/build/{ReactionsManager.d.cts → reactivity/ReactionsManager.d.cts} +5 -6
  434. package/build/reactivity/ReactionsManager.d.cts.map +1 -0
  435. package/build/{ReactionsManager.d.mts → reactivity/ReactionsManager.d.mts} +5 -6
  436. package/build/reactivity/ReactionsManager.d.mts.map +1 -0
  437. package/build/{ReactionsManager.js → reactivity/ReactionsManager.js} +6 -8
  438. package/build/reactivity/ReactionsManager.js.map +1 -0
  439. package/build/{reactiveHints.cjs → reactivity/reactiveHints.cjs} +12 -16
  440. package/build/reactivity/reactiveHints.cjs.map +1 -0
  441. package/build/{reactiveHints.d.cts → reactivity/reactiveHints.d.cts} +17 -17
  442. package/build/reactivity/reactiveHints.d.cts.map +1 -0
  443. package/build/{reactiveHints.d.mts → reactivity/reactiveHints.d.mts} +17 -17
  444. package/build/reactivity/reactiveHints.d.mts.map +1 -0
  445. package/build/{reactiveHints.js → reactivity/reactiveHints.js} +12 -16
  446. package/build/reactivity/reactiveHints.js.map +1 -0
  447. package/build/relations/AbstractRelationImpl.cjs.map +1 -1
  448. package/build/relations/AbstractRelationImpl.js.map +1 -1
  449. package/build/relations/AsyncProperty.cjs.map +1 -1
  450. package/build/relations/AsyncProperty.js.map +1 -1
  451. package/build/relations/AsyncReactiveField.cjs +6 -6
  452. package/build/relations/AsyncReactiveField.cjs.map +1 -1
  453. package/build/relations/AsyncReactiveField.d.cts +1 -1
  454. package/build/relations/AsyncReactiveField.d.mts +1 -1
  455. package/build/relations/AsyncReactiveField.js +4 -4
  456. package/build/relations/AsyncReactiveField.js.map +1 -1
  457. package/build/relations/Collection.cjs +1 -1
  458. package/build/relations/Collection.cjs.map +1 -1
  459. package/build/relations/Collection.js +1 -1
  460. package/build/relations/Collection.js.map +1 -1
  461. package/build/relations/CustomCollection.cjs.map +1 -1
  462. package/build/relations/CustomCollection.d.cts +1 -1
  463. package/build/relations/CustomCollection.d.mts +1 -1
  464. package/build/relations/CustomCollection.js.map +1 -1
  465. package/build/relations/CustomReference.cjs +1 -1
  466. package/build/relations/CustomReference.cjs.map +1 -1
  467. package/build/relations/CustomReference.d.cts +1 -1
  468. package/build/relations/CustomReference.d.mts +1 -1
  469. package/build/relations/CustomReference.js +1 -1
  470. package/build/relations/CustomReference.js.map +1 -1
  471. package/build/relations/EnumCollection.cjs.map +1 -1
  472. package/build/relations/EnumCollection.d.cts +1 -1
  473. package/build/relations/EnumCollection.d.mts +1 -1
  474. package/build/relations/EnumCollection.js.map +1 -1
  475. package/build/relations/LazyField.cjs +4 -4
  476. package/build/relations/LazyField.cjs.map +1 -1
  477. package/build/relations/LazyField.js +4 -4
  478. package/build/relations/LazyField.js.map +1 -1
  479. package/build/relations/ManyToManyCollection.cjs +3 -3
  480. package/build/relations/ManyToManyCollection.cjs.map +1 -1
  481. package/build/relations/ManyToManyCollection.js +3 -3
  482. package/build/relations/ManyToManyCollection.js.map +1 -1
  483. package/build/relations/ManyToManyLargeCollection.cjs +3 -3
  484. package/build/relations/ManyToManyLargeCollection.cjs.map +1 -1
  485. package/build/relations/ManyToManyLargeCollection.js +3 -3
  486. package/build/relations/ManyToManyLargeCollection.js.map +1 -1
  487. package/build/relations/ManyToOneReference.cjs +4 -4
  488. package/build/relations/ManyToOneReference.cjs.map +1 -1
  489. package/build/relations/ManyToOneReference.js +4 -4
  490. package/build/relations/ManyToOneReference.js.map +1 -1
  491. package/build/relations/OneToManyCollection.cjs +1 -2
  492. package/build/relations/OneToManyCollection.cjs.map +1 -1
  493. package/build/relations/OneToManyCollection.d.cts +1 -1
  494. package/build/relations/OneToManyCollection.d.mts +1 -1
  495. package/build/relations/OneToManyCollection.js +1 -2
  496. package/build/relations/OneToManyCollection.js.map +1 -1
  497. package/build/relations/OneToManyLargeCollection.cjs +1 -1
  498. package/build/relations/OneToManyLargeCollection.cjs.map +1 -1
  499. package/build/relations/OneToManyLargeCollection.js +1 -1
  500. package/build/relations/OneToManyLargeCollection.js.map +1 -1
  501. package/build/relations/OneToOneReference.cjs +5 -5
  502. package/build/relations/OneToOneReference.cjs.map +1 -1
  503. package/build/relations/OneToOneReference.js +5 -5
  504. package/build/relations/OneToOneReference.js.map +1 -1
  505. package/build/relations/PolymorphicReference.cjs +3 -3
  506. package/build/relations/PolymorphicReference.cjs.map +1 -1
  507. package/build/relations/PolymorphicReference.js +3 -3
  508. package/build/relations/PolymorphicReference.js.map +1 -1
  509. package/build/relations/ReactiveField.cjs +5 -6
  510. package/build/relations/ReactiveField.cjs.map +1 -1
  511. package/build/relations/ReactiveField.d.cts +2 -2
  512. package/build/relations/ReactiveField.d.mts +2 -2
  513. package/build/relations/ReactiveField.js +3 -4
  514. package/build/relations/ReactiveField.js.map +1 -1
  515. package/build/relations/ReactiveGetter.cjs +0 -1
  516. package/build/relations/ReactiveGetter.cjs.map +1 -1
  517. package/build/relations/ReactiveGetter.d.cts +1 -1
  518. package/build/relations/ReactiveGetter.d.mts +1 -1
  519. package/build/relations/ReactiveGetter.js +0 -1
  520. package/build/relations/ReactiveGetter.js.map +1 -1
  521. package/build/relations/ReactiveManyToMany.cjs +5 -6
  522. package/build/relations/ReactiveManyToMany.cjs.map +1 -1
  523. package/build/relations/ReactiveManyToMany.d.cts +2 -2
  524. package/build/relations/ReactiveManyToMany.d.cts.map +1 -1
  525. package/build/relations/ReactiveManyToMany.d.mts +2 -2
  526. package/build/relations/ReactiveManyToMany.d.mts.map +1 -1
  527. package/build/relations/ReactiveManyToMany.js +3 -4
  528. package/build/relations/ReactiveManyToMany.js.map +1 -1
  529. package/build/relations/ReactiveManyToManyOtherSide.cjs +1 -3
  530. package/build/relations/ReactiveManyToManyOtherSide.cjs.map +1 -1
  531. package/build/relations/ReactiveManyToManyOtherSide.d.cts +2 -2
  532. package/build/relations/ReactiveManyToManyOtherSide.d.mts +2 -2
  533. package/build/relations/ReactiveManyToManyOtherSide.js +1 -3
  534. package/build/relations/ReactiveManyToManyOtherSide.js.map +1 -1
  535. package/build/relations/ReactiveReference.cjs +8 -9
  536. package/build/relations/ReactiveReference.cjs.map +1 -1
  537. package/build/relations/ReactiveReference.d.cts +2 -2
  538. package/build/relations/ReactiveReference.d.cts.map +1 -1
  539. package/build/relations/ReactiveReference.d.mts +2 -2
  540. package/build/relations/ReactiveReference.d.mts.map +1 -1
  541. package/build/relations/ReactiveReference.js +6 -7
  542. package/build/relations/ReactiveReference.js.map +1 -1
  543. package/build/relations/ReadOnlyCollection.cjs.map +1 -1
  544. package/build/relations/ReadOnlyCollection.js.map +1 -1
  545. package/build/relations/RecursiveCollection.cjs +3 -4
  546. package/build/relations/RecursiveCollection.cjs.map +1 -1
  547. package/build/relations/RecursiveCollection.d.cts +1 -1
  548. package/build/relations/RecursiveCollection.d.mts +1 -1
  549. package/build/relations/RecursiveCollection.js +3 -4
  550. package/build/relations/RecursiveCollection.js.map +1 -1
  551. package/build/relations/RecursiveCycleError.cjs.map +1 -1
  552. package/build/relations/RecursiveCycleError.js.map +1 -1
  553. package/build/relations/Reference.cjs +1 -1
  554. package/build/relations/Reference.cjs.map +1 -1
  555. package/build/relations/Reference.js +1 -1
  556. package/build/relations/Reference.js.map +1 -1
  557. package/build/relations/Relation.cjs.map +1 -1
  558. package/build/relations/Relation.js.map +1 -1
  559. package/build/relations/hasAsyncMethod.cjs +2 -2
  560. package/build/relations/hasAsyncMethod.cjs.map +1 -1
  561. package/build/relations/hasAsyncMethod.d.cts +1 -1
  562. package/build/relations/hasAsyncMethod.d.mts +1 -1
  563. package/build/relations/hasAsyncMethod.js +1 -1
  564. package/build/relations/hasAsyncMethod.js.map +1 -1
  565. package/build/relations/hasManyDerived.cjs +3 -3
  566. package/build/relations/hasManyDerived.cjs.map +1 -1
  567. package/build/relations/hasManyDerived.d.cts +1 -1
  568. package/build/relations/hasManyDerived.d.mts +1 -1
  569. package/build/relations/hasManyDerived.js +2 -2
  570. package/build/relations/hasManyDerived.js.map +1 -1
  571. package/build/relations/hasManyThrough.cjs +6 -6
  572. package/build/relations/hasManyThrough.cjs.map +1 -1
  573. package/build/relations/hasManyThrough.d.cts +1 -1
  574. package/build/relations/hasManyThrough.d.mts +1 -1
  575. package/build/relations/hasManyThrough.js +2 -2
  576. package/build/relations/hasManyThrough.js.map +1 -1
  577. package/build/relations/hasOneDerived.cjs +3 -3
  578. package/build/relations/hasOneDerived.cjs.map +1 -1
  579. package/build/relations/hasOneDerived.d.cts +1 -1
  580. package/build/relations/hasOneDerived.d.mts +1 -1
  581. package/build/relations/hasOneDerived.js +2 -2
  582. package/build/relations/hasOneDerived.js.map +1 -1
  583. package/build/relations/hasOneThrough.cjs +7 -7
  584. package/build/relations/hasOneThrough.cjs.map +1 -1
  585. package/build/relations/hasOneThrough.d.cts +1 -1
  586. package/build/relations/hasOneThrough.d.mts +1 -1
  587. package/build/relations/hasOneThrough.js +2 -2
  588. package/build/relations/hasOneThrough.js.map +1 -1
  589. package/build/relations/hasProperty.cjs +4 -4
  590. package/build/relations/hasProperty.cjs.map +1 -1
  591. package/build/relations/hasProperty.d.cts +2 -2
  592. package/build/relations/hasProperty.d.mts +2 -2
  593. package/build/relations/hasProperty.js +2 -2
  594. package/build/relations/hasProperty.js.map +1 -1
  595. package/build/relations/index.cjs +10 -10
  596. package/build/relations/index.js +10 -10
  597. package/build/relations/isCascadeDelete.cjs.map +1 -1
  598. package/build/relations/isCascadeDelete.js.map +1 -1
  599. package/build/resurrection.cjs.map +1 -1
  600. package/build/resurrection.js.map +1 -1
  601. package/build/rules.cjs +3 -4
  602. package/build/rules.cjs.map +1 -1
  603. package/build/rules.d.cts +1 -1
  604. package/build/rules.d.mts +1 -1
  605. package/build/rules.js +3 -4
  606. package/build/rules.js.map +1 -1
  607. package/build/runtimeConfig.cjs.map +1 -1
  608. package/build/runtimeConfig.js.map +1 -1
  609. package/build/{TypeInfo.cjs → serde/TypeInfo.cjs} +1 -1
  610. package/build/serde/TypeInfo.cjs.map +1 -0
  611. package/build/{TypeInfo.d.cts → serde/TypeInfo.d.cts} +2 -2
  612. package/build/serde/TypeInfo.d.cts.map +1 -0
  613. package/build/{TypeInfo.d.mts → serde/TypeInfo.d.mts} +2 -2
  614. package/build/serde/TypeInfo.d.mts.map +1 -0
  615. package/build/{TypeInfo.js → serde/TypeInfo.js} +1 -1
  616. package/build/serde/TypeInfo.js.map +1 -0
  617. package/build/{columns.cjs → serde/columns.cjs} +1 -1
  618. package/build/serde/columns.cjs.map +1 -0
  619. package/build/{columns.d.cts → serde/columns.d.cts} +2 -2
  620. package/build/serde/columns.d.cts.map +1 -0
  621. package/build/{columns.d.mts → serde/columns.d.mts} +2 -2
  622. package/build/serde/columns.d.mts.map +1 -0
  623. package/build/{columns.js → serde/columns.js} +1 -1
  624. package/build/serde/columns.js.map +1 -0
  625. package/build/{fieldSerde.cjs → serde/fieldSerde.cjs} +6 -6
  626. package/build/serde/fieldSerde.cjs.map +1 -0
  627. package/build/{fieldSerde.d.cts → serde/fieldSerde.d.cts} +5 -5
  628. package/build/serde/fieldSerde.d.cts.map +1 -0
  629. package/build/{fieldSerde.d.mts → serde/fieldSerde.d.mts} +5 -5
  630. package/build/serde/fieldSerde.d.mts.map +1 -0
  631. package/build/{fieldSerde.js → serde/fieldSerde.js} +6 -6
  632. package/build/serde/fieldSerde.js.map +1 -0
  633. package/build/{serde.cjs → serde/serde.cjs} +25 -26
  634. package/build/serde/serde.cjs.map +1 -0
  635. package/build/{serde.d.cts → serde/serde.d.cts} +1 -1
  636. package/build/serde/serde.d.cts.map +1 -0
  637. package/build/{serde.d.mts → serde/serde.d.mts} +1 -1
  638. package/build/serde/serde.d.mts.map +1 -0
  639. package/build/{serde.js → serde/serde.js} +4 -5
  640. package/build/serde/serde.js.map +1 -0
  641. package/build/{temporal.cjs → serde/temporal.cjs} +1 -1
  642. package/build/serde/temporal.cjs.map +1 -0
  643. package/build/{temporal.d.cts → serde/temporal.d.cts} +1 -1
  644. package/build/serde/temporal.d.cts.map +1 -0
  645. package/build/{temporal.d.mts → serde/temporal.d.mts} +1 -1
  646. package/build/serde/temporal.d.mts.map +1 -0
  647. package/build/{temporal.js → serde/temporal.js} +1 -1
  648. package/build/serde/temporal.js.map +1 -0
  649. package/build/{temporalMappers.cjs → serde/temporalMappers.cjs} +4 -5
  650. package/build/serde/temporalMappers.cjs.map +1 -0
  651. package/build/{temporalMappers.d.cts → serde/temporalMappers.d.cts} +1 -1
  652. package/build/serde/temporalMappers.d.cts.map +1 -0
  653. package/build/{temporalMappers.d.mts → serde/temporalMappers.d.mts} +1 -1
  654. package/build/serde/temporalMappers.d.mts.map +1 -0
  655. package/build/{temporalMappers.js → serde/temporalMappers.js} +2 -3
  656. package/build/serde/temporalMappers.js.map +1 -0
  657. package/build/upsert.cjs +1 -1
  658. package/build/upsert.cjs.map +1 -1
  659. package/build/upsert.d.cts.map +1 -1
  660. package/build/upsert.d.mts.map +1 -1
  661. package/build/upsert.js +1 -1
  662. package/build/upsert.js.map +1 -1
  663. package/build/utils.cjs +0 -1
  664. package/build/utils.cjs.map +1 -1
  665. package/build/utils.d.cts +1 -1
  666. package/build/utils.d.mts +1 -1
  667. package/build/utils.js +0 -1
  668. package/build/utils.js.map +1 -1
  669. package/package.json +2 -2
  670. package/build/FlushLock.cjs.map +0 -1
  671. package/build/FlushLock.d.cts.map +0 -1
  672. package/build/FlushLock.d.mts.map +0 -1
  673. package/build/FlushLock.js.map +0 -1
  674. package/build/HintTree.cjs.map +0 -1
  675. package/build/HintTree.d.cts.map +0 -1
  676. package/build/HintTree.d.mts.map +0 -1
  677. package/build/HintTree.js.map +0 -1
  678. package/build/IsLoadedCache.d.cts.map +0 -1
  679. package/build/IsLoadedCache.d.mts.map +0 -1
  680. package/build/IsLoadedCache.js.map +0 -1
  681. package/build/JoinRows.cjs.map +0 -1
  682. package/build/JoinRows.d.cts.map +0 -1
  683. package/build/JoinRows.d.mts.map +0 -1
  684. package/build/JoinRows.js.map +0 -1
  685. package/build/PendingChanges.d.cts.map +0 -1
  686. package/build/PendingChanges.d.mts.map +0 -1
  687. package/build/PendingChanges.js +0 -2
  688. package/build/ReactionsManager.cjs.map +0 -1
  689. package/build/ReactionsManager.d.cts.map +0 -1
  690. package/build/ReactionsManager.d.mts.map +0 -1
  691. package/build/ReactionsManager.js.map +0 -1
  692. package/build/Todo.cjs.map +0 -1
  693. package/build/Todo.d.cts.map +0 -1
  694. package/build/Todo.d.mts.map +0 -1
  695. package/build/Todo.js.map +0 -1
  696. package/build/TypeInfo.cjs.map +0 -1
  697. package/build/TypeInfo.d.cts.map +0 -1
  698. package/build/TypeInfo.d.mts.map +0 -1
  699. package/build/TypeInfo.js.map +0 -1
  700. package/build/columns.cjs.map +0 -1
  701. package/build/columns.d.cts.map +0 -1
  702. package/build/columns.d.mts.map +0 -1
  703. package/build/columns.js.map +0 -1
  704. package/build/driverApi.cjs +0 -18
  705. package/build/driverApi.cjs.map +0 -1
  706. package/build/driverApi.d.cts +0 -22
  707. package/build/driverApi.d.cts.map +0 -1
  708. package/build/driverApi.d.mts +0 -22
  709. package/build/driverApi.d.mts.map +0 -1
  710. package/build/driverApi.js +0 -18
  711. package/build/driverApi.js.map +0 -1
  712. package/build/fieldSerde.cjs.map +0 -1
  713. package/build/fieldSerde.d.cts.map +0 -1
  714. package/build/fieldSerde.d.mts.map +0 -1
  715. package/build/fieldSerde.js.map +0 -1
  716. package/build/loadHints.cjs.map +0 -1
  717. package/build/loadHints.d.cts.map +0 -1
  718. package/build/loadHints.d.mts.map +0 -1
  719. package/build/loadHints.js.map +0 -1
  720. package/build/loadLens.cjs.map +0 -1
  721. package/build/loadLens.d.cts.map +0 -1
  722. package/build/loadLens.d.mts.map +0 -1
  723. package/build/loadLens.js.map +0 -1
  724. package/build/reactiveHints.cjs.map +0 -1
  725. package/build/reactiveHints.d.cts.map +0 -1
  726. package/build/reactiveHints.d.mts.map +0 -1
  727. package/build/reactiveHints.js.map +0 -1
  728. package/build/serde.cjs.map +0 -1
  729. package/build/serde.d.cts.map +0 -1
  730. package/build/serde.d.mts.map +0 -1
  731. package/build/serde.js.map +0 -1
  732. package/build/temporal.cjs.map +0 -1
  733. package/build/temporal.d.cts.map +0 -1
  734. package/build/temporal.d.mts.map +0 -1
  735. package/build/temporal.js.map +0 -1
  736. package/build/temporalMappers.cjs.map +0 -1
  737. package/build/temporalMappers.d.cts.map +0 -1
  738. package/build/temporalMappers.d.mts.map +0 -1
  739. package/build/temporalMappers.js.map +0 -1
  740. package/build/unnest.cjs.map +0 -1
  741. package/build/unnest.d.cts.map +0 -1
  742. package/build/unnest.d.mts.map +0 -1
  743. package/build/unnest.js.map +0 -1
  744. package/build/withLoaded.cjs.map +0 -1
  745. package/build/withLoaded.d.cts.map +0 -1
  746. package/build/withLoaded.d.mts.map +0 -1
  747. package/build/withLoaded.js.map +0 -1
@@ -1,4 +1,3 @@
1
- import "./Todo.js";
2
1
  import "./EntityMetadata.js";
3
2
  import { isDefined } from "./EntityManager.js";
4
3
  import "./Entity.js";
@@ -1 +1 @@
1
- {"version":3,"file":"PluginManager.js","names":["#pluginsByCallback","#plugins"],"sources":["../src/PluginManager.ts"],"sourcesContent":["import { type Entity } from \"./Entity.ts\";\nimport { type EntityManager, type FindOperation, isDefined } from \"./EntityManager.ts\";\nimport { type EntityMetadata } from \"./EntityMetadata.ts\";\nimport type { ParsedFindQuery } from \"./queries/find/QueryParser.ts\";\nimport { type RowData } from \"./RowData.ts\";\nimport { type JoinRowTodo, type Todo } from \"./Todo.ts\";\n\ninterface PluginMethods {\n /**\n * Called before a field value is retrieved from an entity via getField.\n *\n * @param entity The entity instance being accessed\n * @param field The field name being retrieved\n */\n beforeGetField?(entity: Entity, field: string): void;\n /**\n * Called before a field value is set on an entity via setField.\n *\n * @param entity The entity instance being modified\n * @param field The field name being set\n * @param newValue The new value being assigned to the field\n */\n beforeSetField?(entity: Entity, field: string, newValue: any): void;\n /**\n * Called before a find operation is executed.\n *\n * @param meta Metadata for the entity type being queried\n * @param operation The type of find operation being performed\n * @param query The parsed query conditions\n * @param settings Query settings including limit and offset\n */\n beforeFind?(\n meta: EntityMetadata,\n operation: FindOperation,\n query: ParsedFindQuery,\n settings: {\n limit?: number;\n offset?: number;\n allowMultipleLeftJoins?: boolean;\n optimizeJoinsToExists?: boolean;\n pruneJoins?: boolean;\n keepAliases?: string[];\n },\n ): void;\n /**\n * Called after a find operation has been executed to observe the raw database rows.\n *\n * The result is an observation-only {@link RowData} view — i.e. `rows.rowCount` for metrics,\n * `rows.get(i, columnName)` for specific cells, or `rows.toRows()` to materialize POJO rows.\n * For lazy results, cells decode on access, so a hook that only counts rows costs nothing;\n * materializing via `toRows()` decodes every cell of every row. Mutating materialized rows is\n * unsupported and is not guaranteed to affect entity hydration.\n *\n * @param meta Metadata for the entity type that was queried\n * @param operation The type of find operation that was performed\n * @param rows A read-only view of the raw database rows returned from the query\n */\n afterFind?(meta: EntityMetadata, operation: FindOperation, rows: RowData): void;\n\n beforeValidate?(entities: readonly Entity[]): Promise<void> | void;\n\n afterValidate?(entities: readonly Entity[]): Promise<void> | void;\n\n afterWrite(entityTodos: Record<string, Todo>, joinRowTodos: Record<string, JoinRowTodo>): void;\n}\n\nconst syncPluginMethods = [\n \"beforeGetField\",\n \"beforeSetField\",\n \"beforeFind\",\n \"afterFind\",\n \"afterWrite\",\n] as const satisfies readonly (keyof PluginMethods)[];\nconst asyncPluginMethods = [\"beforeValidate\", \"afterValidate\"] as const satisfies readonly (keyof PluginMethods)[];\nconst emsSymbol = Symbol(\"ems\");\n/**\n * Base class for plugins that hook into entity lifecycle events.\n *\n * Plugins can implement any of the PluginMethods to intercept entity operations\n * and are automatically registered with the EntityManager when added via PluginManager.\n */\nexport abstract class Plugin {\n // We need to store the EntityManager references in a WeakRef array so that they can be garbage collected. If we\n // didn't do this, then multiple EMs with the same plugin instance could keep each other from being garbage collected.\n [emsSymbol]: WeakRef<EntityManager>[] = [];\n\n maybeCloneForNewEm(): this | undefined {\n return undefined;\n }\n\n get ems(): readonly EntityManager[] {\n return this[emsSymbol]\n .values()\n .map((wr) => wr.deref())\n .filter(isDefined)\n .toArray();\n }\n}\n\nexport interface Plugin extends PluginMethods {}\n\n/**\n * Manages plugin lifecycle and dispatches plugin callbacks to registered plugins.\n *\n * The PluginManager optimizes callback dispatch by only creating dispatcher methods\n * for callbacks that have at least one registered plugin, making unused plugin hooks\n * zero-cost at runtime.\n */\nexport class PluginManager implements Required<PluginMethods> {\n #plugins = new Set<Plugin>();\n readonly #pluginsByCallback: Partial<Record<keyof Plugin, Plugin[]>> = {};\n constructor(public readonly em: EntityManager) {}\n\n /** Returns whether any registered plugin implements `method`, i.e. so callers can skip building its args. */\n hasHook(method: keyof PluginMethods): boolean {\n return this.#pluginsByCallback[method] !== undefined;\n }\n\n /**\n * Registers a plugin with this EntityManager.\n *\n * Dynamically creates dispatcher methods for any plugin callbacks implemented by this plugin,\n * enabling lazy initialization of only the hooks that are actually used.\n *\n * @throws Error if the plugin is already registered with another EntityManager\n */\n addPlugin(plugin: Plugin) {\n if (this.#plugins.has(plugin)) return; // if we're already added, then we can just early exit\n this.#plugins.add(plugin);\n plugin[emsSymbol].push(new WeakRef(this.em));\n for (const method of syncPluginMethods) {\n if (method in plugin) {\n (this.#pluginsByCallback[method] ??= []).push(plugin);\n // As a performance optimization, we only create the actual implementation for each method on the plugin manager\n // once we have at least one plugin using that method. This is to make it so any unused plugin methods are\n // effectively no-ops when called from within the em.\n if (!Object.hasOwn(this, method)) {\n this[method] = function (this: PluginManager, ...args: any[]) {\n for (const plugin of this.#pluginsByCallback[method]!) {\n (plugin[method] as (...args: any[]) => unknown)(...args);\n }\n };\n }\n }\n }\n for (const method of asyncPluginMethods) {\n if (method in plugin) {\n (this.#pluginsByCallback[method] ??= []).push(plugin);\n // Validate-phase plugin hooks are intentionally awaited without making hot-path hooks async.\n if (!Object.hasOwn(this, method)) {\n this[method] = async function (this: PluginManager, ...args: any[]) {\n for (const plugin of this.#pluginsByCallback[method]!) {\n await (plugin[method] as (...args: any[]) => Promise<void> | void)(...args);\n }\n };\n }\n }\n }\n }\n\n get plugins(): readonly Plugin[] {\n return [...this.#plugins];\n }\n\n cloneTo(other: PluginManager) {\n this.#plugins\n .values()\n .map((plugin) => plugin.maybeCloneForNewEm())\n .filter(isDefined)\n .forEach((plugin) => other.addPlugin(plugin));\n }\n\n // Defined as no-op functions initially instead of using optional chaining for performance reasons, see:\n // https://adventures.nodeland.dev/archive/noop-functions-vs-optional-chaining-a-performance/\n\n beforeGetField(entity: Entity, field: string): void {}\n beforeSetField(entity: Entity, field: string, newValue: any): void {}\n beforeFind(\n meta: EntityMetadata,\n operation: FindOperation,\n query: ParsedFindQuery,\n settings: {\n limit?: number;\n offset?: number;\n allowMultipleLeftJoins?: boolean;\n optimizeJoinsToExists?: boolean;\n pruneJoins?: boolean;\n keepAliases?: string[];\n },\n ): void {}\n afterFind(meta: EntityMetadata, operation: FindOperation, rows: RowData) {}\n beforeValidate(entities: readonly Entity[]): Promise<void> | void {}\n afterValidate(entities: readonly Entity[]): Promise<void> | void {}\n afterWrite(entityTodos: Record<string, Todo>, joinRowTodos: Record<string, JoinRowTodo>): void {}\n}\n"],"mappings":";;;;;AAkEA,MAAM,oBAAoB;CACxB;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,qBAAqB,CAAC,kBAAkB,eAAe;AAC7D,MAAM,YAAY,OAAO,KAAK;;;;;;;AAO9B,IAAsB,SAAtB,MAA6B;CAG3B,CAAC,aAAuC,CAAC;CAEzC,qBAAuC,CAEvC;CAEA,IAAI,MAAgC;EAClC,OAAO,KAAK,UAAU,CACnB,OAAO,CAAC,CACR,KAAK,OAAO,GAAG,MAAM,CAAC,CAAC,CACvB,OAAO,SAAS,CAAC,CACjB,QAAQ;CACb;AACF;;;;;;;;AAWA,IAAa,gBAAb,MAA8D;CAGhC;CAF5B,2BAAW,IAAI,IAAY;CAC3B,qBAAuE,CAAC;CACxE,YAAY,IAAmC;EAAnB,KAAA,KAAA;CAAoB;;CAGhD,QAAQ,QAAsC;EAC5C,OAAO,KAAKA,mBAAmB,YAAY,KAAA;CAC7C;;;;;;;;;CAUA,UAAU,QAAgB;EACxB,IAAI,KAAKC,SAAS,IAAI,MAAM,GAAG;EAC/B,KAAKA,SAAS,IAAI,MAAM;EACxB,OAAO,UAAU,CAAC,KAAK,IAAI,QAAQ,KAAK,EAAE,CAAC;EAC3C,KAAK,MAAM,UAAU,mBACnB,IAAI,UAAU,QAAQ;GACpB,CAAC,KAAKD,mBAAmB,YAAY,CAAC,EAAA,CAAG,KAAK,MAAM;GAIpD,IAAI,CAAC,OAAO,OAAO,MAAM,MAAM,GAC7B,KAAK,UAAU,SAA+B,GAAG,MAAa;IAC5D,KAAK,MAAM,UAAU,KAAKA,mBAAmB,SAC3C,OAAQ,OAAO,CAAiC,GAAG,IAAI;GAE3D;EAEJ;EAEF,KAAK,MAAM,UAAU,oBACnB,IAAI,UAAU,QAAQ;GACpB,CAAC,KAAKA,mBAAmB,YAAY,CAAC,EAAA,CAAG,KAAK,MAAM;GAEpD,IAAI,CAAC,OAAO,OAAO,MAAM,MAAM,GAC7B,KAAK,UAAU,eAAqC,GAAG,MAAa;IAClE,KAAK,MAAM,UAAU,KAAKA,mBAAmB,SAC3C,MAAO,OAAO,OAAO,CAA8C,GAAG,IAAI;GAE9E;EAEJ;CAEJ;CAEA,IAAI,UAA6B;EAC/B,OAAO,CAAC,GAAG,KAAKC,QAAQ;CAC1B;CAEA,QAAQ,OAAsB;EAC5B,KAAKA,SACF,OAAO,CAAC,CACR,KAAK,WAAW,OAAO,mBAAmB,CAAC,CAAC,CAC5C,OAAO,SAAS,CAAC,CACjB,SAAS,WAAW,MAAM,UAAU,MAAM,CAAC;CAChD;CAKA,eAAe,QAAgB,OAAqB,CAAC;CACrD,eAAe,QAAgB,OAAe,UAAqB,CAAC;CACpE,WACE,MACA,WACA,OACA,UAQM,CAAC;CACT,UAAU,MAAsB,WAA0B,MAAe,CAAC;CAC1E,eAAe,UAAmD,CAAC;CACnE,cAAc,UAAmD,CAAC;CAClE,WAAW,aAAmC,cAAiD,CAAC;AAClG"}
1
+ {"version":3,"file":"PluginManager.js","names":["#pluginsByCallback","#plugins"],"sources":["../src/PluginManager.ts"],"sourcesContent":["import { type Entity } from \"src/Entity.ts\";\nimport { type EntityManager, type FindOperation, isDefined } from \"src/EntityManager.ts\";\nimport { type EntityMetadata } from \"src/EntityMetadata.ts\";\nimport type { JoinRowTodo, Todo } from \"src/flush/Todo.ts\";\nimport type { ParsedFindQuery } from \"src/queries/find/QueryParser.ts\";\nimport { type RowData } from \"src/RowData.ts\";\n\ninterface PluginMethods {\n /**\n * Called before a field value is retrieved from an entity via getField.\n *\n * @param entity The entity instance being accessed\n * @param field The field name being retrieved\n */\n beforeGetField?(entity: Entity, field: string): void;\n /**\n * Called before a field value is set on an entity via setField.\n *\n * @param entity The entity instance being modified\n * @param field The field name being set\n * @param newValue The new value being assigned to the field\n */\n beforeSetField?(entity: Entity, field: string, newValue: any): void;\n /**\n * Called before a find operation is executed.\n *\n * @param meta Metadata for the entity type being queried\n * @param operation The type of find operation being performed\n * @param query The parsed query conditions\n * @param settings Query settings including limit and offset\n */\n beforeFind?(\n meta: EntityMetadata,\n operation: FindOperation,\n query: ParsedFindQuery,\n settings: {\n limit?: number;\n offset?: number;\n allowMultipleLeftJoins?: boolean;\n optimizeJoinsToExists?: boolean;\n pruneJoins?: boolean;\n keepAliases?: string[];\n },\n ): void;\n /**\n * Called after a find operation has been executed to observe the raw database rows.\n *\n * The result is an observation-only {@link RowData} view — i.e. `rows.rowCount` for metrics,\n * `rows.get(i, columnName)` for specific cells, or `rows.toRows()` to materialize POJO rows.\n * For lazy results, cells decode on access, so a hook that only counts rows costs nothing;\n * materializing via `toRows()` decodes every cell of every row. Mutating materialized rows is\n * unsupported and is not guaranteed to affect entity hydration.\n *\n * @param meta Metadata for the entity type that was queried\n * @param operation The type of find operation that was performed\n * @param rows A read-only view of the raw database rows returned from the query\n */\n afterFind?(meta: EntityMetadata, operation: FindOperation, rows: RowData): void;\n\n beforeValidate?(entities: readonly Entity[]): Promise<void> | void;\n\n afterValidate?(entities: readonly Entity[]): Promise<void> | void;\n\n afterWrite(entityTodos: Record<string, Todo>, joinRowTodos: Record<string, JoinRowTodo>): void;\n}\n\nconst syncPluginMethods = [\n \"beforeGetField\",\n \"beforeSetField\",\n \"beforeFind\",\n \"afterFind\",\n \"afterWrite\",\n] as const satisfies readonly (keyof PluginMethods)[];\nconst asyncPluginMethods = [\"beforeValidate\", \"afterValidate\"] as const satisfies readonly (keyof PluginMethods)[];\nconst emsSymbol = Symbol(\"ems\");\n/**\n * Base class for plugins that hook into entity lifecycle events.\n *\n * Plugins can implement any of the PluginMethods to intercept entity operations\n * and are automatically registered with the EntityManager when added via PluginManager.\n */\nexport abstract class Plugin {\n // We need to store the EntityManager references in a WeakRef array so that they can be garbage collected. If we\n // didn't do this, then multiple EMs with the same plugin instance could keep each other from being garbage collected.\n [emsSymbol]: WeakRef<EntityManager>[] = [];\n\n maybeCloneForNewEm(): this | undefined {\n return undefined;\n }\n\n get ems(): readonly EntityManager[] {\n return this[emsSymbol]\n .values()\n .map((wr) => wr.deref())\n .filter(isDefined)\n .toArray();\n }\n}\n\nexport interface Plugin extends PluginMethods {}\n\n/**\n * Manages plugin lifecycle and dispatches plugin callbacks to registered plugins.\n *\n * The PluginManager optimizes callback dispatch by only creating dispatcher methods\n * for callbacks that have at least one registered plugin, making unused plugin hooks\n * zero-cost at runtime.\n */\nexport class PluginManager implements Required<PluginMethods> {\n #plugins = new Set<Plugin>();\n readonly #pluginsByCallback: Partial<Record<keyof Plugin, Plugin[]>> = {};\n constructor(public readonly em: EntityManager) {}\n\n /** Returns whether any registered plugin implements `method`, i.e. so callers can skip building its args. */\n hasHook(method: keyof PluginMethods): boolean {\n return this.#pluginsByCallback[method] !== undefined;\n }\n\n /**\n * Registers a plugin with this EntityManager.\n *\n * Dynamically creates dispatcher methods for any plugin callbacks implemented by this plugin,\n * enabling lazy initialization of only the hooks that are actually used.\n *\n * @throws Error if the plugin is already registered with another EntityManager\n */\n addPlugin(plugin: Plugin) {\n if (this.#plugins.has(plugin)) return; // if we're already added, then we can just early exit\n this.#plugins.add(plugin);\n plugin[emsSymbol].push(new WeakRef(this.em));\n for (const method of syncPluginMethods) {\n if (method in plugin) {\n (this.#pluginsByCallback[method] ??= []).push(plugin);\n // As a performance optimization, we only create the actual implementation for each method on the plugin manager\n // once we have at least one plugin using that method. This is to make it so any unused plugin methods are\n // effectively no-ops when called from within the em.\n if (!Object.hasOwn(this, method)) {\n this[method] = function (this: PluginManager, ...args: any[]) {\n for (const plugin of this.#pluginsByCallback[method]!) {\n (plugin[method] as (...args: any[]) => unknown)(...args);\n }\n };\n }\n }\n }\n for (const method of asyncPluginMethods) {\n if (method in plugin) {\n (this.#pluginsByCallback[method] ??= []).push(plugin);\n // Validate-phase plugin hooks are intentionally awaited without making hot-path hooks async.\n if (!Object.hasOwn(this, method)) {\n this[method] = async function (this: PluginManager, ...args: any[]) {\n for (const plugin of this.#pluginsByCallback[method]!) {\n await (plugin[method] as (...args: any[]) => Promise<void> | void)(...args);\n }\n };\n }\n }\n }\n }\n\n get plugins(): readonly Plugin[] {\n return [...this.#plugins];\n }\n\n cloneTo(other: PluginManager) {\n this.#plugins\n .values()\n .map((plugin) => plugin.maybeCloneForNewEm())\n .filter(isDefined)\n .forEach((plugin) => other.addPlugin(plugin));\n }\n\n // Defined as no-op functions initially instead of using optional chaining for performance reasons, see:\n // https://adventures.nodeland.dev/archive/noop-functions-vs-optional-chaining-a-performance/\n\n beforeGetField(entity: Entity, field: string): void {}\n beforeSetField(entity: Entity, field: string, newValue: any): void {}\n beforeFind(\n meta: EntityMetadata,\n operation: FindOperation,\n query: ParsedFindQuery,\n settings: {\n limit?: number;\n offset?: number;\n allowMultipleLeftJoins?: boolean;\n optimizeJoinsToExists?: boolean;\n pruneJoins?: boolean;\n keepAliases?: string[];\n },\n ): void {}\n afterFind(meta: EntityMetadata, operation: FindOperation, rows: RowData) {}\n beforeValidate(entities: readonly Entity[]): Promise<void> | void {}\n afterValidate(entities: readonly Entity[]): Promise<void> | void {}\n afterWrite(entityTodos: Record<string, Todo>, joinRowTodos: Record<string, JoinRowTodo>): void {}\n}\n"],"mappings":";;;;AAkEA,MAAM,oBAAoB;CACxB;CACA;CACA;CACA;CACA;AACF;AACA,MAAM,qBAAqB,CAAC,kBAAkB,eAAe;AAC7D,MAAM,YAAY,OAAO,KAAK;;;;;;;AAO9B,IAAsB,SAAtB,MAA6B;CAG3B,CAAC,aAAuC,CAAC;CAEzC,qBAAuC,CAEvC;CAEA,IAAI,MAAgC;EAClC,OAAO,KAAK,UAAU,CACnB,OAAO,CAAC,CACR,KAAK,OAAO,GAAG,MAAM,CAAC,CAAC,CACvB,OAAO,SAAS,CAAC,CACjB,QAAQ;CACb;AACF;;;;;;;;AAWA,IAAa,gBAAb,MAA8D;CAGhC;CAF5B,2BAAW,IAAI,IAAY;CAC3B,qBAAuE,CAAC;CACxE,YAAY,IAAmC;EAAnB,KAAA,KAAA;CAAoB;;CAGhD,QAAQ,QAAsC;EAC5C,OAAO,KAAKA,mBAAmB,YAAY,KAAA;CAC7C;;;;;;;;;CAUA,UAAU,QAAgB;EACxB,IAAI,KAAKC,SAAS,IAAI,MAAM,GAAG;EAC/B,KAAKA,SAAS,IAAI,MAAM;EACxB,OAAO,UAAU,CAAC,KAAK,IAAI,QAAQ,KAAK,EAAE,CAAC;EAC3C,KAAK,MAAM,UAAU,mBACnB,IAAI,UAAU,QAAQ;GACpB,CAAC,KAAKD,mBAAmB,YAAY,CAAC,EAAA,CAAG,KAAK,MAAM;GAIpD,IAAI,CAAC,OAAO,OAAO,MAAM,MAAM,GAC7B,KAAK,UAAU,SAA+B,GAAG,MAAa;IAC5D,KAAK,MAAM,UAAU,KAAKA,mBAAmB,SAC3C,OAAQ,OAAO,CAAiC,GAAG,IAAI;GAE3D;EAEJ;EAEF,KAAK,MAAM,UAAU,oBACnB,IAAI,UAAU,QAAQ;GACpB,CAAC,KAAKA,mBAAmB,YAAY,CAAC,EAAA,CAAG,KAAK,MAAM;GAEpD,IAAI,CAAC,OAAO,OAAO,MAAM,MAAM,GAC7B,KAAK,UAAU,eAAqC,GAAG,MAAa;IAClE,KAAK,MAAM,UAAU,KAAKA,mBAAmB,SAC3C,MAAO,OAAO,OAAO,CAA8C,GAAG,IAAI;GAE9E;EAEJ;CAEJ;CAEA,IAAI,UAA6B;EAC/B,OAAO,CAAC,GAAG,KAAKC,QAAQ;CAC1B;CAEA,QAAQ,OAAsB;EAC5B,KAAKA,SACF,OAAO,CAAC,CACR,KAAK,WAAW,OAAO,mBAAmB,CAAC,CAAC,CAC5C,OAAO,SAAS,CAAC,CACjB,SAAS,WAAW,MAAM,UAAU,MAAM,CAAC;CAChD;CAKA,eAAe,QAAgB,OAAqB,CAAC;CACrD,eAAe,QAAgB,OAAe,UAAqB,CAAC;CACpE,WACE,MACA,WACA,OACA,UAQM,CAAC;CACT,UAAU,MAAsB,WAA0B,MAAe,CAAC;CAC1E,eAAe,UAAmD,CAAC;CACnE,cAAc,UAAmD,CAAC;CAClE,WAAW,aAAmC,cAAiD,CAAC;AAClG"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./BatchLoader.cjs");
3
- const require_utils = require("../utils.cjs");
4
3
  const require_keys = require("../keys.cjs");
4
+ const require_utils = require("../utils.cjs");
5
5
  require("../index.cjs");
6
6
  const require_EntityManager = require("../EntityManager.cjs");
7
7
  //#region src/batchloaders/enumCollectionBatchLoader.ts
@@ -1 +1 @@
1
- {"version":3,"file":"enumCollectionBatchLoader.cjs","names":["getEmInternalApi","abbreviation","keyToNumber"],"sources":["../../src/batchloaders/enumCollectionBatchLoader.ts"],"sourcesContent":["import { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { type ManyToManyLike, type ParsedFindQuery, keyToNumber } from \"../index.ts\";\nimport { abbreviation } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const enumCollectionLoadOperation = \"enum-collection-load\";\n\n/** Batches `EnumCollection.load` calls via BatchLoader; keys are the owning entities' tagged ids. */\nexport function enumCollectionBatchLoader(em: EntityManager, collection: ManyToManyLike): BatchLoader<string> {\n return em.getBatchLoader(enumCollectionLoadOperation, collection.joinTableName, (keys) =>\n loadBatch(em, collection, keys),\n );\n}\n\nasync function loadBatch(em: EntityManager, collection: ManyToManyLike, keys: string[]): Promise<void> {\n const { meta, columnName, otherColumnName, joinTableName, hasJoinTableId, otherEnum, fieldName } = collection;\n const joinRows = getEmInternalApi(em).joinRows(collection);\n\n const alias = abbreviation(joinTableName);\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: joinTableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias,\n column: columnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys.map((id) => keyToNumber(meta, id)!) },\n },\n ],\n },\n // Id-less join tables have no surrogate id to order by, so order by the FK columns instead.\n orderBys: hasJoinTableId\n ? [{ alias, column: \"id\", order: \"ASC\" }]\n : [\n { alias, column: columnName, order: \"ASC\" },\n { alias, column: otherColumnName, order: \"ASC\" },\n ],\n };\n\n const rows = await em[\"executeFind\"](meta, enumCollectionLoadOperation, query, { limit: undefined });\n await joinRows.loadRows(\n keys.map((id) => [columnName, id]),\n rows,\n );\n\n const api = getEmInternalApi(em);\n for (const id of keys) {\n const entity = em.getEntity(id);\n if (!entity) continue;\n const codes = (joinRows.getOthers(columnName, entity) as number[])\n .sort((a, b) => a - b)\n .map((enumId) => otherEnum!.findById(enumId)!.code);\n api.setPreloadedRelation(entity.idTagged!, fieldName, codes);\n }\n}\n"],"mappings":";;;;;;;AAKA,MAAa,8BAA8B;;AAG3C,SAAgB,0BAA0B,IAAmB,YAAiD;CAC5G,OAAO,GAAG,eAAe,6BAA6B,WAAW,gBAAgB,SAC/E,UAAU,IAAI,YAAY,IAAI,CAChC;AACF;AAEA,eAAe,UAAU,IAAmB,YAA4B,MAA+B;CACrG,MAAM,EAAE,MAAM,YAAY,iBAAiB,eAAe,gBAAgB,WAAW,cAAc;CACnG,MAAM,WAAWA,sBAAAA,iBAAiB,EAAE,CAAC,CAAC,SAAS,UAAU;CAEzD,MAAM,QAAQC,cAAAA,aAAa,aAAa;CACxC,MAAM,QAAyB;EAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;EACxB,QAAQ,CAAC;GAAE;GAAO,MAAM;GAAW,OAAO;EAAc,CAAC;EACzD,WAAW;GACT,MAAM;GACN,IAAI;GACJ,YAAY,CACV;IACE,MAAM;IACN;IACA,QAAQ;IACR,QAAQ,KAAK;IACb,MAAM;KAAE,MAAM;KAAM,OAAO,KAAK,KAAK,OAAOC,aAAAA,YAAY,MAAM,EAAE,CAAE;IAAE;GACtE,CACF;EACF;EAEA,UAAU,iBACN,CAAC;GAAE;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC,IACtC,CACE;GAAE;GAAO,QAAQ;GAAY,OAAO;EAAM,GAC1C;GAAE;GAAO,QAAQ;GAAiB,OAAO;EAAM,CACjD;CACN;CAEA,MAAM,OAAO,MAAM,GAAG,cAAc,CAAC,MAAM,6BAA6B,OAAO,EAAE,OAAO,KAAA,EAAU,CAAC;CACnG,MAAM,SAAS,SACb,KAAK,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,GACjC,IACF;CAEA,MAAM,MAAMF,sBAAAA,iBAAiB,EAAE;CAC/B,KAAK,MAAM,MAAM,MAAM;EACrB,MAAM,SAAS,GAAG,UAAU,EAAE;EAC9B,IAAI,CAAC,QAAQ;EACb,MAAM,QAAS,SAAS,UAAU,YAAY,MAAM,CAAC,CAClD,MAAM,GAAG,MAAM,IAAI,CAAC,CAAC,CACrB,KAAK,WAAW,UAAW,SAAS,MAAM,CAAC,CAAE,IAAI;EACpD,IAAI,qBAAqB,OAAO,UAAW,WAAW,KAAK;CAC7D;AACF"}
1
+ {"version":3,"file":"enumCollectionBatchLoader.cjs","names":["getEmInternalApi","abbreviation","keyToNumber"],"sources":["../../src/batchloaders/enumCollectionBatchLoader.ts"],"sourcesContent":["import { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { type ManyToManyLike, type ParsedFindQuery, keyToNumber } from \"src/index.ts\";\nimport { abbreviation } from \"src/utils.ts\";\n\nexport const enumCollectionLoadOperation = \"enum-collection-load\";\n\n/** Batches `EnumCollection.load` calls via BatchLoader; keys are the owning entities' tagged ids. */\nexport function enumCollectionBatchLoader(em: EntityManager, collection: ManyToManyLike): BatchLoader<string> {\n return em.getBatchLoader(enumCollectionLoadOperation, collection.joinTableName, (keys) =>\n loadBatch(em, collection, keys),\n );\n}\n\nasync function loadBatch(em: EntityManager, collection: ManyToManyLike, keys: string[]): Promise<void> {\n const { meta, columnName, otherColumnName, joinTableName, hasJoinTableId, otherEnum, fieldName } = collection;\n const joinRows = getEmInternalApi(em).joinRows(collection);\n\n const alias = abbreviation(joinTableName);\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: joinTableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias,\n column: columnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys.map((id) => keyToNumber(meta, id)!) },\n },\n ],\n },\n // Id-less join tables have no surrogate id to order by, so order by the FK columns instead.\n orderBys: hasJoinTableId\n ? [{ alias, column: \"id\", order: \"ASC\" }]\n : [\n { alias, column: columnName, order: \"ASC\" },\n { alias, column: otherColumnName, order: \"ASC\" },\n ],\n };\n\n const rows = await em[\"executeFind\"](meta, enumCollectionLoadOperation, query, { limit: undefined });\n await joinRows.loadRows(\n keys.map((id) => [columnName, id]),\n rows,\n );\n\n const api = getEmInternalApi(em);\n for (const id of keys) {\n const entity = em.getEntity(id);\n if (!entity) continue;\n const codes = (joinRows.getOthers(columnName, entity) as number[])\n .sort((a, b) => a - b)\n .map((enumId) => otherEnum!.findById(enumId)!.code);\n api.setPreloadedRelation(entity.idTagged!, fieldName, codes);\n }\n}\n"],"mappings":";;;;;;;AAKA,MAAa,8BAA8B;;AAG3C,SAAgB,0BAA0B,IAAmB,YAAiD;CAC5G,OAAO,GAAG,eAAe,6BAA6B,WAAW,gBAAgB,SAC/E,UAAU,IAAI,YAAY,IAAI,CAChC;AACF;AAEA,eAAe,UAAU,IAAmB,YAA4B,MAA+B;CACrG,MAAM,EAAE,MAAM,YAAY,iBAAiB,eAAe,gBAAgB,WAAW,cAAc;CACnG,MAAM,WAAWA,sBAAAA,iBAAiB,EAAE,CAAC,CAAC,SAAS,UAAU;CAEzD,MAAM,QAAQC,cAAAA,aAAa,aAAa;CACxC,MAAM,QAAyB;EAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;EACxB,QAAQ,CAAC;GAAE;GAAO,MAAM;GAAW,OAAO;EAAc,CAAC;EACzD,WAAW;GACT,MAAM;GACN,IAAI;GACJ,YAAY,CACV;IACE,MAAM;IACN;IACA,QAAQ;IACR,QAAQ,KAAK;IACb,MAAM;KAAE,MAAM;KAAM,OAAO,KAAK,KAAK,OAAOC,aAAAA,YAAY,MAAM,EAAE,CAAE;IAAE;GACtE,CACF;EACF;EAEA,UAAU,iBACN,CAAC;GAAE;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC,IACtC,CACE;GAAE;GAAO,QAAQ;GAAY,OAAO;EAAM,GAC1C;GAAE;GAAO,QAAQ;GAAiB,OAAO;EAAM,CACjD;CACN;CAEA,MAAM,OAAO,MAAM,GAAG,cAAc,CAAC,MAAM,6BAA6B,OAAO,EAAE,OAAO,KAAA,EAAU,CAAC;CACnG,MAAM,SAAS,SACb,KAAK,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,GACjC,IACF;CAEA,MAAM,MAAMF,sBAAAA,iBAAiB,EAAE;CAC/B,KAAK,MAAM,MAAM,MAAM;EACrB,MAAM,SAAS,GAAG,UAAU,EAAE;EAC9B,IAAI,CAAC,QAAQ;EACb,MAAM,QAAS,SAAS,UAAU,YAAY,MAAM,CAAC,CAClD,MAAM,GAAG,MAAM,IAAI,CAAC,CAAC,CACrB,KAAK,WAAW,UAAW,SAAS,MAAM,CAAC,CAAE,IAAI;EACpD,IAAI,qBAAqB,OAAO,UAAW,WAAW,KAAK;CAC7D;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { BatchLoader } from "./BatchLoader.cjs";
2
- import { ManyToManyLike } from "../JoinRows.cjs";
2
+ import { ManyToManyLike } from "../flush/JoinRows.cjs";
3
3
  import "../index.cjs";
4
4
  import { EntityManager } from "../EntityManager.cjs";
5
5
  //#region src/batchloaders/enumCollectionBatchLoader.d.ts
@@ -1,5 +1,5 @@
1
1
  import { BatchLoader } from "./BatchLoader.mjs";
2
- import { ManyToManyLike } from "../JoinRows.mjs";
2
+ import { ManyToManyLike } from "../flush/JoinRows.mjs";
3
3
  import "../index.mjs";
4
4
  import { EntityManager } from "../EntityManager.mjs";
5
5
  //#region src/batchloaders/enumCollectionBatchLoader.d.ts
@@ -1,6 +1,6 @@
1
1
  import "./BatchLoader.js";
2
- import { abbreviation } from "../utils.js";
3
2
  import { keyToNumber } from "../keys.js";
3
+ import { abbreviation } from "../utils.js";
4
4
  import "../index.js";
5
5
  import { getEmInternalApi } from "../EntityManager.js";
6
6
  //#region src/batchloaders/enumCollectionBatchLoader.ts
@@ -1 +1 @@
1
- {"version":3,"file":"enumCollectionBatchLoader.js","names":[],"sources":["../../src/batchloaders/enumCollectionBatchLoader.ts"],"sourcesContent":["import { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { type ManyToManyLike, type ParsedFindQuery, keyToNumber } from \"../index.ts\";\nimport { abbreviation } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const enumCollectionLoadOperation = \"enum-collection-load\";\n\n/** Batches `EnumCollection.load` calls via BatchLoader; keys are the owning entities' tagged ids. */\nexport function enumCollectionBatchLoader(em: EntityManager, collection: ManyToManyLike): BatchLoader<string> {\n return em.getBatchLoader(enumCollectionLoadOperation, collection.joinTableName, (keys) =>\n loadBatch(em, collection, keys),\n );\n}\n\nasync function loadBatch(em: EntityManager, collection: ManyToManyLike, keys: string[]): Promise<void> {\n const { meta, columnName, otherColumnName, joinTableName, hasJoinTableId, otherEnum, fieldName } = collection;\n const joinRows = getEmInternalApi(em).joinRows(collection);\n\n const alias = abbreviation(joinTableName);\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: joinTableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias,\n column: columnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys.map((id) => keyToNumber(meta, id)!) },\n },\n ],\n },\n // Id-less join tables have no surrogate id to order by, so order by the FK columns instead.\n orderBys: hasJoinTableId\n ? [{ alias, column: \"id\", order: \"ASC\" }]\n : [\n { alias, column: columnName, order: \"ASC\" },\n { alias, column: otherColumnName, order: \"ASC\" },\n ],\n };\n\n const rows = await em[\"executeFind\"](meta, enumCollectionLoadOperation, query, { limit: undefined });\n await joinRows.loadRows(\n keys.map((id) => [columnName, id]),\n rows,\n );\n\n const api = getEmInternalApi(em);\n for (const id of keys) {\n const entity = em.getEntity(id);\n if (!entity) continue;\n const codes = (joinRows.getOthers(columnName, entity) as number[])\n .sort((a, b) => a - b)\n .map((enumId) => otherEnum!.findById(enumId)!.code);\n api.setPreloadedRelation(entity.idTagged!, fieldName, codes);\n }\n}\n"],"mappings":";;;;;;AAKA,MAAa,8BAA8B;;AAG3C,SAAgB,0BAA0B,IAAmB,YAAiD;CAC5G,OAAO,GAAG,eAAe,6BAA6B,WAAW,gBAAgB,SAC/E,UAAU,IAAI,YAAY,IAAI,CAChC;AACF;AAEA,eAAe,UAAU,IAAmB,YAA4B,MAA+B;CACrG,MAAM,EAAE,MAAM,YAAY,iBAAiB,eAAe,gBAAgB,WAAW,cAAc;CACnG,MAAM,WAAW,iBAAiB,EAAE,CAAC,CAAC,SAAS,UAAU;CAEzD,MAAM,QAAQ,aAAa,aAAa;CACxC,MAAM,QAAyB;EAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;EACxB,QAAQ,CAAC;GAAE;GAAO,MAAM;GAAW,OAAO;EAAc,CAAC;EACzD,WAAW;GACT,MAAM;GACN,IAAI;GACJ,YAAY,CACV;IACE,MAAM;IACN;IACA,QAAQ;IACR,QAAQ,KAAK;IACb,MAAM;KAAE,MAAM;KAAM,OAAO,KAAK,KAAK,OAAO,YAAY,MAAM,EAAE,CAAE;IAAE;GACtE,CACF;EACF;EAEA,UAAU,iBACN,CAAC;GAAE;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC,IACtC,CACE;GAAE;GAAO,QAAQ;GAAY,OAAO;EAAM,GAC1C;GAAE;GAAO,QAAQ;GAAiB,OAAO;EAAM,CACjD;CACN;CAEA,MAAM,OAAO,MAAM,GAAG,cAAc,CAAC,MAAM,6BAA6B,OAAO,EAAE,OAAO,KAAA,EAAU,CAAC;CACnG,MAAM,SAAS,SACb,KAAK,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,GACjC,IACF;CAEA,MAAM,MAAM,iBAAiB,EAAE;CAC/B,KAAK,MAAM,MAAM,MAAM;EACrB,MAAM,SAAS,GAAG,UAAU,EAAE;EAC9B,IAAI,CAAC,QAAQ;EACb,MAAM,QAAS,SAAS,UAAU,YAAY,MAAM,CAAC,CAClD,MAAM,GAAG,MAAM,IAAI,CAAC,CAAC,CACrB,KAAK,WAAW,UAAW,SAAS,MAAM,CAAC,CAAE,IAAI;EACpD,IAAI,qBAAqB,OAAO,UAAW,WAAW,KAAK;CAC7D;AACF"}
1
+ {"version":3,"file":"enumCollectionBatchLoader.js","names":[],"sources":["../../src/batchloaders/enumCollectionBatchLoader.ts"],"sourcesContent":["import { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { type ManyToManyLike, type ParsedFindQuery, keyToNumber } from \"src/index.ts\";\nimport { abbreviation } from \"src/utils.ts\";\n\nexport const enumCollectionLoadOperation = \"enum-collection-load\";\n\n/** Batches `EnumCollection.load` calls via BatchLoader; keys are the owning entities' tagged ids. */\nexport function enumCollectionBatchLoader(em: EntityManager, collection: ManyToManyLike): BatchLoader<string> {\n return em.getBatchLoader(enumCollectionLoadOperation, collection.joinTableName, (keys) =>\n loadBatch(em, collection, keys),\n );\n}\n\nasync function loadBatch(em: EntityManager, collection: ManyToManyLike, keys: string[]): Promise<void> {\n const { meta, columnName, otherColumnName, joinTableName, hasJoinTableId, otherEnum, fieldName } = collection;\n const joinRows = getEmInternalApi(em).joinRows(collection);\n\n const alias = abbreviation(joinTableName);\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: joinTableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias,\n column: columnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys.map((id) => keyToNumber(meta, id)!) },\n },\n ],\n },\n // Id-less join tables have no surrogate id to order by, so order by the FK columns instead.\n orderBys: hasJoinTableId\n ? [{ alias, column: \"id\", order: \"ASC\" }]\n : [\n { alias, column: columnName, order: \"ASC\" },\n { alias, column: otherColumnName, order: \"ASC\" },\n ],\n };\n\n const rows = await em[\"executeFind\"](meta, enumCollectionLoadOperation, query, { limit: undefined });\n await joinRows.loadRows(\n keys.map((id) => [columnName, id]),\n rows,\n );\n\n const api = getEmInternalApi(em);\n for (const id of keys) {\n const entity = em.getEntity(id);\n if (!entity) continue;\n const codes = (joinRows.getOthers(columnName, entity) as number[])\n .sort((a, b) => a - b)\n .map((enumId) => otherEnum!.findById(enumId)!.code);\n api.setPreloadedRelation(entity.idTagged!, fieldName, codes);\n }\n}\n"],"mappings":";;;;;;AAKA,MAAa,8BAA8B;;AAG3C,SAAgB,0BAA0B,IAAmB,YAAiD;CAC5G,OAAO,GAAG,eAAe,6BAA6B,WAAW,gBAAgB,SAC/E,UAAU,IAAI,YAAY,IAAI,CAChC;AACF;AAEA,eAAe,UAAU,IAAmB,YAA4B,MAA+B;CACrG,MAAM,EAAE,MAAM,YAAY,iBAAiB,eAAe,gBAAgB,WAAW,cAAc;CACnG,MAAM,WAAW,iBAAiB,EAAE,CAAC,CAAC,SAAS,UAAU;CAEzD,MAAM,QAAQ,aAAa,aAAa;CACxC,MAAM,QAAyB;EAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;EACxB,QAAQ,CAAC;GAAE;GAAO,MAAM;GAAW,OAAO;EAAc,CAAC;EACzD,WAAW;GACT,MAAM;GACN,IAAI;GACJ,YAAY,CACV;IACE,MAAM;IACN;IACA,QAAQ;IACR,QAAQ,KAAK;IACb,MAAM;KAAE,MAAM;KAAM,OAAO,KAAK,KAAK,OAAO,YAAY,MAAM,EAAE,CAAE;IAAE;GACtE,CACF;EACF;EAEA,UAAU,iBACN,CAAC;GAAE;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC,IACtC,CACE;GAAE;GAAO,QAAQ;GAAY,OAAO;EAAM,GAC1C;GAAE;GAAO,QAAQ;GAAiB,OAAO;EAAM,CACjD;CACN;CAEA,MAAM,OAAO,MAAM,GAAG,cAAc,CAAC,MAAM,6BAA6B,OAAO,EAAE,OAAO,KAAA,EAAU,CAAC;CACnG,MAAM,SAAS,SACb,KAAK,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,GACjC,IACF;CAEA,MAAM,MAAM,iBAAiB,EAAE;CAC/B,KAAK,MAAM,MAAM,MAAM;EACrB,MAAM,SAAS,GAAG,UAAU,EAAE;EAC9B,IAAI,CAAC,QAAQ;EACb,MAAM,QAAS,SAAS,UAAU,YAAY,MAAM,CAAC,CAClD,MAAM,GAAG,MAAM,IAAI,CAAC,CAAC,CACrB,KAAK,WAAW,UAAW,SAAS,MAAM,CAAC,CAAE,IAAI;EACpD,IAAI,qBAAqB,OAAO,UAAW,WAAW,KAAK;CAC7D;AACF"}
@@ -1,12 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./BatchLoader.cjs");
3
+ const require_keys = require("../keys.cjs");
3
4
  const require_queries_entityQueryUtils = require("../queries/entityQueryUtils.cjs");
4
5
  const require_queries_find_QueryParser = require("../queries/find/QueryParser.cjs");
5
- require("../loadHints.cjs");
6
6
  const require_utils = require("../utils.cjs");
7
- const require_keys = require("../keys.cjs");
8
7
  require("../EntityMetadata.cjs");
9
- const require_HintTree = require("../HintTree.cjs");
8
+ const require_loading_HintTree = require("../loading/HintTree.cjs");
10
9
  const require_EntityManager = require("../EntityManager.cjs");
11
10
  const require_BaseEntity = require("../BaseEntity.cjs");
12
11
  //#region src/batchloaders/loadBatchLoader.ts
@@ -51,7 +50,7 @@ function loadBatchLoader(em, meta, overwriteExisting = false) {
51
50
  };
52
51
  require_queries_find_QueryParser.addTablePerClassJoinsAndClassTag(query, meta, alias, true);
53
52
  const { preloader } = require_EntityManager.getEmInternalApi(em);
54
- const preloadHydrator = preloader && preloader.addPreloading(meta, require_HintTree.buildHintTree(loads.map((l) => ({
53
+ const preloadHydrator = preloader && preloader.addPreloading(meta, require_loading_HintTree.buildHintTree(loads.map((l) => ({
55
54
  entity: l.taggedId,
56
55
  hint: l.hint
57
56
  }))), query);
@@ -1 +1 @@
1
- {"version":3,"file":"loadBatchLoader.cjs","names":["keyToNumber","abbreviation","lazyExcludedSelects","getEmInternalApi","buildHintTree","tagId"],"sources":["../../src/batchloaders/loadBatchLoader.ts"],"sourcesContent":["import { getInstanceData } from \"../BaseEntity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { type EntityMetadata } from \"../EntityMetadata.ts\";\nimport { buildHintTree } from \"../HintTree.ts\";\nimport { keyToNumber, tagId } from \"../keys.ts\";\nimport { type LoadHint } from \"../loadHints.ts\";\nimport { lazyExcludedSelects } from \"../queries/entityQueryUtils.ts\";\nimport { type ParsedFindQuery, addTablePerClassJoinsAndClassTag } from \"../queries/find/QueryParser.ts\";\nimport { abbreviation } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const loadOperation = \"load\";\n\n/**\n * Batches em.load-style fetches, writing to identity map (via hydrate) instead of returning values.\n * After the batch resolves, callers retrieve their entity from `em.findExistingInstance`.\n *\n * Accepts tuples of `{ taggedId, hint }` so the preloader can inject join-based\n * preloading into the same SELECT that fetches the entities.\n */\nexport function loadBatchLoader(\n em: EntityManager,\n meta: EntityMetadata,\n overwriteExisting: boolean = false,\n): BatchLoader<{ taggedId: string; hint: LoadHint<any> | undefined }> {\n return em.getBatchLoader(loadOperation, `${meta.type}-${overwriteExisting}`, async (loads) => {\n const keys = loads.map((l) => keyToNumber(meta, l.taggedId));\n const alias = abbreviation(meta.tableName);\n const query = {\n selects: meta.hasLazyColumns ? lazyExcludedSelects(meta, alias) : [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: meta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [{ kind: \"column\", alias, column: \"id\", dbType: meta.idDbType, cond: { kind: \"in\", value: keys } }],\n },\n orderBys: [{ alias, column: \"id\", order: \"ASC\" }],\n } satisfies ParsedFindQuery;\n addTablePerClassJoinsAndClassTag(query, meta, alias, true);\n // Inject preloading joins into the query if enabled\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator =\n preloader &&\n preloader.addPreloading(meta, buildHintTree(loads.map((l) => ({ entity: l.taggedId, hint: l.hint }))), query);\n const rowData = await em[\"executeFindRowData\"](meta, loadOperation, query, {});\n em[\"hydrateAndFinalize\"](meta.cstr, rowData, {\n overwriteExisting,\n sidecars: (entities) => {\n preloadHydrator && preloadHydrator(rowData, entities);\n // If we're missing any requested rows, mark any requested-but-not-found entities as deleted\n if (rowData.rowCount !== loads.length) {\n const foundIds = new Set<string>();\n for (let i = 0; i < rowData.rowCount; i++) foundIds.add(tagId(meta, rowData.get(i, \"id\")));\n for (const load of loads) {\n if (!foundIds.has(load.taggedId)) {\n const existingEntity = em.findExistingInstance(load.taggedId);\n if (existingEntity) {\n getInstanceData(existingEntity).markDeletedBecauseNotFound();\n }\n }\n }\n }\n },\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,gBAAgB;;;;;;;;AAS7B,SAAgB,gBACd,IACA,MACA,oBAA6B,OACuC;CACpE,OAAO,GAAG,eAAe,eAAe,GAAG,KAAK,KAAK,GAAG,qBAAqB,OAAO,UAAU;EAC5F,MAAM,OAAO,MAAM,KAAK,MAAMA,aAAAA,YAAY,MAAM,EAAE,QAAQ,CAAC;EAC3D,MAAM,QAAQC,cAAAA,aAAa,KAAK,SAAS;EACzC,MAAM,QAAQ;GACZ,SAAS,KAAK,iBAAiBC,iCAAAA,oBAAoB,MAAM,KAAK,IAAI,CAAC,IAAI,MAAM,IAAI;GACjF,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,KAAK;GAAU,CAAC;GAC1D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CAAC;KAAE,MAAM;KAAU;KAAO,QAAQ;KAAM,QAAQ,KAAK;KAAU,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAAE,CAAC;GAChH;GACA,UAAU,CAAC;IAAE;IAAO,QAAQ;IAAM,OAAO;GAAM,CAAC;EAClD;EACA,iCAAA,iCAAiC,OAAO,MAAM,OAAO,IAAI;EAEzD,MAAM,EAAE,cAAcC,sBAAAA,iBAAiB,EAAE;EACzC,MAAM,kBACJ,aACA,UAAU,cAAc,MAAMC,iBAAAA,cAAc,MAAM,KAAK,OAAO;GAAE,QAAQ,EAAE;GAAU,MAAM,EAAE;EAAK,EAAE,CAAC,GAAG,KAAK;EAC9G,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,MAAM,eAAe,OAAO,CAAC,CAAC;EAC7E,GAAG,qBAAqB,CAAC,KAAK,MAAM,SAAS;GAC3C;GACA,WAAW,aAAa;IACtB,mBAAmB,gBAAgB,SAAS,QAAQ;IAEpD,IAAI,QAAQ,aAAa,MAAM,QAAQ;KACrC,MAAM,2BAAW,IAAI,IAAY;KACjC,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,UAAU,KAAK,SAAS,IAAIC,aAAAA,MAAM,MAAM,QAAQ,IAAI,GAAG,IAAI,CAAC,CAAC;KACzF,KAAK,MAAM,QAAQ,OACjB,IAAI,CAAC,SAAS,IAAI,KAAK,QAAQ,GAAG;MAChC,MAAM,iBAAiB,GAAG,qBAAqB,KAAK,QAAQ;MAC5D,IAAI,gBACF,mBAAA,gBAAgB,cAAc,CAAC,CAAC,2BAA2B;KAE/D;IAEJ;GACF;EACF,CAAC;CACH,CAAC;AACH"}
1
+ {"version":3,"file":"loadBatchLoader.cjs","names":["keyToNumber","abbreviation","lazyExcludedSelects","getEmInternalApi","buildHintTree","tagId"],"sources":["../../src/batchloaders/loadBatchLoader.ts"],"sourcesContent":["import { getInstanceData } from \"src/BaseEntity.ts\";\nimport { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { type EntityMetadata } from \"src/EntityMetadata.ts\";\nimport { keyToNumber, tagId } from \"src/keys.ts\";\nimport { buildHintTree } from \"src/loading/HintTree.ts\";\nimport type { LoadHint } from \"src/loading/loadHints.ts\";\nimport { lazyExcludedSelects } from \"src/queries/entityQueryUtils.ts\";\nimport { type ParsedFindQuery, addTablePerClassJoinsAndClassTag } from \"src/queries/find/QueryParser.ts\";\nimport { abbreviation } from \"src/utils.ts\";\n\nexport const loadOperation = \"load\";\n\n/**\n * Batches em.load-style fetches, writing to identity map (via hydrate) instead of returning values.\n * After the batch resolves, callers retrieve their entity from `em.findExistingInstance`.\n *\n * Accepts tuples of `{ taggedId, hint }` so the preloader can inject join-based\n * preloading into the same SELECT that fetches the entities.\n */\nexport function loadBatchLoader(\n em: EntityManager,\n meta: EntityMetadata,\n overwriteExisting: boolean = false,\n): BatchLoader<{ taggedId: string; hint: LoadHint<any> | undefined }> {\n return em.getBatchLoader(loadOperation, `${meta.type}-${overwriteExisting}`, async (loads) => {\n const keys = loads.map((l) => keyToNumber(meta, l.taggedId));\n const alias = abbreviation(meta.tableName);\n const query = {\n selects: meta.hasLazyColumns ? lazyExcludedSelects(meta, alias) : [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: meta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [{ kind: \"column\", alias, column: \"id\", dbType: meta.idDbType, cond: { kind: \"in\", value: keys } }],\n },\n orderBys: [{ alias, column: \"id\", order: \"ASC\" }],\n } satisfies ParsedFindQuery;\n addTablePerClassJoinsAndClassTag(query, meta, alias, true);\n // Inject preloading joins into the query if enabled\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator =\n preloader &&\n preloader.addPreloading(meta, buildHintTree(loads.map((l) => ({ entity: l.taggedId, hint: l.hint }))), query);\n const rowData = await em[\"executeFindRowData\"](meta, loadOperation, query, {});\n em[\"hydrateAndFinalize\"](meta.cstr, rowData, {\n overwriteExisting,\n sidecars: (entities) => {\n preloadHydrator && preloadHydrator(rowData, entities);\n // If we're missing any requested rows, mark any requested-but-not-found entities as deleted\n if (rowData.rowCount !== loads.length) {\n const foundIds = new Set<string>();\n for (let i = 0; i < rowData.rowCount; i++) foundIds.add(tagId(meta, rowData.get(i, \"id\")));\n for (const load of loads) {\n if (!foundIds.has(load.taggedId)) {\n const existingEntity = em.findExistingInstance(load.taggedId);\n if (existingEntity) {\n getInstanceData(existingEntity).markDeletedBecauseNotFound();\n }\n }\n }\n }\n },\n });\n });\n}\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,gBAAgB;;;;;;;;AAS7B,SAAgB,gBACd,IACA,MACA,oBAA6B,OACuC;CACpE,OAAO,GAAG,eAAe,eAAe,GAAG,KAAK,KAAK,GAAG,qBAAqB,OAAO,UAAU;EAC5F,MAAM,OAAO,MAAM,KAAK,MAAMA,aAAAA,YAAY,MAAM,EAAE,QAAQ,CAAC;EAC3D,MAAM,QAAQC,cAAAA,aAAa,KAAK,SAAS;EACzC,MAAM,QAAQ;GACZ,SAAS,KAAK,iBAAiBC,iCAAAA,oBAAoB,MAAM,KAAK,IAAI,CAAC,IAAI,MAAM,IAAI;GACjF,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,KAAK;GAAU,CAAC;GAC1D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CAAC;KAAE,MAAM;KAAU;KAAO,QAAQ;KAAM,QAAQ,KAAK;KAAU,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAAE,CAAC;GAChH;GACA,UAAU,CAAC;IAAE;IAAO,QAAQ;IAAM,OAAO;GAAM,CAAC;EAClD;EACA,iCAAA,iCAAiC,OAAO,MAAM,OAAO,IAAI;EAEzD,MAAM,EAAE,cAAcC,sBAAAA,iBAAiB,EAAE;EACzC,MAAM,kBACJ,aACA,UAAU,cAAc,MAAMC,yBAAAA,cAAc,MAAM,KAAK,OAAO;GAAE,QAAQ,EAAE;GAAU,MAAM,EAAE;EAAK,EAAE,CAAC,GAAG,KAAK;EAC9G,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,MAAM,eAAe,OAAO,CAAC,CAAC;EAC7E,GAAG,qBAAqB,CAAC,KAAK,MAAM,SAAS;GAC3C;GACA,WAAW,aAAa;IACtB,mBAAmB,gBAAgB,SAAS,QAAQ;IAEpD,IAAI,QAAQ,aAAa,MAAM,QAAQ;KACrC,MAAM,2BAAW,IAAI,IAAY;KACjC,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,UAAU,KAAK,SAAS,IAAIC,aAAAA,MAAM,MAAM,QAAQ,IAAI,GAAG,IAAI,CAAC,CAAC;KACzF,KAAK,MAAM,QAAQ,OACjB,IAAI,CAAC,SAAS,IAAI,KAAK,QAAQ,GAAG;MAChC,MAAM,iBAAiB,GAAG,qBAAqB,KAAK,QAAQ;MAC5D,IAAI,gBACF,mBAAA,gBAAgB,cAAc,CAAC,CAAC,2BAA2B;KAE/D;IAEJ;GACF;EACF,CAAC;CACH,CAAC;AACH"}
@@ -1,5 +1,5 @@
1
1
  import { BatchLoader } from "./BatchLoader.cjs";
2
- import { LoadHint } from "../loadHints.cjs";
2
+ import { LoadHint } from "../loading/loadHints.cjs";
3
3
  import { EntityMetadata } from "../EntityMetadata.cjs";
4
4
  import { EntityManager } from "../EntityManager.cjs";
5
5
  //#region src/batchloaders/loadBatchLoader.d.ts
@@ -1,5 +1,5 @@
1
1
  import { BatchLoader } from "./BatchLoader.mjs";
2
- import { LoadHint } from "../loadHints.mjs";
2
+ import { LoadHint } from "../loading/loadHints.mjs";
3
3
  import { EntityMetadata } from "../EntityMetadata.mjs";
4
4
  import { EntityManager } from "../EntityManager.mjs";
5
5
  //#region src/batchloaders/loadBatchLoader.d.ts
@@ -1,11 +1,10 @@
1
1
  import "./BatchLoader.js";
2
+ import { keyToNumber, tagId } from "../keys.js";
2
3
  import { lazyExcludedSelects } from "../queries/entityQueryUtils.js";
3
4
  import { addTablePerClassJoinsAndClassTag } from "../queries/find/QueryParser.js";
4
- import "../loadHints.js";
5
5
  import { abbreviation } from "../utils.js";
6
- import { keyToNumber, tagId } from "../keys.js";
7
6
  import "../EntityMetadata.js";
8
- import { buildHintTree } from "../HintTree.js";
7
+ import { buildHintTree } from "../loading/HintTree.js";
9
8
  import { getEmInternalApi } from "../EntityManager.js";
10
9
  import { getInstanceData } from "../BaseEntity.js";
11
10
  //#region src/batchloaders/loadBatchLoader.ts
@@ -1 +1 @@
1
- {"version":3,"file":"loadBatchLoader.js","names":[],"sources":["../../src/batchloaders/loadBatchLoader.ts"],"sourcesContent":["import { getInstanceData } from \"../BaseEntity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { type EntityMetadata } from \"../EntityMetadata.ts\";\nimport { buildHintTree } from \"../HintTree.ts\";\nimport { keyToNumber, tagId } from \"../keys.ts\";\nimport { type LoadHint } from \"../loadHints.ts\";\nimport { lazyExcludedSelects } from \"../queries/entityQueryUtils.ts\";\nimport { type ParsedFindQuery, addTablePerClassJoinsAndClassTag } from \"../queries/find/QueryParser.ts\";\nimport { abbreviation } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const loadOperation = \"load\";\n\n/**\n * Batches em.load-style fetches, writing to identity map (via hydrate) instead of returning values.\n * After the batch resolves, callers retrieve their entity from `em.findExistingInstance`.\n *\n * Accepts tuples of `{ taggedId, hint }` so the preloader can inject join-based\n * preloading into the same SELECT that fetches the entities.\n */\nexport function loadBatchLoader(\n em: EntityManager,\n meta: EntityMetadata,\n overwriteExisting: boolean = false,\n): BatchLoader<{ taggedId: string; hint: LoadHint<any> | undefined }> {\n return em.getBatchLoader(loadOperation, `${meta.type}-${overwriteExisting}`, async (loads) => {\n const keys = loads.map((l) => keyToNumber(meta, l.taggedId));\n const alias = abbreviation(meta.tableName);\n const query = {\n selects: meta.hasLazyColumns ? lazyExcludedSelects(meta, alias) : [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: meta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [{ kind: \"column\", alias, column: \"id\", dbType: meta.idDbType, cond: { kind: \"in\", value: keys } }],\n },\n orderBys: [{ alias, column: \"id\", order: \"ASC\" }],\n } satisfies ParsedFindQuery;\n addTablePerClassJoinsAndClassTag(query, meta, alias, true);\n // Inject preloading joins into the query if enabled\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator =\n preloader &&\n preloader.addPreloading(meta, buildHintTree(loads.map((l) => ({ entity: l.taggedId, hint: l.hint }))), query);\n const rowData = await em[\"executeFindRowData\"](meta, loadOperation, query, {});\n em[\"hydrateAndFinalize\"](meta.cstr, rowData, {\n overwriteExisting,\n sidecars: (entities) => {\n preloadHydrator && preloadHydrator(rowData, entities);\n // If we're missing any requested rows, mark any requested-but-not-found entities as deleted\n if (rowData.rowCount !== loads.length) {\n const foundIds = new Set<string>();\n for (let i = 0; i < rowData.rowCount; i++) foundIds.add(tagId(meta, rowData.get(i, \"id\")));\n for (const load of loads) {\n if (!foundIds.has(load.taggedId)) {\n const existingEntity = em.findExistingInstance(load.taggedId);\n if (existingEntity) {\n getInstanceData(existingEntity).markDeletedBecauseNotFound();\n }\n }\n }\n }\n },\n });\n });\n}\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,gBAAgB;;;;;;;;AAS7B,SAAgB,gBACd,IACA,MACA,oBAA6B,OACuC;CACpE,OAAO,GAAG,eAAe,eAAe,GAAG,KAAK,KAAK,GAAG,qBAAqB,OAAO,UAAU;EAC5F,MAAM,OAAO,MAAM,KAAK,MAAM,YAAY,MAAM,EAAE,QAAQ,CAAC;EAC3D,MAAM,QAAQ,aAAa,KAAK,SAAS;EACzC,MAAM,QAAQ;GACZ,SAAS,KAAK,iBAAiB,oBAAoB,MAAM,KAAK,IAAI,CAAC,IAAI,MAAM,IAAI;GACjF,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,KAAK;GAAU,CAAC;GAC1D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CAAC;KAAE,MAAM;KAAU;KAAO,QAAQ;KAAM,QAAQ,KAAK;KAAU,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAAE,CAAC;GAChH;GACA,UAAU,CAAC;IAAE;IAAO,QAAQ;IAAM,OAAO;GAAM,CAAC;EAClD;EACA,iCAAiC,OAAO,MAAM,OAAO,IAAI;EAEzD,MAAM,EAAE,cAAc,iBAAiB,EAAE;EACzC,MAAM,kBACJ,aACA,UAAU,cAAc,MAAM,cAAc,MAAM,KAAK,OAAO;GAAE,QAAQ,EAAE;GAAU,MAAM,EAAE;EAAK,EAAE,CAAC,GAAG,KAAK;EAC9G,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,MAAM,eAAe,OAAO,CAAC,CAAC;EAC7E,GAAG,qBAAqB,CAAC,KAAK,MAAM,SAAS;GAC3C;GACA,WAAW,aAAa;IACtB,mBAAmB,gBAAgB,SAAS,QAAQ;IAEpD,IAAI,QAAQ,aAAa,MAAM,QAAQ;KACrC,MAAM,2BAAW,IAAI,IAAY;KACjC,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,UAAU,KAAK,SAAS,IAAI,MAAM,MAAM,QAAQ,IAAI,GAAG,IAAI,CAAC,CAAC;KACzF,KAAK,MAAM,QAAQ,OACjB,IAAI,CAAC,SAAS,IAAI,KAAK,QAAQ,GAAG;MAChC,MAAM,iBAAiB,GAAG,qBAAqB,KAAK,QAAQ;MAC5D,IAAI,gBACF,gBAAgB,cAAc,CAAC,CAAC,2BAA2B;KAE/D;IAEJ;GACF;EACF,CAAC;CACH,CAAC;AACH"}
1
+ {"version":3,"file":"loadBatchLoader.js","names":[],"sources":["../../src/batchloaders/loadBatchLoader.ts"],"sourcesContent":["import { getInstanceData } from \"src/BaseEntity.ts\";\nimport { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { type EntityMetadata } from \"src/EntityMetadata.ts\";\nimport { keyToNumber, tagId } from \"src/keys.ts\";\nimport { buildHintTree } from \"src/loading/HintTree.ts\";\nimport type { LoadHint } from \"src/loading/loadHints.ts\";\nimport { lazyExcludedSelects } from \"src/queries/entityQueryUtils.ts\";\nimport { type ParsedFindQuery, addTablePerClassJoinsAndClassTag } from \"src/queries/find/QueryParser.ts\";\nimport { abbreviation } from \"src/utils.ts\";\n\nexport const loadOperation = \"load\";\n\n/**\n * Batches em.load-style fetches, writing to identity map (via hydrate) instead of returning values.\n * After the batch resolves, callers retrieve their entity from `em.findExistingInstance`.\n *\n * Accepts tuples of `{ taggedId, hint }` so the preloader can inject join-based\n * preloading into the same SELECT that fetches the entities.\n */\nexport function loadBatchLoader(\n em: EntityManager,\n meta: EntityMetadata,\n overwriteExisting: boolean = false,\n): BatchLoader<{ taggedId: string; hint: LoadHint<any> | undefined }> {\n return em.getBatchLoader(loadOperation, `${meta.type}-${overwriteExisting}`, async (loads) => {\n const keys = loads.map((l) => keyToNumber(meta, l.taggedId));\n const alias = abbreviation(meta.tableName);\n const query = {\n selects: meta.hasLazyColumns ? lazyExcludedSelects(meta, alias) : [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: meta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [{ kind: \"column\", alias, column: \"id\", dbType: meta.idDbType, cond: { kind: \"in\", value: keys } }],\n },\n orderBys: [{ alias, column: \"id\", order: \"ASC\" }],\n } satisfies ParsedFindQuery;\n addTablePerClassJoinsAndClassTag(query, meta, alias, true);\n // Inject preloading joins into the query if enabled\n const { preloader } = getEmInternalApi(em);\n const preloadHydrator =\n preloader &&\n preloader.addPreloading(meta, buildHintTree(loads.map((l) => ({ entity: l.taggedId, hint: l.hint }))), query);\n const rowData = await em[\"executeFindRowData\"](meta, loadOperation, query, {});\n em[\"hydrateAndFinalize\"](meta.cstr, rowData, {\n overwriteExisting,\n sidecars: (entities) => {\n preloadHydrator && preloadHydrator(rowData, entities);\n // If we're missing any requested rows, mark any requested-but-not-found entities as deleted\n if (rowData.rowCount !== loads.length) {\n const foundIds = new Set<string>();\n for (let i = 0; i < rowData.rowCount; i++) foundIds.add(tagId(meta, rowData.get(i, \"id\")));\n for (const load of loads) {\n if (!foundIds.has(load.taggedId)) {\n const existingEntity = em.findExistingInstance(load.taggedId);\n if (existingEntity) {\n getInstanceData(existingEntity).markDeletedBecauseNotFound();\n }\n }\n }\n }\n },\n });\n });\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAa,gBAAgB;;;;;;;;AAS7B,SAAgB,gBACd,IACA,MACA,oBAA6B,OACuC;CACpE,OAAO,GAAG,eAAe,eAAe,GAAG,KAAK,KAAK,GAAG,qBAAqB,OAAO,UAAU;EAC5F,MAAM,OAAO,MAAM,KAAK,MAAM,YAAY,MAAM,EAAE,QAAQ,CAAC;EAC3D,MAAM,QAAQ,aAAa,KAAK,SAAS;EACzC,MAAM,QAAQ;GACZ,SAAS,KAAK,iBAAiB,oBAAoB,MAAM,KAAK,IAAI,CAAC,IAAI,MAAM,IAAI;GACjF,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,KAAK;GAAU,CAAC;GAC1D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CAAC;KAAE,MAAM;KAAU;KAAO,QAAQ;KAAM,QAAQ,KAAK;KAAU,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAAE,CAAC;GAChH;GACA,UAAU,CAAC;IAAE;IAAO,QAAQ;IAAM,OAAO;GAAM,CAAC;EAClD;EACA,iCAAiC,OAAO,MAAM,OAAO,IAAI;EAEzD,MAAM,EAAE,cAAc,iBAAiB,EAAE;EACzC,MAAM,kBACJ,aACA,UAAU,cAAc,MAAM,cAAc,MAAM,KAAK,OAAO;GAAE,QAAQ,EAAE;GAAU,MAAM,EAAE;EAAK,EAAE,CAAC,GAAG,KAAK;EAC9G,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,MAAM,eAAe,OAAO,CAAC,CAAC;EAC7E,GAAG,qBAAqB,CAAC,KAAK,MAAM,SAAS;GAC3C;GACA,WAAW,aAAa;IACtB,mBAAmB,gBAAgB,SAAS,QAAQ;IAEpD,IAAI,QAAQ,aAAa,MAAM,QAAQ;KACrC,MAAM,2BAAW,IAAI,IAAY;KACjC,KAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,UAAU,KAAK,SAAS,IAAI,MAAM,MAAM,QAAQ,IAAI,GAAG,IAAI,CAAC,CAAC;KACzF,KAAK,MAAM,QAAQ,OACjB,IAAI,CAAC,SAAS,IAAI,KAAK,QAAQ,GAAG;MAChC,MAAM,iBAAiB,GAAG,qBAAqB,KAAK,QAAQ;MAC5D,IAAI,gBACF,gBAAgB,cAAc,CAAC,CAAC,2BAA2B;KAE/D;IAEJ;GACF;EACF,CAAC;CACH,CAAC;AACH"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./BatchLoader.cjs");
3
- const require_utils = require("../utils.cjs");
4
3
  const require_keys = require("../keys.cjs");
4
+ const require_utils = require("../utils.cjs");
5
5
  require("../index.cjs");
6
6
  const require_EntityManager = require("../EntityManager.cjs");
7
7
  require("../Entity.cjs");
@@ -1 +1 @@
1
- {"version":3,"file":"manyToManyBatchLoader.cjs","names":["getEmInternalApi","abbreviation","keyToNumber"],"sources":["../../src/batchloaders/manyToManyBatchLoader.ts"],"sourcesContent":["import { type Entity } from \"../Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { type ManyToManyLike, type ParsedFindQuery, keyToNumber } from \"../index.ts\";\nimport { abbreviation, getOrSet } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const manyToManyLoadOperation = \"m2m-load\";\n\n/** Batches m2m.packages/core/src/relations/ReactiveManyToMany.tsload calls via BatchLoader. */\nexport function manyToManyBatchLoader(em: EntityManager, collection: ManyToManyLike): BatchLoader<string> {\n return em.getBatchLoader(manyToManyLoadOperation, collection.joinTableName, (keys) => loadBatch(collection, keys));\n}\n\nasync function loadBatch<U extends Entity>(collection: ManyToManyLike, keys: string[]): Promise<void> {\n const { em } = collection.entity;\n\n const joinRows = getEmInternalApi(em).joinRows(collection);\n\n // Break out `column_id=string` keys\n const columns: Record<string, string[]> = {};\n const tuples: [string, string][] = [];\n keys.forEach((key) => {\n const [columnId, id] = key.split(\"=\");\n getOrSet(columns, columnId, []).push(id);\n tuples.push([columnId, id]);\n });\n\n const alias = abbreviation(collection.joinTableName);\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: collection.joinTableName }],\n condition: {\n kind: \"exp\",\n op: \"or\",\n conditions: Object.entries(columns).map(([columnId, values]) => {\n // `otherMeta` is only optional because of enum m2ms (EnumCollections), which use their own\n // batch loader, so here it's always an entity-to-entity m2m and `otherMeta` is defined.\n const meta = collection.columnName == columnId ? collection.meta : collection.otherMeta!;\n return {\n kind: \"column\",\n alias,\n column: columnId,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: values.map((id) => keyToNumber(meta, id)!) },\n };\n }),\n },\n // Id-less join tables have no surrogate id to order by, so order by the FK columns instead.\n orderBys: collection.hasJoinTableId\n ? [{ alias, column: \"id\", order: \"ASC\" }]\n : [\n { alias, column: collection.columnName, order: \"ASC\" },\n { alias, column: collection.otherColumnName, order: \"ASC\" },\n ],\n };\n\n const rows = await em[\"executeFind\"](\n collection.otherMeta!,\n manyToManyLoadOperation,\n query,\n // No LIMIT needed for join rows\n { limit: undefined },\n );\n await joinRows.loadRows(tuples, rows);\n\n const api = getEmInternalApi(em);\n for (const [column, id] of tuples) {\n const entity = em.getEntity(id);\n if (!entity) continue;\n const others = joinRows.getOthers(column, entity) as U[];\n // Determine the field name from the column\n const fieldName = column === collection.columnName ? collection.fieldName : collection.otherFieldName!;\n api.setPreloadedRelation(entity.idTagged!, fieldName, others);\n }\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,0BAA0B;;AAGvC,SAAgB,sBAAsB,IAAmB,YAAiD;CACxG,OAAO,GAAG,eAAe,yBAAyB,WAAW,gBAAgB,SAAS,UAAU,YAAY,IAAI,CAAC;AACnH;AAEA,eAAe,UAA4B,YAA4B,MAA+B;CACpG,MAAM,EAAE,OAAO,WAAW;CAE1B,MAAM,WAAWA,sBAAAA,iBAAiB,EAAE,CAAC,CAAC,SAAS,UAAU;CAGzD,MAAM,UAAoC,CAAC;CAC3C,MAAM,SAA6B,CAAC;CACpC,KAAK,SAAS,QAAQ;EACpB,MAAM,CAAC,UAAU,MAAM,IAAI,MAAM,GAAG;EACpC,cAAA,SAAS,SAAS,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;EACvC,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;CAC5B,CAAC;CAED,MAAM,QAAQC,cAAAA,aAAa,WAAW,aAAa;CACnD,MAAM,QAAyB;EAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;EACxB,QAAQ,CAAC;GAAE;GAAO,MAAM;GAAW,OAAO,WAAW;EAAc,CAAC;EACpE,WAAW;GACT,MAAM;GACN,IAAI;GACJ,YAAY,OAAO,QAAQ,OAAO,CAAC,CAAC,KAAK,CAAC,UAAU,YAAY;IAG9D,MAAM,OAAO,WAAW,cAAc,WAAW,WAAW,OAAO,WAAW;IAC9E,OAAO;KACL,MAAM;KACN;KACA,QAAQ;KACR,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO,OAAO,KAAK,OAAOC,aAAAA,YAAY,MAAM,EAAE,CAAE;KAAE;IACxE;GACF,CAAC;EACH;EAEA,UAAU,WAAW,iBACjB,CAAC;GAAE;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC,IACtC,CACE;GAAE;GAAO,QAAQ,WAAW;GAAY,OAAO;EAAM,GACrD;GAAE;GAAO,QAAQ,WAAW;GAAiB,OAAO;EAAM,CAC5D;CACN;CAEA,MAAM,OAAO,MAAM,GAAG,cAAc,CAClC,WAAW,WACX,yBACA,OAEA,EAAE,OAAO,KAAA,EAAU,CACrB;CACA,MAAM,SAAS,SAAS,QAAQ,IAAI;CAEpC,MAAM,MAAMF,sBAAAA,iBAAiB,EAAE;CAC/B,KAAK,MAAM,CAAC,QAAQ,OAAO,QAAQ;EACjC,MAAM,SAAS,GAAG,UAAU,EAAE;EAC9B,IAAI,CAAC,QAAQ;EACb,MAAM,SAAS,SAAS,UAAU,QAAQ,MAAM;EAEhD,MAAM,YAAY,WAAW,WAAW,aAAa,WAAW,YAAY,WAAW;EACvF,IAAI,qBAAqB,OAAO,UAAW,WAAW,MAAM;CAC9D;AACF"}
1
+ {"version":3,"file":"manyToManyBatchLoader.cjs","names":["getEmInternalApi","abbreviation","keyToNumber"],"sources":["../../src/batchloaders/manyToManyBatchLoader.ts"],"sourcesContent":["import { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type Entity } from \"src/Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { type ManyToManyLike, type ParsedFindQuery, keyToNumber } from \"src/index.ts\";\nimport { abbreviation, getOrSet } from \"src/utils.ts\";\n\nexport const manyToManyLoadOperation = \"m2m-load\";\n\n/** Batches m2m.packages/core/src/relations/ReactiveManyToMany.tsload calls via BatchLoader. */\nexport function manyToManyBatchLoader(em: EntityManager, collection: ManyToManyLike): BatchLoader<string> {\n return em.getBatchLoader(manyToManyLoadOperation, collection.joinTableName, (keys) => loadBatch(collection, keys));\n}\n\nasync function loadBatch<U extends Entity>(collection: ManyToManyLike, keys: string[]): Promise<void> {\n const { em } = collection.entity;\n\n const joinRows = getEmInternalApi(em).joinRows(collection);\n\n // Break out `column_id=string` keys\n const columns: Record<string, string[]> = {};\n const tuples: [string, string][] = [];\n keys.forEach((key) => {\n const [columnId, id] = key.split(\"=\");\n getOrSet(columns, columnId, []).push(id);\n tuples.push([columnId, id]);\n });\n\n const alias = abbreviation(collection.joinTableName);\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: collection.joinTableName }],\n condition: {\n kind: \"exp\",\n op: \"or\",\n conditions: Object.entries(columns).map(([columnId, values]) => {\n // `otherMeta` is only optional because of enum m2ms (EnumCollections), which use their own\n // batch loader, so here it's always an entity-to-entity m2m and `otherMeta` is defined.\n const meta = collection.columnName == columnId ? collection.meta : collection.otherMeta!;\n return {\n kind: \"column\",\n alias,\n column: columnId,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: values.map((id) => keyToNumber(meta, id)!) },\n };\n }),\n },\n // Id-less join tables have no surrogate id to order by, so order by the FK columns instead.\n orderBys: collection.hasJoinTableId\n ? [{ alias, column: \"id\", order: \"ASC\" }]\n : [\n { alias, column: collection.columnName, order: \"ASC\" },\n { alias, column: collection.otherColumnName, order: \"ASC\" },\n ],\n };\n\n const rows = await em[\"executeFind\"](\n collection.otherMeta!,\n manyToManyLoadOperation,\n query,\n // No LIMIT needed for join rows\n { limit: undefined },\n );\n await joinRows.loadRows(tuples, rows);\n\n const api = getEmInternalApi(em);\n for (const [column, id] of tuples) {\n const entity = em.getEntity(id);\n if (!entity) continue;\n const others = joinRows.getOthers(column, entity) as U[];\n // Determine the field name from the column\n const fieldName = column === collection.columnName ? collection.fieldName : collection.otherFieldName!;\n api.setPreloadedRelation(entity.idTagged!, fieldName, others);\n }\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,0BAA0B;;AAGvC,SAAgB,sBAAsB,IAAmB,YAAiD;CACxG,OAAO,GAAG,eAAe,yBAAyB,WAAW,gBAAgB,SAAS,UAAU,YAAY,IAAI,CAAC;AACnH;AAEA,eAAe,UAA4B,YAA4B,MAA+B;CACpG,MAAM,EAAE,OAAO,WAAW;CAE1B,MAAM,WAAWA,sBAAAA,iBAAiB,EAAE,CAAC,CAAC,SAAS,UAAU;CAGzD,MAAM,UAAoC,CAAC;CAC3C,MAAM,SAA6B,CAAC;CACpC,KAAK,SAAS,QAAQ;EACpB,MAAM,CAAC,UAAU,MAAM,IAAI,MAAM,GAAG;EACpC,cAAA,SAAS,SAAS,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;EACvC,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;CAC5B,CAAC;CAED,MAAM,QAAQC,cAAAA,aAAa,WAAW,aAAa;CACnD,MAAM,QAAyB;EAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;EACxB,QAAQ,CAAC;GAAE;GAAO,MAAM;GAAW,OAAO,WAAW;EAAc,CAAC;EACpE,WAAW;GACT,MAAM;GACN,IAAI;GACJ,YAAY,OAAO,QAAQ,OAAO,CAAC,CAAC,KAAK,CAAC,UAAU,YAAY;IAG9D,MAAM,OAAO,WAAW,cAAc,WAAW,WAAW,OAAO,WAAW;IAC9E,OAAO;KACL,MAAM;KACN;KACA,QAAQ;KACR,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO,OAAO,KAAK,OAAOC,aAAAA,YAAY,MAAM,EAAE,CAAE;KAAE;IACxE;GACF,CAAC;EACH;EAEA,UAAU,WAAW,iBACjB,CAAC;GAAE;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC,IACtC,CACE;GAAE;GAAO,QAAQ,WAAW;GAAY,OAAO;EAAM,GACrD;GAAE;GAAO,QAAQ,WAAW;GAAiB,OAAO;EAAM,CAC5D;CACN;CAEA,MAAM,OAAO,MAAM,GAAG,cAAc,CAClC,WAAW,WACX,yBACA,OAEA,EAAE,OAAO,KAAA,EAAU,CACrB;CACA,MAAM,SAAS,SAAS,QAAQ,IAAI;CAEpC,MAAM,MAAMF,sBAAAA,iBAAiB,EAAE;CAC/B,KAAK,MAAM,CAAC,QAAQ,OAAO,QAAQ;EACjC,MAAM,SAAS,GAAG,UAAU,EAAE;EAC9B,IAAI,CAAC,QAAQ;EACb,MAAM,SAAS,SAAS,UAAU,QAAQ,MAAM;EAEhD,MAAM,YAAY,WAAW,WAAW,aAAa,WAAW,YAAY,WAAW;EACvF,IAAI,qBAAqB,OAAO,UAAW,WAAW,MAAM;CAC9D;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { BatchLoader } from "./BatchLoader.cjs";
2
- import { ManyToManyLike } from "../JoinRows.cjs";
2
+ import { ManyToManyLike } from "../flush/JoinRows.cjs";
3
3
  import "../index.cjs";
4
4
  import { EntityManager } from "../EntityManager.cjs";
5
5
  //#region src/batchloaders/manyToManyBatchLoader.d.ts
@@ -1,5 +1,5 @@
1
1
  import { BatchLoader } from "./BatchLoader.mjs";
2
- import { ManyToManyLike } from "../JoinRows.mjs";
2
+ import { ManyToManyLike } from "../flush/JoinRows.mjs";
3
3
  import "../index.mjs";
4
4
  import { EntityManager } from "../EntityManager.mjs";
5
5
  //#region src/batchloaders/manyToManyBatchLoader.d.ts
@@ -1,6 +1,6 @@
1
1
  import "./BatchLoader.js";
2
- import { abbreviation, getOrSet } from "../utils.js";
3
2
  import { keyToNumber } from "../keys.js";
3
+ import { abbreviation, getOrSet } from "../utils.js";
4
4
  import "../index.js";
5
5
  import { getEmInternalApi } from "../EntityManager.js";
6
6
  import "../Entity.js";
@@ -1 +1 @@
1
- {"version":3,"file":"manyToManyBatchLoader.js","names":[],"sources":["../../src/batchloaders/manyToManyBatchLoader.ts"],"sourcesContent":["import { type Entity } from \"../Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { type ManyToManyLike, type ParsedFindQuery, keyToNumber } from \"../index.ts\";\nimport { abbreviation, getOrSet } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const manyToManyLoadOperation = \"m2m-load\";\n\n/** Batches m2m.packages/core/src/relations/ReactiveManyToMany.tsload calls via BatchLoader. */\nexport function manyToManyBatchLoader(em: EntityManager, collection: ManyToManyLike): BatchLoader<string> {\n return em.getBatchLoader(manyToManyLoadOperation, collection.joinTableName, (keys) => loadBatch(collection, keys));\n}\n\nasync function loadBatch<U extends Entity>(collection: ManyToManyLike, keys: string[]): Promise<void> {\n const { em } = collection.entity;\n\n const joinRows = getEmInternalApi(em).joinRows(collection);\n\n // Break out `column_id=string` keys\n const columns: Record<string, string[]> = {};\n const tuples: [string, string][] = [];\n keys.forEach((key) => {\n const [columnId, id] = key.split(\"=\");\n getOrSet(columns, columnId, []).push(id);\n tuples.push([columnId, id]);\n });\n\n const alias = abbreviation(collection.joinTableName);\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: collection.joinTableName }],\n condition: {\n kind: \"exp\",\n op: \"or\",\n conditions: Object.entries(columns).map(([columnId, values]) => {\n // `otherMeta` is only optional because of enum m2ms (EnumCollections), which use their own\n // batch loader, so here it's always an entity-to-entity m2m and `otherMeta` is defined.\n const meta = collection.columnName == columnId ? collection.meta : collection.otherMeta!;\n return {\n kind: \"column\",\n alias,\n column: columnId,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: values.map((id) => keyToNumber(meta, id)!) },\n };\n }),\n },\n // Id-less join tables have no surrogate id to order by, so order by the FK columns instead.\n orderBys: collection.hasJoinTableId\n ? [{ alias, column: \"id\", order: \"ASC\" }]\n : [\n { alias, column: collection.columnName, order: \"ASC\" },\n { alias, column: collection.otherColumnName, order: \"ASC\" },\n ],\n };\n\n const rows = await em[\"executeFind\"](\n collection.otherMeta!,\n manyToManyLoadOperation,\n query,\n // No LIMIT needed for join rows\n { limit: undefined },\n );\n await joinRows.loadRows(tuples, rows);\n\n const api = getEmInternalApi(em);\n for (const [column, id] of tuples) {\n const entity = em.getEntity(id);\n if (!entity) continue;\n const others = joinRows.getOthers(column, entity) as U[];\n // Determine the field name from the column\n const fieldName = column === collection.columnName ? collection.fieldName : collection.otherFieldName!;\n api.setPreloadedRelation(entity.idTagged!, fieldName, others);\n }\n}\n"],"mappings":";;;;;;;AAMA,MAAa,0BAA0B;;AAGvC,SAAgB,sBAAsB,IAAmB,YAAiD;CACxG,OAAO,GAAG,eAAe,yBAAyB,WAAW,gBAAgB,SAAS,UAAU,YAAY,IAAI,CAAC;AACnH;AAEA,eAAe,UAA4B,YAA4B,MAA+B;CACpG,MAAM,EAAE,OAAO,WAAW;CAE1B,MAAM,WAAW,iBAAiB,EAAE,CAAC,CAAC,SAAS,UAAU;CAGzD,MAAM,UAAoC,CAAC;CAC3C,MAAM,SAA6B,CAAC;CACpC,KAAK,SAAS,QAAQ;EACpB,MAAM,CAAC,UAAU,MAAM,IAAI,MAAM,GAAG;EACpC,SAAS,SAAS,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;EACvC,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;CAC5B,CAAC;CAED,MAAM,QAAQ,aAAa,WAAW,aAAa;CACnD,MAAM,QAAyB;EAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;EACxB,QAAQ,CAAC;GAAE;GAAO,MAAM;GAAW,OAAO,WAAW;EAAc,CAAC;EACpE,WAAW;GACT,MAAM;GACN,IAAI;GACJ,YAAY,OAAO,QAAQ,OAAO,CAAC,CAAC,KAAK,CAAC,UAAU,YAAY;IAG9D,MAAM,OAAO,WAAW,cAAc,WAAW,WAAW,OAAO,WAAW;IAC9E,OAAO;KACL,MAAM;KACN;KACA,QAAQ;KACR,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO,OAAO,KAAK,OAAO,YAAY,MAAM,EAAE,CAAE;KAAE;IACxE;GACF,CAAC;EACH;EAEA,UAAU,WAAW,iBACjB,CAAC;GAAE;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC,IACtC,CACE;GAAE;GAAO,QAAQ,WAAW;GAAY,OAAO;EAAM,GACrD;GAAE;GAAO,QAAQ,WAAW;GAAiB,OAAO;EAAM,CAC5D;CACN;CAEA,MAAM,OAAO,MAAM,GAAG,cAAc,CAClC,WAAW,WACX,yBACA,OAEA,EAAE,OAAO,KAAA,EAAU,CACrB;CACA,MAAM,SAAS,SAAS,QAAQ,IAAI;CAEpC,MAAM,MAAM,iBAAiB,EAAE;CAC/B,KAAK,MAAM,CAAC,QAAQ,OAAO,QAAQ;EACjC,MAAM,SAAS,GAAG,UAAU,EAAE;EAC9B,IAAI,CAAC,QAAQ;EACb,MAAM,SAAS,SAAS,UAAU,QAAQ,MAAM;EAEhD,MAAM,YAAY,WAAW,WAAW,aAAa,WAAW,YAAY,WAAW;EACvF,IAAI,qBAAqB,OAAO,UAAW,WAAW,MAAM;CAC9D;AACF"}
1
+ {"version":3,"file":"manyToManyBatchLoader.js","names":[],"sources":["../../src/batchloaders/manyToManyBatchLoader.ts"],"sourcesContent":["import { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type Entity } from \"src/Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { type ManyToManyLike, type ParsedFindQuery, keyToNumber } from \"src/index.ts\";\nimport { abbreviation, getOrSet } from \"src/utils.ts\";\n\nexport const manyToManyLoadOperation = \"m2m-load\";\n\n/** Batches m2m.packages/core/src/relations/ReactiveManyToMany.tsload calls via BatchLoader. */\nexport function manyToManyBatchLoader(em: EntityManager, collection: ManyToManyLike): BatchLoader<string> {\n return em.getBatchLoader(manyToManyLoadOperation, collection.joinTableName, (keys) => loadBatch(collection, keys));\n}\n\nasync function loadBatch<U extends Entity>(collection: ManyToManyLike, keys: string[]): Promise<void> {\n const { em } = collection.entity;\n\n const joinRows = getEmInternalApi(em).joinRows(collection);\n\n // Break out `column_id=string` keys\n const columns: Record<string, string[]> = {};\n const tuples: [string, string][] = [];\n keys.forEach((key) => {\n const [columnId, id] = key.split(\"=\");\n getOrSet(columns, columnId, []).push(id);\n tuples.push([columnId, id]);\n });\n\n const alias = abbreviation(collection.joinTableName);\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: collection.joinTableName }],\n condition: {\n kind: \"exp\",\n op: \"or\",\n conditions: Object.entries(columns).map(([columnId, values]) => {\n // `otherMeta` is only optional because of enum m2ms (EnumCollections), which use their own\n // batch loader, so here it's always an entity-to-entity m2m and `otherMeta` is defined.\n const meta = collection.columnName == columnId ? collection.meta : collection.otherMeta!;\n return {\n kind: \"column\",\n alias,\n column: columnId,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: values.map((id) => keyToNumber(meta, id)!) },\n };\n }),\n },\n // Id-less join tables have no surrogate id to order by, so order by the FK columns instead.\n orderBys: collection.hasJoinTableId\n ? [{ alias, column: \"id\", order: \"ASC\" }]\n : [\n { alias, column: collection.columnName, order: \"ASC\" },\n { alias, column: collection.otherColumnName, order: \"ASC\" },\n ],\n };\n\n const rows = await em[\"executeFind\"](\n collection.otherMeta!,\n manyToManyLoadOperation,\n query,\n // No LIMIT needed for join rows\n { limit: undefined },\n );\n await joinRows.loadRows(tuples, rows);\n\n const api = getEmInternalApi(em);\n for (const [column, id] of tuples) {\n const entity = em.getEntity(id);\n if (!entity) continue;\n const others = joinRows.getOthers(column, entity) as U[];\n // Determine the field name from the column\n const fieldName = column === collection.columnName ? collection.fieldName : collection.otherFieldName!;\n api.setPreloadedRelation(entity.idTagged!, fieldName, others);\n }\n}\n"],"mappings":";;;;;;;AAMA,MAAa,0BAA0B;;AAGvC,SAAgB,sBAAsB,IAAmB,YAAiD;CACxG,OAAO,GAAG,eAAe,yBAAyB,WAAW,gBAAgB,SAAS,UAAU,YAAY,IAAI,CAAC;AACnH;AAEA,eAAe,UAA4B,YAA4B,MAA+B;CACpG,MAAM,EAAE,OAAO,WAAW;CAE1B,MAAM,WAAW,iBAAiB,EAAE,CAAC,CAAC,SAAS,UAAU;CAGzD,MAAM,UAAoC,CAAC;CAC3C,MAAM,SAA6B,CAAC;CACpC,KAAK,SAAS,QAAQ;EACpB,MAAM,CAAC,UAAU,MAAM,IAAI,MAAM,GAAG;EACpC,SAAS,SAAS,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE;EACvC,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;CAC5B,CAAC;CAED,MAAM,QAAQ,aAAa,WAAW,aAAa;CACnD,MAAM,QAAyB;EAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;EACxB,QAAQ,CAAC;GAAE;GAAO,MAAM;GAAW,OAAO,WAAW;EAAc,CAAC;EACpE,WAAW;GACT,MAAM;GACN,IAAI;GACJ,YAAY,OAAO,QAAQ,OAAO,CAAC,CAAC,KAAK,CAAC,UAAU,YAAY;IAG9D,MAAM,OAAO,WAAW,cAAc,WAAW,WAAW,OAAO,WAAW;IAC9E,OAAO;KACL,MAAM;KACN;KACA,QAAQ;KACR,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO,OAAO,KAAK,OAAO,YAAY,MAAM,EAAE,CAAE;KAAE;IACxE;GACF,CAAC;EACH;EAEA,UAAU,WAAW,iBACjB,CAAC;GAAE;GAAO,QAAQ;GAAM,OAAO;EAAM,CAAC,IACtC,CACE;GAAE;GAAO,QAAQ,WAAW;GAAY,OAAO;EAAM,GACrD;GAAE;GAAO,QAAQ,WAAW;GAAiB,OAAO;EAAM,CAC5D;CACN;CAEA,MAAM,OAAO,MAAM,GAAG,cAAc,CAClC,WAAW,WACX,yBACA,OAEA,EAAE,OAAO,KAAA,EAAU,CACrB;CACA,MAAM,SAAS,SAAS,QAAQ,IAAI;CAEpC,MAAM,MAAM,iBAAiB,EAAE;CAC/B,KAAK,MAAM,CAAC,QAAQ,OAAO,QAAQ;EACjC,MAAM,SAAS,GAAG,UAAU,EAAE;EAC9B,IAAI,CAAC,QAAQ;EACb,MAAM,SAAS,SAAS,UAAU,QAAQ,MAAM;EAEhD,MAAM,YAAY,WAAW,WAAW,aAAa,WAAW,YAAY,WAAW;EACvF,IAAI,qBAAqB,OAAO,UAAW,WAAW,MAAM;CAC9D;AACF"}
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./BatchLoader.cjs");
3
3
  const require_fields = require("../fields.cjs");
4
+ const require_keys = require("../keys.cjs");
4
5
  const require_queries_find_QueryParser = require("../queries/find/QueryParser.cjs");
5
6
  const require_utils = require("../utils.cjs");
6
- const require_keys = require("../keys.cjs");
7
7
  require("../index.cjs");
8
8
  const require_EntityManager = require("../EntityManager.cjs");
9
9
  require("../Entity.cjs");
@@ -1 +1 @@
1
- {"version":3,"file":"oneToManyBatchLoader.cjs","names":["deTagIds","abbreviation","groupBy","maybeResolveReferenceToId","getField","getEmInternalApi"],"sources":["../../src/batchloaders/oneToManyBatchLoader.ts"],"sourcesContent":["import { type Entity } from \"../Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { getField } from \"../fields.ts\";\nimport {\n type OneToManyCollection,\n type OneToManyField,\n type ParsedFindQuery,\n addTablePerClassJoinsAndClassTag,\n assertIdsAreTagged,\n deTagIds,\n maybeResolveReferenceToId,\n} from \"../index.ts\";\nimport { abbreviation, groupBy } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const oneToManyLoadOperation = \"o2m-load\";\n\nexport function oneToManyBatchLoader<T extends Entity, U extends Entity>(\n em: EntityManager,\n collection: OneToManyCollection<T, U>,\n): BatchLoader<string> {\n const { meta: oneMeta, fieldName } = collection;\n const batchKey = `${oneMeta.tableName}-${fieldName}`;\n return em.getBatchLoader(oneToManyLoadOperation, batchKey, async (_keys) => {\n const { otherMeta: meta } = collection;\n\n assertIdsAreTagged(_keys);\n const keys = deTagIds(oneMeta, _keys);\n\n const alias = abbreviation(meta.tableName);\n const o2m = oneMeta.allFields[collection.fieldName] as OneToManyField;\n const other = meta.allFields[collection.otherFieldName];\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: meta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias: `${alias}${other.aliasSuffix}`,\n column: o2m.otherColumnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys },\n },\n ],\n },\n orderBys: [{ alias, column: \"id\", order: \"ASC\" }],\n };\n\n addTablePerClassJoinsAndClassTag(query, meta, alias, true);\n\n const rowData = await em[\"executeFindRowData\"](meta, oneToManyLoadOperation, query, {});\n const entities = em[\"hydrateAndFinalize\"](meta.cstr, rowData);\n\n const entitiesById = groupBy(entities, (entity) => {\n const ownerId = maybeResolveReferenceToId(getField(entity, collection.otherFieldName));\n return ownerId ?? \"dummyNoLongerOwned\";\n });\n\n const api = getEmInternalApi(em);\n for (const key of _keys) {\n api.setPreloadedRelation(key, fieldName, entitiesById.get(key) || []);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAeA,MAAa,yBAAyB;AAEtC,SAAgB,qBACd,IACA,YACqB;CACrB,MAAM,EAAE,MAAM,SAAS,cAAc;CACrC,MAAM,WAAW,GAAG,QAAQ,UAAU,GAAG;CACzC,OAAO,GAAG,eAAe,wBAAwB,UAAU,OAAO,UAAU;EAC1E,MAAM,EAAE,WAAW,SAAS;EAE5B,aAAA,mBAAmB,KAAK;EACxB,MAAM,OAAOA,aAAAA,SAAS,SAAS,KAAK;EAEpC,MAAM,QAAQC,cAAAA,aAAa,KAAK,SAAS;EACzC,MAAM,MAAM,QAAQ,UAAU,WAAW;EACzC,MAAM,QAAQ,KAAK,UAAU,WAAW;EACxC,MAAM,QAAyB;GAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;GACxB,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,KAAK;GAAU,CAAC;GAC1D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CACV;KACE,MAAM;KACN,OAAO,GAAG,QAAQ,MAAM;KACxB,QAAQ,IAAI;KACZ,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAClC,CACF;GACF;GACA,UAAU,CAAC;IAAE;IAAO,QAAQ;IAAM,OAAO;GAAM,CAAC;EAClD;EAEA,iCAAA,iCAAiC,OAAO,MAAM,OAAO,IAAI;EAEzD,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,MAAM,wBAAwB,OAAO,CAAC,CAAC;EACtF,MAAM,WAAW,GAAG,qBAAqB,CAAC,KAAK,MAAM,OAAO;EAE5D,MAAM,eAAeC,cAAAA,QAAQ,WAAW,WAAW;GAEjD,OADgBC,aAAAA,0BAA0BC,eAAAA,SAAS,QAAQ,WAAW,cAAc,CACvE,KAAK;EACpB,CAAC;EAED,MAAM,MAAMC,sBAAAA,iBAAiB,EAAE;EAC/B,KAAK,MAAM,OAAO,OAChB,IAAI,qBAAqB,KAAK,WAAW,aAAa,IAAI,GAAG,KAAK,CAAC,CAAC;CAExE,CAAC;AACH"}
1
+ {"version":3,"file":"oneToManyBatchLoader.cjs","names":["deTagIds","abbreviation","groupBy","maybeResolveReferenceToId","getField","getEmInternalApi"],"sources":["../../src/batchloaders/oneToManyBatchLoader.ts"],"sourcesContent":["import { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type Entity } from \"src/Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { getField } from \"src/fields.ts\";\nimport {\n type OneToManyCollection,\n type OneToManyField,\n type ParsedFindQuery,\n addTablePerClassJoinsAndClassTag,\n assertIdsAreTagged,\n deTagIds,\n maybeResolveReferenceToId,\n} from \"src/index.ts\";\nimport { abbreviation, groupBy } from \"src/utils.ts\";\n\nexport const oneToManyLoadOperation = \"o2m-load\";\n\nexport function oneToManyBatchLoader<T extends Entity, U extends Entity>(\n em: EntityManager,\n collection: OneToManyCollection<T, U>,\n): BatchLoader<string> {\n const { meta: oneMeta, fieldName } = collection;\n const batchKey = `${oneMeta.tableName}-${fieldName}`;\n return em.getBatchLoader(oneToManyLoadOperation, batchKey, async (_keys) => {\n const { otherMeta: meta } = collection;\n\n assertIdsAreTagged(_keys);\n const keys = deTagIds(oneMeta, _keys);\n\n const alias = abbreviation(meta.tableName);\n const o2m = oneMeta.allFields[collection.fieldName] as OneToManyField;\n const other = meta.allFields[collection.otherFieldName];\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: meta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias: `${alias}${other.aliasSuffix}`,\n column: o2m.otherColumnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys },\n },\n ],\n },\n orderBys: [{ alias, column: \"id\", order: \"ASC\" }],\n };\n\n addTablePerClassJoinsAndClassTag(query, meta, alias, true);\n\n const rowData = await em[\"executeFindRowData\"](meta, oneToManyLoadOperation, query, {});\n const entities = em[\"hydrateAndFinalize\"](meta.cstr, rowData);\n\n const entitiesById = groupBy(entities, (entity) => {\n const ownerId = maybeResolveReferenceToId(getField(entity, collection.otherFieldName));\n return ownerId ?? \"dummyNoLongerOwned\";\n });\n\n const api = getEmInternalApi(em);\n for (const key of _keys) {\n api.setPreloadedRelation(key, fieldName, entitiesById.get(key) || []);\n }\n });\n}\n"],"mappings":";;;;;;;;;;AAeA,MAAa,yBAAyB;AAEtC,SAAgB,qBACd,IACA,YACqB;CACrB,MAAM,EAAE,MAAM,SAAS,cAAc;CACrC,MAAM,WAAW,GAAG,QAAQ,UAAU,GAAG;CACzC,OAAO,GAAG,eAAe,wBAAwB,UAAU,OAAO,UAAU;EAC1E,MAAM,EAAE,WAAW,SAAS;EAE5B,aAAA,mBAAmB,KAAK;EACxB,MAAM,OAAOA,aAAAA,SAAS,SAAS,KAAK;EAEpC,MAAM,QAAQC,cAAAA,aAAa,KAAK,SAAS;EACzC,MAAM,MAAM,QAAQ,UAAU,WAAW;EACzC,MAAM,QAAQ,KAAK,UAAU,WAAW;EACxC,MAAM,QAAyB;GAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;GACxB,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,KAAK;GAAU,CAAC;GAC1D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CACV;KACE,MAAM;KACN,OAAO,GAAG,QAAQ,MAAM;KACxB,QAAQ,IAAI;KACZ,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAClC,CACF;GACF;GACA,UAAU,CAAC;IAAE;IAAO,QAAQ;IAAM,OAAO;GAAM,CAAC;EAClD;EAEA,iCAAA,iCAAiC,OAAO,MAAM,OAAO,IAAI;EAEzD,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,MAAM,wBAAwB,OAAO,CAAC,CAAC;EACtF,MAAM,WAAW,GAAG,qBAAqB,CAAC,KAAK,MAAM,OAAO;EAE5D,MAAM,eAAeC,cAAAA,QAAQ,WAAW,WAAW;GAEjD,OADgBC,aAAAA,0BAA0BC,eAAAA,SAAS,QAAQ,WAAW,cAAc,CACvE,KAAK;EACpB,CAAC;EAED,MAAM,MAAMC,sBAAAA,iBAAiB,EAAE;EAC/B,KAAK,MAAM,OAAO,OAChB,IAAI,qBAAqB,KAAK,WAAW,aAAa,IAAI,GAAG,KAAK,CAAC,CAAC;CAExE,CAAC;AACH"}
@@ -1,8 +1,8 @@
1
1
  import "./BatchLoader.js";
2
2
  import { getField } from "../fields.js";
3
+ import { assertIdsAreTagged, deTagIds, maybeResolveReferenceToId } from "../keys.js";
3
4
  import { addTablePerClassJoinsAndClassTag } from "../queries/find/QueryParser.js";
4
5
  import { abbreviation, groupBy } from "../utils.js";
5
- import { assertIdsAreTagged, deTagIds, maybeResolveReferenceToId } from "../keys.js";
6
6
  import "../index.js";
7
7
  import { getEmInternalApi } from "../EntityManager.js";
8
8
  import "../Entity.js";
@@ -1 +1 @@
1
- {"version":3,"file":"oneToManyBatchLoader.js","names":[],"sources":["../../src/batchloaders/oneToManyBatchLoader.ts"],"sourcesContent":["import { type Entity } from \"../Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { getField } from \"../fields.ts\";\nimport {\n type OneToManyCollection,\n type OneToManyField,\n type ParsedFindQuery,\n addTablePerClassJoinsAndClassTag,\n assertIdsAreTagged,\n deTagIds,\n maybeResolveReferenceToId,\n} from \"../index.ts\";\nimport { abbreviation, groupBy } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const oneToManyLoadOperation = \"o2m-load\";\n\nexport function oneToManyBatchLoader<T extends Entity, U extends Entity>(\n em: EntityManager,\n collection: OneToManyCollection<T, U>,\n): BatchLoader<string> {\n const { meta: oneMeta, fieldName } = collection;\n const batchKey = `${oneMeta.tableName}-${fieldName}`;\n return em.getBatchLoader(oneToManyLoadOperation, batchKey, async (_keys) => {\n const { otherMeta: meta } = collection;\n\n assertIdsAreTagged(_keys);\n const keys = deTagIds(oneMeta, _keys);\n\n const alias = abbreviation(meta.tableName);\n const o2m = oneMeta.allFields[collection.fieldName] as OneToManyField;\n const other = meta.allFields[collection.otherFieldName];\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: meta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias: `${alias}${other.aliasSuffix}`,\n column: o2m.otherColumnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys },\n },\n ],\n },\n orderBys: [{ alias, column: \"id\", order: \"ASC\" }],\n };\n\n addTablePerClassJoinsAndClassTag(query, meta, alias, true);\n\n const rowData = await em[\"executeFindRowData\"](meta, oneToManyLoadOperation, query, {});\n const entities = em[\"hydrateAndFinalize\"](meta.cstr, rowData);\n\n const entitiesById = groupBy(entities, (entity) => {\n const ownerId = maybeResolveReferenceToId(getField(entity, collection.otherFieldName));\n return ownerId ?? \"dummyNoLongerOwned\";\n });\n\n const api = getEmInternalApi(em);\n for (const key of _keys) {\n api.setPreloadedRelation(key, fieldName, entitiesById.get(key) || []);\n }\n });\n}\n"],"mappings":";;;;;;;;;AAeA,MAAa,yBAAyB;AAEtC,SAAgB,qBACd,IACA,YACqB;CACrB,MAAM,EAAE,MAAM,SAAS,cAAc;CACrC,MAAM,WAAW,GAAG,QAAQ,UAAU,GAAG;CACzC,OAAO,GAAG,eAAe,wBAAwB,UAAU,OAAO,UAAU;EAC1E,MAAM,EAAE,WAAW,SAAS;EAE5B,mBAAmB,KAAK;EACxB,MAAM,OAAO,SAAS,SAAS,KAAK;EAEpC,MAAM,QAAQ,aAAa,KAAK,SAAS;EACzC,MAAM,MAAM,QAAQ,UAAU,WAAW;EACzC,MAAM,QAAQ,KAAK,UAAU,WAAW;EACxC,MAAM,QAAyB;GAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;GACxB,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,KAAK;GAAU,CAAC;GAC1D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CACV;KACE,MAAM;KACN,OAAO,GAAG,QAAQ,MAAM;KACxB,QAAQ,IAAI;KACZ,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAClC,CACF;GACF;GACA,UAAU,CAAC;IAAE;IAAO,QAAQ;IAAM,OAAO;GAAM,CAAC;EAClD;EAEA,iCAAiC,OAAO,MAAM,OAAO,IAAI;EAEzD,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,MAAM,wBAAwB,OAAO,CAAC,CAAC;EACtF,MAAM,WAAW,GAAG,qBAAqB,CAAC,KAAK,MAAM,OAAO;EAE5D,MAAM,eAAe,QAAQ,WAAW,WAAW;GAEjD,OADgB,0BAA0B,SAAS,QAAQ,WAAW,cAAc,CACvE,KAAK;EACpB,CAAC;EAED,MAAM,MAAM,iBAAiB,EAAE;EAC/B,KAAK,MAAM,OAAO,OAChB,IAAI,qBAAqB,KAAK,WAAW,aAAa,IAAI,GAAG,KAAK,CAAC,CAAC;CAExE,CAAC;AACH"}
1
+ {"version":3,"file":"oneToManyBatchLoader.js","names":[],"sources":["../../src/batchloaders/oneToManyBatchLoader.ts"],"sourcesContent":["import { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type Entity } from \"src/Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { getField } from \"src/fields.ts\";\nimport {\n type OneToManyCollection,\n type OneToManyField,\n type ParsedFindQuery,\n addTablePerClassJoinsAndClassTag,\n assertIdsAreTagged,\n deTagIds,\n maybeResolveReferenceToId,\n} from \"src/index.ts\";\nimport { abbreviation, groupBy } from \"src/utils.ts\";\n\nexport const oneToManyLoadOperation = \"o2m-load\";\n\nexport function oneToManyBatchLoader<T extends Entity, U extends Entity>(\n em: EntityManager,\n collection: OneToManyCollection<T, U>,\n): BatchLoader<string> {\n const { meta: oneMeta, fieldName } = collection;\n const batchKey = `${oneMeta.tableName}-${fieldName}`;\n return em.getBatchLoader(oneToManyLoadOperation, batchKey, async (_keys) => {\n const { otherMeta: meta } = collection;\n\n assertIdsAreTagged(_keys);\n const keys = deTagIds(oneMeta, _keys);\n\n const alias = abbreviation(meta.tableName);\n const o2m = oneMeta.allFields[collection.fieldName] as OneToManyField;\n const other = meta.allFields[collection.otherFieldName];\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: meta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias: `${alias}${other.aliasSuffix}`,\n column: o2m.otherColumnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys },\n },\n ],\n },\n orderBys: [{ alias, column: \"id\", order: \"ASC\" }],\n };\n\n addTablePerClassJoinsAndClassTag(query, meta, alias, true);\n\n const rowData = await em[\"executeFindRowData\"](meta, oneToManyLoadOperation, query, {});\n const entities = em[\"hydrateAndFinalize\"](meta.cstr, rowData);\n\n const entitiesById = groupBy(entities, (entity) => {\n const ownerId = maybeResolveReferenceToId(getField(entity, collection.otherFieldName));\n return ownerId ?? \"dummyNoLongerOwned\";\n });\n\n const api = getEmInternalApi(em);\n for (const key of _keys) {\n api.setPreloadedRelation(key, fieldName, entitiesById.get(key) || []);\n }\n });\n}\n"],"mappings":";;;;;;;;;AAeA,MAAa,yBAAyB;AAEtC,SAAgB,qBACd,IACA,YACqB;CACrB,MAAM,EAAE,MAAM,SAAS,cAAc;CACrC,MAAM,WAAW,GAAG,QAAQ,UAAU,GAAG;CACzC,OAAO,GAAG,eAAe,wBAAwB,UAAU,OAAO,UAAU;EAC1E,MAAM,EAAE,WAAW,SAAS;EAE5B,mBAAmB,KAAK;EACxB,MAAM,OAAO,SAAS,SAAS,KAAK;EAEpC,MAAM,QAAQ,aAAa,KAAK,SAAS;EACzC,MAAM,MAAM,QAAQ,UAAU,WAAW;EACzC,MAAM,QAAQ,KAAK,UAAU,WAAW;EACxC,MAAM,QAAyB;GAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;GACxB,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,KAAK;GAAU,CAAC;GAC1D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CACV;KACE,MAAM;KACN,OAAO,GAAG,QAAQ,MAAM;KACxB,QAAQ,IAAI;KACZ,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAClC,CACF;GACF;GACA,UAAU,CAAC;IAAE;IAAO,QAAQ;IAAM,OAAO;GAAM,CAAC;EAClD;EAEA,iCAAiC,OAAO,MAAM,OAAO,IAAI;EAEzD,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,MAAM,wBAAwB,OAAO,CAAC,CAAC;EACtF,MAAM,WAAW,GAAG,qBAAqB,CAAC,KAAK,MAAM,OAAO;EAE5D,MAAM,eAAe,QAAQ,WAAW,WAAW;GAEjD,OADgB,0BAA0B,SAAS,QAAQ,WAAW,cAAc,CACvE,KAAK;EACpB,CAAC;EAED,MAAM,MAAM,iBAAiB,EAAE;EAC/B,KAAK,MAAM,OAAO,OAChB,IAAI,qBAAqB,KAAK,WAAW,aAAa,IAAI,GAAG,KAAK,CAAC,CAAC;CAExE,CAAC;AACH"}
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./BatchLoader.cjs");
3
3
  const require_fields = require("../fields.cjs");
4
+ const require_keys = require("../keys.cjs");
4
5
  const require_queries_find_QueryParser = require("../queries/find/QueryParser.cjs");
5
6
  require("../relations/OneToOneReference.cjs");
6
7
  const require_utils = require("../utils.cjs");
7
- const require_keys = require("../keys.cjs");
8
8
  const require_EntityMetadata = require("../EntityMetadata.cjs");
9
9
  require("../index.cjs");
10
10
  const require_EntityManager = require("../EntityManager.cjs");
@@ -1 +1 @@
1
- {"version":3,"file":"oneToOneBatchLoader.cjs","names":["getMetadata","deTagIds","abbreviation","groupBy","maybeResolveReferenceToId","getField","getEmInternalApi"],"sources":["../../src/batchloaders/oneToOneBatchLoader.ts"],"sourcesContent":["import { type Entity } from \"../Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { type OneToOneField, getMetadata } from \"../EntityMetadata.ts\";\nimport { getField } from \"../fields.ts\";\nimport {\n type ParsedFindQuery,\n addTablePerClassJoinsAndClassTag,\n assertIdsAreTagged,\n deTagIds,\n maybeResolveReferenceToId,\n} from \"../index.ts\";\nimport { type OneToOneReferenceImpl } from \"../relations/OneToOneReference.ts\";\nimport { abbreviation, groupBy } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const oneToOneLoadOperation = \"o2o-load\";\n\nexport function oneToOneBatchLoader<T extends Entity, U extends Entity>(\n em: EntityManager,\n reference: OneToOneReferenceImpl<T, U>,\n): BatchLoader<string> {\n const meta = getMetadata(reference.entity);\n const batchKey = `${meta.tableName}-${reference.fieldName}`;\n return em.getBatchLoader(oneToOneLoadOperation, batchKey, async (_keys) => {\n const { otherMeta, otherFieldName } = reference;\n\n assertIdsAreTagged(_keys);\n const keys = deTagIds(meta, _keys);\n\n const alias = abbreviation(otherMeta.tableName);\n const o2o = meta.allFields[reference.fieldName] as OneToOneField;\n const other = otherMeta.allFields[reference.otherFieldName];\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: otherMeta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias: `${alias}${other.aliasSuffix}`,\n column: o2o.otherColumnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys },\n },\n ],\n },\n orderBys: [],\n };\n addTablePerClassJoinsAndClassTag(query, otherMeta, alias, true);\n\n const rowData = await em[\"executeFindRowData\"](otherMeta, oneToOneLoadOperation, query, {});\n const entities = em[\"hydrateAndFinalize\"](otherMeta.cstr, rowData);\n\n const entitiesByOtherId = groupBy(entities, (entity) => {\n const ownerId = maybeResolveReferenceToId(getField(entity, otherFieldName));\n return ownerId ?? \"dummyNoLongerOwned\";\n });\n\n const api = getEmInternalApi(em);\n for (const key of _keys) {\n const found = entitiesByOtherId.get(key);\n api.setPreloadedRelation(key, reference.fieldName as string, found ? [found[0]] : []);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,wBAAwB;AAErC,SAAgB,oBACd,IACA,WACqB;CACrB,MAAM,OAAOA,uBAAAA,YAAY,UAAU,MAAM;CACzC,MAAM,WAAW,GAAG,KAAK,UAAU,GAAG,UAAU;CAChD,OAAO,GAAG,eAAe,uBAAuB,UAAU,OAAO,UAAU;EACzE,MAAM,EAAE,WAAW,mBAAmB;EAEtC,aAAA,mBAAmB,KAAK;EACxB,MAAM,OAAOC,aAAAA,SAAS,MAAM,KAAK;EAEjC,MAAM,QAAQC,cAAAA,aAAa,UAAU,SAAS;EAC9C,MAAM,MAAM,KAAK,UAAU,UAAU;EACrC,MAAM,QAAQ,UAAU,UAAU,UAAU;EAC5C,MAAM,QAAyB;GAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;GACxB,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,UAAU;GAAU,CAAC;GAC/D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CACV;KACE,MAAM;KACN,OAAO,GAAG,QAAQ,MAAM;KACxB,QAAQ,IAAI;KACZ,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAClC,CACF;GACF;GACA,UAAU,CAAC;EACb;EACA,iCAAA,iCAAiC,OAAO,WAAW,OAAO,IAAI;EAE9D,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,WAAW,uBAAuB,OAAO,CAAC,CAAC;EAC1F,MAAM,WAAW,GAAG,qBAAqB,CAAC,UAAU,MAAM,OAAO;EAEjE,MAAM,oBAAoBC,cAAAA,QAAQ,WAAW,WAAW;GAEtD,OADgBC,aAAAA,0BAA0BC,eAAAA,SAAS,QAAQ,cAAc,CAC5D,KAAK;EACpB,CAAC;EAED,MAAM,MAAMC,sBAAAA,iBAAiB,EAAE;EAC/B,KAAK,MAAM,OAAO,OAAO;GACvB,MAAM,QAAQ,kBAAkB,IAAI,GAAG;GACvC,IAAI,qBAAqB,KAAK,UAAU,WAAqB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;EACtF;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"oneToOneBatchLoader.cjs","names":["getMetadata","deTagIds","abbreviation","groupBy","maybeResolveReferenceToId","getField","getEmInternalApi"],"sources":["../../src/batchloaders/oneToOneBatchLoader.ts"],"sourcesContent":["import { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type Entity } from \"src/Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { type OneToOneField, getMetadata } from \"src/EntityMetadata.ts\";\nimport { getField } from \"src/fields.ts\";\nimport {\n type ParsedFindQuery,\n addTablePerClassJoinsAndClassTag,\n assertIdsAreTagged,\n deTagIds,\n maybeResolveReferenceToId,\n} from \"src/index.ts\";\nimport { type OneToOneReferenceImpl } from \"src/relations/OneToOneReference.ts\";\nimport { abbreviation, groupBy } from \"src/utils.ts\";\n\nexport const oneToOneLoadOperation = \"o2o-load\";\n\nexport function oneToOneBatchLoader<T extends Entity, U extends Entity>(\n em: EntityManager,\n reference: OneToOneReferenceImpl<T, U>,\n): BatchLoader<string> {\n const meta = getMetadata(reference.entity);\n const batchKey = `${meta.tableName}-${reference.fieldName}`;\n return em.getBatchLoader(oneToOneLoadOperation, batchKey, async (_keys) => {\n const { otherMeta, otherFieldName } = reference;\n\n assertIdsAreTagged(_keys);\n const keys = deTagIds(meta, _keys);\n\n const alias = abbreviation(otherMeta.tableName);\n const o2o = meta.allFields[reference.fieldName] as OneToOneField;\n const other = otherMeta.allFields[reference.otherFieldName];\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: otherMeta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias: `${alias}${other.aliasSuffix}`,\n column: o2o.otherColumnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys },\n },\n ],\n },\n orderBys: [],\n };\n addTablePerClassJoinsAndClassTag(query, otherMeta, alias, true);\n\n const rowData = await em[\"executeFindRowData\"](otherMeta, oneToOneLoadOperation, query, {});\n const entities = em[\"hydrateAndFinalize\"](otherMeta.cstr, rowData);\n\n const entitiesByOtherId = groupBy(entities, (entity) => {\n const ownerId = maybeResolveReferenceToId(getField(entity, otherFieldName));\n return ownerId ?? \"dummyNoLongerOwned\";\n });\n\n const api = getEmInternalApi(em);\n for (const key of _keys) {\n const found = entitiesByOtherId.get(key);\n api.setPreloadedRelation(key, reference.fieldName as string, found ? [found[0]] : []);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,wBAAwB;AAErC,SAAgB,oBACd,IACA,WACqB;CACrB,MAAM,OAAOA,uBAAAA,YAAY,UAAU,MAAM;CACzC,MAAM,WAAW,GAAG,KAAK,UAAU,GAAG,UAAU;CAChD,OAAO,GAAG,eAAe,uBAAuB,UAAU,OAAO,UAAU;EACzE,MAAM,EAAE,WAAW,mBAAmB;EAEtC,aAAA,mBAAmB,KAAK;EACxB,MAAM,OAAOC,aAAAA,SAAS,MAAM,KAAK;EAEjC,MAAM,QAAQC,cAAAA,aAAa,UAAU,SAAS;EAC9C,MAAM,MAAM,KAAK,UAAU,UAAU;EACrC,MAAM,QAAQ,UAAU,UAAU,UAAU;EAC5C,MAAM,QAAyB;GAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;GACxB,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,UAAU;GAAU,CAAC;GAC/D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CACV;KACE,MAAM;KACN,OAAO,GAAG,QAAQ,MAAM;KACxB,QAAQ,IAAI;KACZ,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAClC,CACF;GACF;GACA,UAAU,CAAC;EACb;EACA,iCAAA,iCAAiC,OAAO,WAAW,OAAO,IAAI;EAE9D,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,WAAW,uBAAuB,OAAO,CAAC,CAAC;EAC1F,MAAM,WAAW,GAAG,qBAAqB,CAAC,UAAU,MAAM,OAAO;EAEjE,MAAM,oBAAoBC,cAAAA,QAAQ,WAAW,WAAW;GAEtD,OADgBC,aAAAA,0BAA0BC,eAAAA,SAAS,QAAQ,cAAc,CAC5D,KAAK;EACpB,CAAC;EAED,MAAM,MAAMC,sBAAAA,iBAAiB,EAAE;EAC/B,KAAK,MAAM,OAAO,OAAO;GACvB,MAAM,QAAQ,kBAAkB,IAAI,GAAG;GACvC,IAAI,qBAAqB,KAAK,UAAU,WAAqB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;EACtF;CACF,CAAC;AACH"}
@@ -1,9 +1,9 @@
1
1
  import "./BatchLoader.js";
2
2
  import { getField } from "../fields.js";
3
+ import { assertIdsAreTagged, deTagIds, maybeResolveReferenceToId } from "../keys.js";
3
4
  import { addTablePerClassJoinsAndClassTag } from "../queries/find/QueryParser.js";
4
5
  import "../relations/OneToOneReference.js";
5
6
  import { abbreviation, groupBy } from "../utils.js";
6
- import { assertIdsAreTagged, deTagIds, maybeResolveReferenceToId } from "../keys.js";
7
7
  import { getMetadata } from "../EntityMetadata.js";
8
8
  import "../index.js";
9
9
  import { getEmInternalApi } from "../EntityManager.js";
@@ -1 +1 @@
1
- {"version":3,"file":"oneToOneBatchLoader.js","names":[],"sources":["../../src/batchloaders/oneToOneBatchLoader.ts"],"sourcesContent":["import { type Entity } from \"../Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"../EntityManager.ts\";\nimport { type OneToOneField, getMetadata } from \"../EntityMetadata.ts\";\nimport { getField } from \"../fields.ts\";\nimport {\n type ParsedFindQuery,\n addTablePerClassJoinsAndClassTag,\n assertIdsAreTagged,\n deTagIds,\n maybeResolveReferenceToId,\n} from \"../index.ts\";\nimport { type OneToOneReferenceImpl } from \"../relations/OneToOneReference.ts\";\nimport { abbreviation, groupBy } from \"../utils.ts\";\nimport { type BatchLoader } from \"./BatchLoader.ts\";\n\nexport const oneToOneLoadOperation = \"o2o-load\";\n\nexport function oneToOneBatchLoader<T extends Entity, U extends Entity>(\n em: EntityManager,\n reference: OneToOneReferenceImpl<T, U>,\n): BatchLoader<string> {\n const meta = getMetadata(reference.entity);\n const batchKey = `${meta.tableName}-${reference.fieldName}`;\n return em.getBatchLoader(oneToOneLoadOperation, batchKey, async (_keys) => {\n const { otherMeta, otherFieldName } = reference;\n\n assertIdsAreTagged(_keys);\n const keys = deTagIds(meta, _keys);\n\n const alias = abbreviation(otherMeta.tableName);\n const o2o = meta.allFields[reference.fieldName] as OneToOneField;\n const other = otherMeta.allFields[reference.otherFieldName];\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: otherMeta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias: `${alias}${other.aliasSuffix}`,\n column: o2o.otherColumnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys },\n },\n ],\n },\n orderBys: [],\n };\n addTablePerClassJoinsAndClassTag(query, otherMeta, alias, true);\n\n const rowData = await em[\"executeFindRowData\"](otherMeta, oneToOneLoadOperation, query, {});\n const entities = em[\"hydrateAndFinalize\"](otherMeta.cstr, rowData);\n\n const entitiesByOtherId = groupBy(entities, (entity) => {\n const ownerId = maybeResolveReferenceToId(getField(entity, otherFieldName));\n return ownerId ?? \"dummyNoLongerOwned\";\n });\n\n const api = getEmInternalApi(em);\n for (const key of _keys) {\n const found = entitiesByOtherId.get(key);\n api.setPreloadedRelation(key, reference.fieldName as string, found ? [found[0]] : []);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,wBAAwB;AAErC,SAAgB,oBACd,IACA,WACqB;CACrB,MAAM,OAAO,YAAY,UAAU,MAAM;CACzC,MAAM,WAAW,GAAG,KAAK,UAAU,GAAG,UAAU;CAChD,OAAO,GAAG,eAAe,uBAAuB,UAAU,OAAO,UAAU;EACzE,MAAM,EAAE,WAAW,mBAAmB;EAEtC,mBAAmB,KAAK;EACxB,MAAM,OAAO,SAAS,MAAM,KAAK;EAEjC,MAAM,QAAQ,aAAa,UAAU,SAAS;EAC9C,MAAM,MAAM,KAAK,UAAU,UAAU;EACrC,MAAM,QAAQ,UAAU,UAAU,UAAU;EAC5C,MAAM,QAAyB;GAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;GACxB,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,UAAU;GAAU,CAAC;GAC/D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CACV;KACE,MAAM;KACN,OAAO,GAAG,QAAQ,MAAM;KACxB,QAAQ,IAAI;KACZ,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAClC,CACF;GACF;GACA,UAAU,CAAC;EACb;EACA,iCAAiC,OAAO,WAAW,OAAO,IAAI;EAE9D,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,WAAW,uBAAuB,OAAO,CAAC,CAAC;EAC1F,MAAM,WAAW,GAAG,qBAAqB,CAAC,UAAU,MAAM,OAAO;EAEjE,MAAM,oBAAoB,QAAQ,WAAW,WAAW;GAEtD,OADgB,0BAA0B,SAAS,QAAQ,cAAc,CAC5D,KAAK;EACpB,CAAC;EAED,MAAM,MAAM,iBAAiB,EAAE;EAC/B,KAAK,MAAM,OAAO,OAAO;GACvB,MAAM,QAAQ,kBAAkB,IAAI,GAAG;GACvC,IAAI,qBAAqB,KAAK,UAAU,WAAqB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;EACtF;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"oneToOneBatchLoader.js","names":[],"sources":["../../src/batchloaders/oneToOneBatchLoader.ts"],"sourcesContent":["import { type BatchLoader } from \"src/batchloaders/BatchLoader.ts\";\nimport { type Entity } from \"src/Entity.ts\";\nimport { type EntityManager, getEmInternalApi } from \"src/EntityManager.ts\";\nimport { type OneToOneField, getMetadata } from \"src/EntityMetadata.ts\";\nimport { getField } from \"src/fields.ts\";\nimport {\n type ParsedFindQuery,\n addTablePerClassJoinsAndClassTag,\n assertIdsAreTagged,\n deTagIds,\n maybeResolveReferenceToId,\n} from \"src/index.ts\";\nimport { type OneToOneReferenceImpl } from \"src/relations/OneToOneReference.ts\";\nimport { abbreviation, groupBy } from \"src/utils.ts\";\n\nexport const oneToOneLoadOperation = \"o2o-load\";\n\nexport function oneToOneBatchLoader<T extends Entity, U extends Entity>(\n em: EntityManager,\n reference: OneToOneReferenceImpl<T, U>,\n): BatchLoader<string> {\n const meta = getMetadata(reference.entity);\n const batchKey = `${meta.tableName}-${reference.fieldName}`;\n return em.getBatchLoader(oneToOneLoadOperation, batchKey, async (_keys) => {\n const { otherMeta, otherFieldName } = reference;\n\n assertIdsAreTagged(_keys);\n const keys = deTagIds(meta, _keys);\n\n const alias = abbreviation(otherMeta.tableName);\n const o2o = meta.allFields[reference.fieldName] as OneToOneField;\n const other = otherMeta.allFields[reference.otherFieldName];\n const query: ParsedFindQuery = {\n selects: [`\"${alias}\".*`],\n tables: [{ alias, join: \"primary\", table: otherMeta.tableName }],\n condition: {\n kind: \"exp\",\n op: \"and\",\n conditions: [\n {\n kind: \"column\",\n alias: `${alias}${other.aliasSuffix}`,\n column: o2o.otherColumnName,\n dbType: meta.idDbType,\n cond: { kind: \"in\", value: keys },\n },\n ],\n },\n orderBys: [],\n };\n addTablePerClassJoinsAndClassTag(query, otherMeta, alias, true);\n\n const rowData = await em[\"executeFindRowData\"](otherMeta, oneToOneLoadOperation, query, {});\n const entities = em[\"hydrateAndFinalize\"](otherMeta.cstr, rowData);\n\n const entitiesByOtherId = groupBy(entities, (entity) => {\n const ownerId = maybeResolveReferenceToId(getField(entity, otherFieldName));\n return ownerId ?? \"dummyNoLongerOwned\";\n });\n\n const api = getEmInternalApi(em);\n for (const key of _keys) {\n const found = entitiesByOtherId.get(key);\n api.setPreloadedRelation(key, reference.fieldName as string, found ? [found[0]] : []);\n }\n });\n}\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,wBAAwB;AAErC,SAAgB,oBACd,IACA,WACqB;CACrB,MAAM,OAAO,YAAY,UAAU,MAAM;CACzC,MAAM,WAAW,GAAG,KAAK,UAAU,GAAG,UAAU;CAChD,OAAO,GAAG,eAAe,uBAAuB,UAAU,OAAO,UAAU;EACzE,MAAM,EAAE,WAAW,mBAAmB;EAEtC,mBAAmB,KAAK;EACxB,MAAM,OAAO,SAAS,MAAM,KAAK;EAEjC,MAAM,QAAQ,aAAa,UAAU,SAAS;EAC9C,MAAM,MAAM,KAAK,UAAU,UAAU;EACrC,MAAM,QAAQ,UAAU,UAAU,UAAU;EAC5C,MAAM,QAAyB;GAC7B,SAAS,CAAC,IAAI,MAAM,IAAI;GACxB,QAAQ,CAAC;IAAE;IAAO,MAAM;IAAW,OAAO,UAAU;GAAU,CAAC;GAC/D,WAAW;IACT,MAAM;IACN,IAAI;IACJ,YAAY,CACV;KACE,MAAM;KACN,OAAO,GAAG,QAAQ,MAAM;KACxB,QAAQ,IAAI;KACZ,QAAQ,KAAK;KACb,MAAM;MAAE,MAAM;MAAM,OAAO;KAAK;IAClC,CACF;GACF;GACA,UAAU,CAAC;EACb;EACA,iCAAiC,OAAO,WAAW,OAAO,IAAI;EAE9D,MAAM,UAAU,MAAM,GAAG,qBAAqB,CAAC,WAAW,uBAAuB,OAAO,CAAC,CAAC;EAC1F,MAAM,WAAW,GAAG,qBAAqB,CAAC,UAAU,MAAM,OAAO;EAEjE,MAAM,oBAAoB,QAAQ,WAAW,WAAW;GAEtD,OADgB,0BAA0B,SAAS,QAAQ,cAAc,CAC5D,KAAK;EACpB,CAAC;EAED,MAAM,MAAM,iBAAiB,EAAE;EAC/B,KAAK,MAAM,OAAO,OAAO;GACvB,MAAM,QAAQ,kBAAkB,IAAI,GAAG;GACvC,IAAI,qBAAqB,KAAK,UAAU,WAAqB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;EACtF;CACF,CAAC;AACH"}
@@ -1,19 +1,18 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./BatchLoader.cjs");
3
+ const require_normalizeHints = require("../normalizeHints.cjs");
4
+ const require_reactivity_reactiveHints = require("../reactivity/reactiveHints.cjs");
5
+ const require_keys = require("../keys.cjs");
3
6
  const require_queries_sql_keywords = require("../queries/sql/keywords.cjs");
4
- const require_batchloaders_oneToOneBatchLoader = require("./oneToOneBatchLoader.cjs");
7
+ const require_batchloaders_manyToManyBatchLoader = require("./manyToManyBatchLoader.cjs");
5
8
  const require_batchloaders_oneToManyBatchLoader = require("./oneToManyBatchLoader.cjs");
6
9
  const require_queries_find_QueryParser = require("../queries/find/QueryParser.cjs");
7
- const require_reactiveHints = require("../reactiveHints.cjs");
8
- const require_normalizeHints = require("../normalizeHints.cjs");
9
- require("../loadHints.cjs");
10
- const require_utils = require("../utils.cjs");
11
- const require_batchloaders_manyToManyBatchLoader = require("./manyToManyBatchLoader.cjs");
10
+ const require_batchloaders_oneToOneBatchLoader = require("./oneToOneBatchLoader.cjs");
12
11
  const require_relations_ReactiveField = require("../relations/ReactiveField.cjs");
13
- const require_keys = require("../keys.cjs");
12
+ const require_utils = require("../utils.cjs");
14
13
  require("../EntityMetadata.cjs");
15
14
  const require_queries_sql_AliasAssigner = require("../queries/sql/AliasAssigner.cjs");
16
- const require_HintTree = require("../HintTree.cjs");
15
+ const require_loading_HintTree = require("../loading/HintTree.cjs");
17
16
  require("../index.cjs");
18
17
  const require_batchloaders_loadBatchLoader = require("./loadBatchLoader.cjs");
19
18
  const require_EntityManager = require("../EntityManager.cjs");
@@ -72,11 +71,11 @@ function populateBatchLoader(em, meta, hint, mode, opts = {}) {
72
71
  const fallbackPromises = [];
73
72
  for (const [key, tree] of Object.entries(layerNode.hints)) {
74
73
  const field = layerMeta?.allFields[key];
75
- const isPoly = require_reactiveHints.isPolyHint(key);
74
+ const isPoly = require_reactivity_reactiveHints.isPolyHint(key);
76
75
  let loader;
77
76
  let batchPromise;
78
77
  for (const entity of tree.entities) {
79
- const relation = isPoly ? require_reactiveHints.getRelationFromMaybePolyKey(entity, key) : entity[key];
78
+ const relation = isPoly ? require_reactivity_reactiveHints.getRelationFromMaybePolyKey(entity, key) : entity[key];
80
79
  if (!relation || typeof relation.load !== "function") {
81
80
  if (isPoly) continue;
82
81
  throw new Error(`Invalid load hint '${key}' on ${entity}`);
@@ -123,7 +122,7 @@ function populateBatchLoader(em, meta, hint, mode, opts = {}) {
123
122
  if (Object.keys(tree.hints).length === 0) continue;
124
123
  const childrenByParent = /* @__PURE__ */ new Map();
125
124
  for (const entity of tree.entities) {
126
- const relation = require_reactiveHints.getRelationFromMaybePolyKey(entity, key);
125
+ const relation = require_reactivity_reactiveHints.getRelationFromMaybePolyKey(entity, key);
127
126
  childrenByParent.set(entity, relation ? require_utils.toArray(getEvenDeleted(relation)) : []);
128
127
  }
129
128
  if (childrenByParent.size === 0) continue;
@@ -142,7 +141,7 @@ function populateBatchLoader(em, meta, hint, mode, opts = {}) {
142
141
  }
143
142
  if (nestedLoadPromises) await Promise.all(nestedLoadPromises);
144
143
  }
145
- await populateLayer(meta, require_HintTree.buildHintTree(populates));
144
+ await populateLayer(meta, require_loading_HintTree.buildHintTree(populates));
146
145
  });
147
146
  }
148
147
  /** Probes `relation` to see if it's a m2o/o2m/m2m relation that supports `getWithDeleted`, otherwise calls `get`. */