uql-orm 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (540) hide show
  1. package/CHANGELOG.md +521 -0
  2. package/LICENSE.md +22 -0
  3. package/README.md +560 -0
  4. package/dist/browser/cc-BEf4wTUm.js +535 -0
  5. package/dist/browser/cc-BEf4wTUm.js.map +1 -0
  6. package/dist/browser/http/bus.d.ts +4 -0
  7. package/dist/browser/http/bus.d.ts.map +1 -0
  8. package/dist/browser/http/bus.js +14 -0
  9. package/dist/browser/http/bus.js.map +1 -0
  10. package/dist/browser/http/http.d.ts +7 -0
  11. package/dist/browser/http/http.d.ts.map +1 -0
  12. package/dist/browser/http/http.js +45 -0
  13. package/dist/browser/http/http.js.map +1 -0
  14. package/dist/browser/http/index.d.ts +3 -0
  15. package/dist/browser/http/index.d.ts.map +1 -0
  16. package/dist/browser/http/index.js +3 -0
  17. package/dist/browser/http/index.js.map +1 -0
  18. package/dist/browser/index.d.ts +5 -0
  19. package/dist/browser/index.d.ts.map +1 -0
  20. package/dist/browser/index.js +5 -0
  21. package/dist/browser/index.js.map +1 -0
  22. package/dist/browser/options.d.ts +5 -0
  23. package/dist/browser/options.d.ts.map +1 -0
  24. package/dist/browser/options.js +14 -0
  25. package/dist/browser/options.js.map +1 -0
  26. package/dist/browser/querier/httpQuerier.d.ts +20 -0
  27. package/dist/browser/querier/httpQuerier.d.ts.map +1 -0
  28. package/dist/browser/querier/httpQuerier.js +68 -0
  29. package/dist/browser/querier/httpQuerier.js.map +1 -0
  30. package/dist/browser/querier/index.d.ts +3 -0
  31. package/dist/browser/querier/index.d.ts.map +1 -0
  32. package/dist/browser/querier/index.js +3 -0
  33. package/dist/browser/querier/index.js.map +1 -0
  34. package/dist/browser/querier/querier.util.d.ts +3 -0
  35. package/dist/browser/querier/querier.util.d.ts.map +1 -0
  36. package/dist/browser/querier/querier.util.js +17 -0
  37. package/dist/browser/querier/querier.util.js.map +1 -0
  38. package/dist/browser/type/clientQuerier.d.ts +24 -0
  39. package/dist/browser/type/clientQuerier.d.ts.map +1 -0
  40. package/dist/browser/type/clientQuerier.js +2 -0
  41. package/dist/browser/type/clientQuerier.js.map +1 -0
  42. package/dist/browser/type/clientQuerierPool.d.ts +5 -0
  43. package/dist/browser/type/clientQuerierPool.d.ts.map +1 -0
  44. package/dist/browser/type/clientQuerierPool.js +2 -0
  45. package/dist/browser/type/clientQuerierPool.js.map +1 -0
  46. package/dist/browser/type/index.d.ts +4 -0
  47. package/dist/browser/type/index.d.ts.map +1 -0
  48. package/dist/browser/type/index.js +4 -0
  49. package/dist/browser/type/index.js.map +1 -0
  50. package/dist/browser/type/request.d.ts +29 -0
  51. package/dist/browser/type/request.d.ts.map +1 -0
  52. package/dist/browser/type/request.js +2 -0
  53. package/dist/browser/type/request.js.map +1 -0
  54. package/dist/browser/uql-browser.min.js +4818 -0
  55. package/dist/browser/uql-browser.min.js.map +1 -0
  56. package/dist/d1/d1Querier.d.ts +45 -0
  57. package/dist/d1/d1Querier.d.ts.map +1 -0
  58. package/dist/d1/d1Querier.js +31 -0
  59. package/dist/d1/d1Querier.js.map +1 -0
  60. package/dist/d1/d1QuerierPool.d.ts +10 -0
  61. package/dist/d1/d1QuerierPool.d.ts.map +1 -0
  62. package/dist/d1/d1QuerierPool.js +16 -0
  63. package/dist/d1/d1QuerierPool.js.map +1 -0
  64. package/dist/d1/index.d.ts +3 -0
  65. package/dist/d1/index.d.ts.map +1 -0
  66. package/dist/d1/index.js +3 -0
  67. package/dist/d1/index.js.map +1 -0
  68. package/dist/dialect/abstractDialect.d.ts +22 -0
  69. package/dist/dialect/abstractDialect.d.ts.map +1 -0
  70. package/dist/dialect/abstractDialect.js +37 -0
  71. package/dist/dialect/abstractDialect.js.map +1 -0
  72. package/dist/dialect/abstractSqlDialect.d.ts +140 -0
  73. package/dist/dialect/abstractSqlDialect.d.ts.map +1 -0
  74. package/dist/dialect/abstractSqlDialect.js +957 -0
  75. package/dist/dialect/abstractSqlDialect.js.map +1 -0
  76. package/dist/dialect/dialectConfig.d.ts +23 -0
  77. package/dist/dialect/dialectConfig.d.ts.map +1 -0
  78. package/dist/dialect/dialectConfig.js +96 -0
  79. package/dist/dialect/dialectConfig.js.map +1 -0
  80. package/dist/dialect/index.d.ts +5 -0
  81. package/dist/dialect/index.d.ts.map +1 -0
  82. package/dist/dialect/index.js +5 -0
  83. package/dist/dialect/index.js.map +1 -0
  84. package/dist/dialect/queryContext.d.ts +49 -0
  85. package/dist/dialect/queryContext.d.ts.map +1 -0
  86. package/dist/dialect/queryContext.js +65 -0
  87. package/dist/dialect/queryContext.js.map +1 -0
  88. package/dist/entity/decorator/definition.d.ts +11 -0
  89. package/dist/entity/decorator/definition.d.ts.map +1 -0
  90. package/dist/entity/decorator/definition.js +247 -0
  91. package/dist/entity/decorator/definition.js.map +1 -0
  92. package/dist/entity/decorator/entity.d.ts +3 -0
  93. package/dist/entity/decorator/entity.d.ts.map +1 -0
  94. package/dist/entity/decorator/entity.js +7 -0
  95. package/dist/entity/decorator/entity.js.map +1 -0
  96. package/dist/entity/decorator/field.d.ts +3 -0
  97. package/dist/entity/decorator/field.d.ts.map +1 -0
  98. package/dist/entity/decorator/field.js +8 -0
  99. package/dist/entity/decorator/field.js.map +1 -0
  100. package/dist/entity/decorator/hook.d.ts +8 -0
  101. package/dist/entity/decorator/hook.d.ts.map +1 -0
  102. package/dist/entity/decorator/hook.js +15 -0
  103. package/dist/entity/decorator/hook.js.map +1 -0
  104. package/dist/entity/decorator/id.d.ts +3 -0
  105. package/dist/entity/decorator/id.d.ts.map +1 -0
  106. package/dist/entity/decorator/id.js +8 -0
  107. package/dist/entity/decorator/id.js.map +1 -0
  108. package/dist/entity/decorator/index-decorator.d.ts +36 -0
  109. package/dist/entity/decorator/index-decorator.d.ts.map +1 -0
  110. package/dist/entity/decorator/index-decorator.js +52 -0
  111. package/dist/entity/decorator/index-decorator.js.map +1 -0
  112. package/dist/entity/decorator/index.d.ts +8 -0
  113. package/dist/entity/decorator/index.d.ts.map +1 -0
  114. package/dist/entity/decorator/index.js +8 -0
  115. package/dist/entity/decorator/index.js.map +1 -0
  116. package/dist/entity/decorator/relation.d.ts +9 -0
  117. package/dist/entity/decorator/relation.d.ts.map +1 -0
  118. package/dist/entity/decorator/relation.js +20 -0
  119. package/dist/entity/decorator/relation.js.map +1 -0
  120. package/dist/entity/index.d.ts +2 -0
  121. package/dist/entity/index.d.ts.map +1 -0
  122. package/dist/entity/index.js +2 -0
  123. package/dist/entity/index.js.map +1 -0
  124. package/dist/express/index.d.ts +3 -0
  125. package/dist/express/index.d.ts.map +1 -0
  126. package/dist/express/index.js +3 -0
  127. package/dist/express/index.js.map +1 -0
  128. package/dist/express/querierMiddleware.d.ts +26 -0
  129. package/dist/express/querierMiddleware.d.ts.map +1 -0
  130. package/dist/express/querierMiddleware.js +149 -0
  131. package/dist/express/querierMiddleware.js.map +1 -0
  132. package/dist/express/query.util.d.ts +7 -0
  133. package/dist/express/query.util.d.ts.map +1 -0
  134. package/dist/express/query.util.js +28 -0
  135. package/dist/express/query.util.js.map +1 -0
  136. package/dist/index.d.ts +8 -0
  137. package/dist/index.d.ts.map +1 -0
  138. package/dist/index.js +8 -0
  139. package/dist/index.js.map +1 -0
  140. package/dist/libsql/index.d.ts +3 -0
  141. package/dist/libsql/index.d.ts.map +1 -0
  142. package/dist/libsql/index.js +3 -0
  143. package/dist/libsql/index.js.map +1 -0
  144. package/dist/libsql/libsqlQuerier.d.ts +17 -0
  145. package/dist/libsql/libsqlQuerier.d.ts.map +1 -0
  146. package/dist/libsql/libsqlQuerier.js +71 -0
  147. package/dist/libsql/libsqlQuerier.js.map +1 -0
  148. package/dist/libsql/libsqlQuerierPool.d.ts +12 -0
  149. package/dist/libsql/libsqlQuerierPool.d.ts.map +1 -0
  150. package/dist/libsql/libsqlQuerierPool.js +19 -0
  151. package/dist/libsql/libsqlQuerierPool.js.map +1 -0
  152. package/dist/maria/index.d.ts +4 -0
  153. package/dist/maria/index.d.ts.map +1 -0
  154. package/dist/maria/index.js +4 -0
  155. package/dist/maria/index.js.map +1 -0
  156. package/dist/maria/mariaDialect.d.ts +10 -0
  157. package/dist/maria/mariaDialect.d.ts.map +1 -0
  158. package/dist/maria/mariaDialect.js +41 -0
  159. package/dist/maria/mariaDialect.js.map +1 -0
  160. package/dist/maria/mariadbQuerier.d.ts +10 -0
  161. package/dist/maria/mariadbQuerier.d.ts.map +1 -0
  162. package/dist/maria/mariadbQuerier.js +20 -0
  163. package/dist/maria/mariadbQuerier.js.map +1 -0
  164. package/dist/maria/mariadbQuerierPool.d.ts +11 -0
  165. package/dist/maria/mariadbQuerierPool.d.ts.map +1 -0
  166. package/dist/maria/mariadbQuerierPool.js +17 -0
  167. package/dist/maria/mariadbQuerierPool.js.map +1 -0
  168. package/dist/migrate/bin.d.ts +3 -0
  169. package/dist/migrate/bin.d.ts.map +1 -0
  170. package/dist/migrate/bin.js +7 -0
  171. package/dist/migrate/bin.js.map +1 -0
  172. package/dist/migrate/builder/columnBuilder.d.ts +79 -0
  173. package/dist/migrate/builder/columnBuilder.d.ts.map +1 -0
  174. package/dist/migrate/builder/columnBuilder.js +159 -0
  175. package/dist/migrate/builder/columnBuilder.js.map +1 -0
  176. package/dist/migrate/builder/expressions.d.ts +87 -0
  177. package/dist/migrate/builder/expressions.d.ts.map +1 -0
  178. package/dist/migrate/builder/expressions.js +150 -0
  179. package/dist/migrate/builder/expressions.js.map +1 -0
  180. package/dist/migrate/builder/index.d.ts +6 -0
  181. package/dist/migrate/builder/index.d.ts.map +1 -0
  182. package/dist/migrate/builder/index.js +6 -0
  183. package/dist/migrate/builder/index.js.map +1 -0
  184. package/dist/migrate/builder/migrationBuilder.d.ts +109 -0
  185. package/dist/migrate/builder/migrationBuilder.d.ts.map +1 -0
  186. package/dist/migrate/builder/migrationBuilder.js +463 -0
  187. package/dist/migrate/builder/migrationBuilder.js.map +1 -0
  188. package/dist/migrate/builder/tableBuilder.d.ts +51 -0
  189. package/dist/migrate/builder/tableBuilder.d.ts.map +1 -0
  190. package/dist/migrate/builder/tableBuilder.js +291 -0
  191. package/dist/migrate/builder/tableBuilder.js.map +1 -0
  192. package/dist/migrate/builder/types.d.ts +466 -0
  193. package/dist/migrate/builder/types.d.ts.map +1 -0
  194. package/dist/migrate/builder/types.js +8 -0
  195. package/dist/migrate/builder/types.js.map +1 -0
  196. package/dist/migrate/cli-config.d.ts +3 -0
  197. package/dist/migrate/cli-config.d.ts.map +1 -0
  198. package/dist/migrate/cli-config.js +35 -0
  199. package/dist/migrate/cli-config.js.map +1 -0
  200. package/dist/migrate/cli.d.ts +16 -0
  201. package/dist/migrate/cli.d.ts.map +1 -0
  202. package/dist/migrate/cli.js +394 -0
  203. package/dist/migrate/cli.js.map +1 -0
  204. package/dist/migrate/codegen/entityCodeGenerator.d.ts +137 -0
  205. package/dist/migrate/codegen/entityCodeGenerator.d.ts.map +1 -0
  206. package/dist/migrate/codegen/entityCodeGenerator.js +405 -0
  207. package/dist/migrate/codegen/entityCodeGenerator.js.map +1 -0
  208. package/dist/migrate/codegen/entityMerger.d.ts +115 -0
  209. package/dist/migrate/codegen/entityMerger.d.ts.map +1 -0
  210. package/dist/migrate/codegen/entityMerger.js +294 -0
  211. package/dist/migrate/codegen/entityMerger.js.map +1 -0
  212. package/dist/migrate/codegen/index.d.ts +10 -0
  213. package/dist/migrate/codegen/index.d.ts.map +1 -0
  214. package/dist/migrate/codegen/index.js +14 -0
  215. package/dist/migrate/codegen/index.js.map +1 -0
  216. package/dist/migrate/codegen/migrationCodeGenerator.d.ts +62 -0
  217. package/dist/migrate/codegen/migrationCodeGenerator.d.ts.map +1 -0
  218. package/dist/migrate/codegen/migrationCodeGenerator.js +356 -0
  219. package/dist/migrate/codegen/migrationCodeGenerator.js.map +1 -0
  220. package/dist/migrate/codegen/smartRelationDetector.d.ts +48 -0
  221. package/dist/migrate/codegen/smartRelationDetector.d.ts.map +1 -0
  222. package/dist/migrate/codegen/smartRelationDetector.js +135 -0
  223. package/dist/migrate/codegen/smartRelationDetector.js.map +1 -0
  224. package/dist/migrate/drift/driftDetector.d.ts +81 -0
  225. package/dist/migrate/drift/driftDetector.d.ts.map +1 -0
  226. package/dist/migrate/drift/driftDetector.js +248 -0
  227. package/dist/migrate/drift/driftDetector.js.map +1 -0
  228. package/dist/migrate/drift/index.d.ts +7 -0
  229. package/dist/migrate/drift/index.d.ts.map +1 -0
  230. package/dist/migrate/drift/index.js +7 -0
  231. package/dist/migrate/drift/index.js.map +1 -0
  232. package/dist/migrate/generator/index.d.ts +3 -0
  233. package/dist/migrate/generator/index.d.ts.map +1 -0
  234. package/dist/migrate/generator/index.js +3 -0
  235. package/dist/migrate/generator/index.js.map +1 -0
  236. package/dist/migrate/generator/mongoSchemaGenerator.d.ts +39 -0
  237. package/dist/migrate/generator/mongoSchemaGenerator.d.ts.map +1 -0
  238. package/dist/migrate/generator/mongoSchemaGenerator.js +183 -0
  239. package/dist/migrate/generator/mongoSchemaGenerator.js.map +1 -0
  240. package/dist/migrate/index.d.ts +13 -0
  241. package/dist/migrate/index.d.ts.map +1 -0
  242. package/dist/migrate/index.js +20 -0
  243. package/dist/migrate/index.js.map +1 -0
  244. package/dist/migrate/introspection/abstractSqlSchemaIntrospector.d.ts +77 -0
  245. package/dist/migrate/introspection/abstractSqlSchemaIntrospector.d.ts.map +1 -0
  246. package/dist/migrate/introspection/abstractSqlSchemaIntrospector.js +156 -0
  247. package/dist/migrate/introspection/abstractSqlSchemaIntrospector.js.map +1 -0
  248. package/dist/migrate/introspection/baseSqlIntrospector.d.ts +28 -0
  249. package/dist/migrate/introspection/baseSqlIntrospector.d.ts.map +1 -0
  250. package/dist/migrate/introspection/baseSqlIntrospector.js +135 -0
  251. package/dist/migrate/introspection/baseSqlIntrospector.js.map +1 -0
  252. package/dist/migrate/introspection/index.d.ts +6 -0
  253. package/dist/migrate/introspection/index.d.ts.map +1 -0
  254. package/dist/migrate/introspection/index.js +6 -0
  255. package/dist/migrate/introspection/index.js.map +1 -0
  256. package/dist/migrate/introspection/mongoIntrospector.d.ts +15 -0
  257. package/dist/migrate/introspection/mongoIntrospector.d.ts.map +1 -0
  258. package/dist/migrate/introspection/mongoIntrospector.js +100 -0
  259. package/dist/migrate/introspection/mongoIntrospector.js.map +1 -0
  260. package/dist/migrate/introspection/mysqlIntrospector.d.ts +59 -0
  261. package/dist/migrate/introspection/mysqlIntrospector.d.ts.map +1 -0
  262. package/dist/migrate/introspection/mysqlIntrospector.js +175 -0
  263. package/dist/migrate/introspection/mysqlIntrospector.js.map +1 -0
  264. package/dist/migrate/introspection/postgresIntrospector.d.ts +55 -0
  265. package/dist/migrate/introspection/postgresIntrospector.d.ts.map +1 -0
  266. package/dist/migrate/introspection/postgresIntrospector.js +226 -0
  267. package/dist/migrate/introspection/postgresIntrospector.js.map +1 -0
  268. package/dist/migrate/introspection/sqliteIntrospector.d.ts +60 -0
  269. package/dist/migrate/introspection/sqliteIntrospector.d.ts.map +1 -0
  270. package/dist/migrate/introspection/sqliteIntrospector.js +180 -0
  271. package/dist/migrate/introspection/sqliteIntrospector.js.map +1 -0
  272. package/dist/migrate/migrator.d.ts +176 -0
  273. package/dist/migrate/migrator.d.ts.map +1 -0
  274. package/dist/migrate/migrator.js +624 -0
  275. package/dist/migrate/migrator.js.map +1 -0
  276. package/dist/migrate/schemaGenerator.d.ts +132 -0
  277. package/dist/migrate/schemaGenerator.d.ts.map +1 -0
  278. package/dist/migrate/schemaGenerator.js +628 -0
  279. package/dist/migrate/schemaGenerator.js.map +1 -0
  280. package/dist/migrate/storage/databaseStorage.d.ts +25 -0
  281. package/dist/migrate/storage/databaseStorage.d.ts.map +1 -0
  282. package/dist/migrate/storage/databaseStorage.js +77 -0
  283. package/dist/migrate/storage/databaseStorage.js.map +1 -0
  284. package/dist/migrate/storage/index.d.ts +3 -0
  285. package/dist/migrate/storage/index.d.ts.map +1 -0
  286. package/dist/migrate/storage/index.js +3 -0
  287. package/dist/migrate/storage/index.js.map +1 -0
  288. package/dist/migrate/storage/jsonStorage.d.ts +16 -0
  289. package/dist/migrate/storage/jsonStorage.d.ts.map +1 -0
  290. package/dist/migrate/storage/jsonStorage.js +43 -0
  291. package/dist/migrate/storage/jsonStorage.js.map +1 -0
  292. package/dist/migrate/sync/index.d.ts +7 -0
  293. package/dist/migrate/sync/index.d.ts.map +1 -0
  294. package/dist/migrate/sync/index.js +7 -0
  295. package/dist/migrate/sync/index.js.map +1 -0
  296. package/dist/migrate/sync/schemaSync.d.ts +132 -0
  297. package/dist/migrate/sync/schemaSync.d.ts.map +1 -0
  298. package/dist/migrate/sync/schemaSync.js +260 -0
  299. package/dist/migrate/sync/schemaSync.js.map +1 -0
  300. package/dist/mongo/index.d.ts +4 -0
  301. package/dist/mongo/index.d.ts.map +1 -0
  302. package/dist/mongo/index.js +4 -0
  303. package/dist/mongo/index.js.map +1 -0
  304. package/dist/mongo/mongoDialect.d.ts +47 -0
  305. package/dist/mongo/mongoDialect.d.ts.map +1 -0
  306. package/dist/mongo/mongoDialect.js +299 -0
  307. package/dist/mongo/mongoDialect.js.map +1 -0
  308. package/dist/mongo/mongodbQuerier.d.ts +32 -0
  309. package/dist/mongo/mongodbQuerier.d.ts.map +1 -0
  310. package/dist/mongo/mongodbQuerier.js +267 -0
  311. package/dist/mongo/mongodbQuerier.js.map +1 -0
  312. package/dist/mongo/mongodbQuerierPool.d.ts +11 -0
  313. package/dist/mongo/mongodbQuerierPool.d.ts.map +1 -0
  314. package/dist/mongo/mongodbQuerierPool.js +20 -0
  315. package/dist/mongo/mongodbQuerierPool.js.map +1 -0
  316. package/dist/mysql/index.d.ts +4 -0
  317. package/dist/mysql/index.d.ts.map +1 -0
  318. package/dist/mysql/index.js +4 -0
  319. package/dist/mysql/index.js.map +1 -0
  320. package/dist/mysql/mysql2Querier.d.ts +14 -0
  321. package/dist/mysql/mysql2Querier.d.ts.map +1 -0
  322. package/dist/mysql/mysql2Querier.js +25 -0
  323. package/dist/mysql/mysql2Querier.js.map +1 -0
  324. package/dist/mysql/mysql2QuerierPool.d.ts +11 -0
  325. package/dist/mysql/mysql2QuerierPool.d.ts.map +1 -0
  326. package/dist/mysql/mysql2QuerierPool.js +17 -0
  327. package/dist/mysql/mysql2QuerierPool.js.map +1 -0
  328. package/dist/mysql/mysqlDialect.d.ts +19 -0
  329. package/dist/mysql/mysqlDialect.d.ts.map +1 -0
  330. package/dist/mysql/mysqlDialect.js +97 -0
  331. package/dist/mysql/mysqlDialect.js.map +1 -0
  332. package/dist/namingStrategy/defaultNamingStrategy.d.ts +10 -0
  333. package/dist/namingStrategy/defaultNamingStrategy.d.ts.map +1 -0
  334. package/dist/namingStrategy/defaultNamingStrategy.js +15 -0
  335. package/dist/namingStrategy/defaultNamingStrategy.js.map +1 -0
  336. package/dist/namingStrategy/index.d.ts +3 -0
  337. package/dist/namingStrategy/index.d.ts.map +1 -0
  338. package/dist/namingStrategy/index.js +3 -0
  339. package/dist/namingStrategy/index.js.map +1 -0
  340. package/dist/namingStrategy/snakeCaseNamingStrategy.d.ts +9 -0
  341. package/dist/namingStrategy/snakeCaseNamingStrategy.d.ts.map +1 -0
  342. package/dist/namingStrategy/snakeCaseNamingStrategy.js +14 -0
  343. package/dist/namingStrategy/snakeCaseNamingStrategy.js.map +1 -0
  344. package/dist/neon/index.d.ts +3 -0
  345. package/dist/neon/index.d.ts.map +1 -0
  346. package/dist/neon/index.js +3 -0
  347. package/dist/neon/index.js.map +1 -0
  348. package/dist/neon/neonQuerier.d.ts +10 -0
  349. package/dist/neon/neonQuerier.d.ts.map +1 -0
  350. package/dist/neon/neonQuerier.js +20 -0
  351. package/dist/neon/neonQuerier.js.map +1 -0
  352. package/dist/neon/neonQuerierPool.d.ts +11 -0
  353. package/dist/neon/neonQuerierPool.d.ts.map +1 -0
  354. package/dist/neon/neonQuerierPool.js +17 -0
  355. package/dist/neon/neonQuerierPool.js.map +1 -0
  356. package/dist/options.d.ts +5 -0
  357. package/dist/options.d.ts.map +1 -0
  358. package/dist/options.js +14 -0
  359. package/dist/options.js.map +1 -0
  360. package/dist/postgres/index.d.ts +4 -0
  361. package/dist/postgres/index.d.ts.map +1 -0
  362. package/dist/postgres/index.js +4 -0
  363. package/dist/postgres/index.js.map +1 -0
  364. package/dist/postgres/pgQuerier.d.ts +10 -0
  365. package/dist/postgres/pgQuerier.d.ts.map +1 -0
  366. package/dist/postgres/pgQuerier.js +20 -0
  367. package/dist/postgres/pgQuerier.js.map +1 -0
  368. package/dist/postgres/pgQuerierPool.d.ts +11 -0
  369. package/dist/postgres/pgQuerierPool.d.ts.map +1 -0
  370. package/dist/postgres/pgQuerierPool.js +17 -0
  371. package/dist/postgres/pgQuerierPool.js.map +1 -0
  372. package/dist/postgres/postgresDialect.d.ts +36 -0
  373. package/dist/postgres/postgresDialect.d.ts.map +1 -0
  374. package/dist/postgres/postgresDialect.js +201 -0
  375. package/dist/postgres/postgresDialect.js.map +1 -0
  376. package/dist/querier/abstractPoolQuerier.d.ts +13 -0
  377. package/dist/querier/abstractPoolQuerier.d.ts.map +1 -0
  378. package/dist/querier/abstractPoolQuerier.js +25 -0
  379. package/dist/querier/abstractPoolQuerier.js.map +1 -0
  380. package/dist/querier/abstractQuerier.d.ts +109 -0
  381. package/dist/querier/abstractQuerier.d.ts.map +1 -0
  382. package/dist/querier/abstractQuerier.js +378 -0
  383. package/dist/querier/abstractQuerier.js.map +1 -0
  384. package/dist/querier/abstractQuerierPool.d.ts +23 -0
  385. package/dist/querier/abstractQuerierPool.d.ts.map +1 -0
  386. package/dist/querier/abstractQuerierPool.js +28 -0
  387. package/dist/querier/abstractQuerierPool.js.map +1 -0
  388. package/dist/querier/abstractSqlQuerier.d.ts +38 -0
  389. package/dist/querier/abstractSqlQuerier.d.ts.map +1 -0
  390. package/dist/querier/abstractSqlQuerier.js +169 -0
  391. package/dist/querier/abstractSqlQuerier.js.map +1 -0
  392. package/dist/querier/decorator/index.d.ts +5 -0
  393. package/dist/querier/decorator/index.d.ts.map +1 -0
  394. package/dist/querier/decorator/index.js +5 -0
  395. package/dist/querier/decorator/index.js.map +1 -0
  396. package/dist/querier/decorator/injectQuerier.d.ts +4 -0
  397. package/dist/querier/decorator/injectQuerier.d.ts.map +1 -0
  398. package/dist/querier/decorator/injectQuerier.js +33 -0
  399. package/dist/querier/decorator/injectQuerier.js.map +1 -0
  400. package/dist/querier/decorator/log.d.ts +7 -0
  401. package/dist/querier/decorator/log.d.ts.map +1 -0
  402. package/dist/querier/decorator/log.js +27 -0
  403. package/dist/querier/decorator/log.js.map +1 -0
  404. package/dist/querier/decorator/serialized.d.ts +7 -0
  405. package/dist/querier/decorator/serialized.d.ts.map +1 -0
  406. package/dist/querier/decorator/serialized.js +14 -0
  407. package/dist/querier/decorator/serialized.js.map +1 -0
  408. package/dist/querier/decorator/transactional.d.ts +6 -0
  409. package/dist/querier/decorator/transactional.d.ts.map +1 -0
  410. package/dist/querier/decorator/transactional.js +48 -0
  411. package/dist/querier/decorator/transactional.js.map +1 -0
  412. package/dist/querier/index.d.ts +5 -0
  413. package/dist/querier/index.d.ts.map +1 -0
  414. package/dist/querier/index.js +5 -0
  415. package/dist/querier/index.js.map +1 -0
  416. package/dist/schema/canonicalType.d.ts +42 -0
  417. package/dist/schema/canonicalType.d.ts.map +1 -0
  418. package/dist/schema/canonicalType.js +524 -0
  419. package/dist/schema/canonicalType.js.map +1 -0
  420. package/dist/schema/index.d.ts +28 -0
  421. package/dist/schema/index.d.ts.map +1 -0
  422. package/dist/schema/index.js +29 -0
  423. package/dist/schema/index.js.map +1 -0
  424. package/dist/schema/schemaAST.d.ts +155 -0
  425. package/dist/schema/schemaAST.d.ts.map +1 -0
  426. package/dist/schema/schemaAST.js +496 -0
  427. package/dist/schema/schemaAST.js.map +1 -0
  428. package/dist/schema/schemaASTBuilder.d.ts +58 -0
  429. package/dist/schema/schemaASTBuilder.d.ts.map +1 -0
  430. package/dist/schema/schemaASTBuilder.js +224 -0
  431. package/dist/schema/schemaASTBuilder.js.map +1 -0
  432. package/dist/schema/schemaASTDiffer.d.ts +84 -0
  433. package/dist/schema/schemaASTDiffer.d.ts.map +1 -0
  434. package/dist/schema/schemaASTDiffer.js +431 -0
  435. package/dist/schema/schemaASTDiffer.js.map +1 -0
  436. package/dist/schema/types.d.ts +347 -0
  437. package/dist/schema/types.d.ts.map +1 -0
  438. package/dist/schema/types.js +11 -0
  439. package/dist/schema/types.js.map +1 -0
  440. package/dist/sqlite/abstractSqliteQuerier.d.ts +6 -0
  441. package/dist/sqlite/abstractSqliteQuerier.d.ts.map +1 -0
  442. package/dist/sqlite/abstractSqliteQuerier.js +13 -0
  443. package/dist/sqlite/abstractSqliteQuerier.js.map +1 -0
  444. package/dist/sqlite/index.d.ts +4 -0
  445. package/dist/sqlite/index.d.ts.map +1 -0
  446. package/dist/sqlite/index.js +4 -0
  447. package/dist/sqlite/index.js.map +1 -0
  448. package/dist/sqlite/sqliteDialect.d.ts +42 -0
  449. package/dist/sqlite/sqliteDialect.d.ts.map +1 -0
  450. package/dist/sqlite/sqliteDialect.js +129 -0
  451. package/dist/sqlite/sqliteDialect.js.map +1 -0
  452. package/dist/sqlite/sqliteQuerier.d.ts +12 -0
  453. package/dist/sqlite/sqliteQuerier.d.ts.map +1 -0
  454. package/dist/sqlite/sqliteQuerier.js +25 -0
  455. package/dist/sqlite/sqliteQuerier.js.map +1 -0
  456. package/dist/sqlite/sqliteQuerierPool.d.ts +13 -0
  457. package/dist/sqlite/sqliteQuerierPool.d.ts.map +1 -0
  458. package/dist/sqlite/sqliteQuerierPool.js +34 -0
  459. package/dist/sqlite/sqliteQuerierPool.js.map +1 -0
  460. package/dist/type/config.d.ts +46 -0
  461. package/dist/type/config.d.ts.map +1 -0
  462. package/dist/type/config.js +2 -0
  463. package/dist/type/config.js.map +1 -0
  464. package/dist/type/entity.d.ts +289 -0
  465. package/dist/type/entity.d.ts.map +1 -0
  466. package/dist/type/entity.js +5 -0
  467. package/dist/type/entity.js.map +1 -0
  468. package/dist/type/index.d.ts +11 -0
  469. package/dist/type/index.d.ts.map +1 -0
  470. package/dist/type/index.js +11 -0
  471. package/dist/type/index.js.map +1 -0
  472. package/dist/type/logger.d.ts +61 -0
  473. package/dist/type/logger.d.ts.map +1 -0
  474. package/dist/type/logger.js +2 -0
  475. package/dist/type/logger.js.map +1 -0
  476. package/dist/type/migration.d.ts +268 -0
  477. package/dist/type/migration.d.ts.map +1 -0
  478. package/dist/type/migration.js +2 -0
  479. package/dist/type/migration.js.map +1 -0
  480. package/dist/type/namingStrategy.d.ts +18 -0
  481. package/dist/type/namingStrategy.d.ts.map +1 -0
  482. package/dist/type/namingStrategy.js +2 -0
  483. package/dist/type/namingStrategy.js.map +1 -0
  484. package/dist/type/querier.d.ts +154 -0
  485. package/dist/type/querier.d.ts.map +1 -0
  486. package/dist/type/querier.js +11 -0
  487. package/dist/type/querier.js.map +1 -0
  488. package/dist/type/querierPool.d.ts +31 -0
  489. package/dist/type/querierPool.d.ts.map +1 -0
  490. package/dist/type/querierPool.js +2 -0
  491. package/dist/type/querierPool.js.map +1 -0
  492. package/dist/type/query.d.ts +475 -0
  493. package/dist/type/query.d.ts.map +1 -0
  494. package/dist/type/query.js +11 -0
  495. package/dist/type/query.js.map +1 -0
  496. package/dist/type/universalQuerier.d.ts +120 -0
  497. package/dist/type/universalQuerier.d.ts.map +1 -0
  498. package/dist/type/universalQuerier.js +2 -0
  499. package/dist/type/universalQuerier.js.map +1 -0
  500. package/dist/type/utility.d.ts +33 -0
  501. package/dist/type/utility.d.ts.map +1 -0
  502. package/dist/type/utility.js +2 -0
  503. package/dist/type/utility.js.map +1 -0
  504. package/dist/util/dialect.util.d.ts +13 -0
  505. package/dist/util/dialect.util.d.ts.map +1 -0
  506. package/dist/util/dialect.util.js +82 -0
  507. package/dist/util/dialect.util.js.map +1 -0
  508. package/dist/util/field.util.d.ts +14 -0
  509. package/dist/util/field.util.d.ts.map +1 -0
  510. package/dist/util/field.util.js +57 -0
  511. package/dist/util/field.util.js.map +1 -0
  512. package/dist/util/hook.util.d.ts +15 -0
  513. package/dist/util/hook.util.d.ts.map +1 -0
  514. package/dist/util/hook.util.js +20 -0
  515. package/dist/util/hook.util.js.map +1 -0
  516. package/dist/util/index.d.ts +9 -0
  517. package/dist/util/index.d.ts.map +1 -0
  518. package/dist/util/index.js +9 -0
  519. package/dist/util/index.js.map +1 -0
  520. package/dist/util/logger.d.ts +34 -0
  521. package/dist/util/logger.d.ts.map +1 -0
  522. package/dist/util/logger.js +129 -0
  523. package/dist/util/logger.js.map +1 -0
  524. package/dist/util/object.util.d.ts +8 -0
  525. package/dist/util/object.util.d.ts.map +1 -0
  526. package/dist/util/object.util.js +19 -0
  527. package/dist/util/object.util.js.map +1 -0
  528. package/dist/util/raw.d.ts +9 -0
  529. package/dist/util/raw.d.ts.map +1 -0
  530. package/dist/util/raw.js +11 -0
  531. package/dist/util/raw.js.map +1 -0
  532. package/dist/util/sql.util.d.ts +22 -0
  533. package/dist/util/sql.util.d.ts.map +1 -0
  534. package/dist/util/sql.util.js +88 -0
  535. package/dist/util/sql.util.js.map +1 -0
  536. package/dist/util/string.util.d.ts +29 -0
  537. package/dist/util/string.util.d.ts.map +1 -0
  538. package/dist/util/string.util.js +91 -0
  539. package/dist/util/string.util.js.map +1 -0
  540. package/package.json +146 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,521 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. Please add new changes to the top.
4
+
5
+ date format is [yyyy-mm-dd]
6
+
7
+ ## [0.1.0] - 2026-03-08
8
+ ### Package Rename
9
+ - **Renamed `@uql/core` → `uql-orm`**: The package is now published as an unscoped name for better SEO, discoverability, and simpler install commands (`npm install uql-orm`).
10
+ - **Version Reset to `0.1.0`**: Fresh start to reflect UQL's modern, fast-moving nature. All functionality from `@uql/core@3.15.0` is preserved — this is a rename, not a rewrite.
11
+ - **New Homepage**: [uql-orm.dev](https://uql-orm.dev)
12
+ - **Migration**: Update your imports from `@uql/core` → `uql-orm` (e.g., `import { Entity } from 'uql-orm'`). Sub-path imports follow the same pattern (e.g., `uql-orm/postgres`, `uql-orm/migrate`).
13
+
14
+ ## [3.15.0] - 2026-03-07
15
+ ### New Features
16
+ - **Lifecycle Hooks**: Added entity-level lifecycle hook decorators for domain-specific logic. Seven decorators are available: `@BeforeInsert()`, `@AfterInsert()`, `@BeforeUpdate()`, `@AfterUpdate()`, `@BeforeDelete()`, `@AfterDelete()`, and `@AfterLoad()`. Hooks receive a `HookContext` with access to the active `querier` for transactional DB operations.
17
+ ```ts
18
+ @Entity()
19
+ class Article {
20
+ @BeforeInsert()
21
+ generateSlug() {
22
+ this.slug = this.title.toLowerCase().replace(/\s+/g, '-');
23
+ }
24
+
25
+ @AfterLoad()
26
+ maskSensitiveData() {
27
+ this.internalCode = '***';
28
+ }
29
+ }
30
+ ```
31
+ - **Global Querier Listeners**: Added `QuerierListener` interface and `listeners` option on `ExtraOptions` for cross-cutting concerns (audit logging, automatic timestamps, cache invalidation). Listeners fire before entity-level hooks.
32
+ ```ts
33
+ const pool = new PgQuerierPool(connectionConfig, {
34
+ listeners: [{
35
+ beforeInsert: ({ entity, payloads }) => { /* audit log */ },
36
+ afterUpdate: ({ entity, querier }) => { /* invalidate cache */ },
37
+ }],
38
+ });
39
+ ```
40
+
41
+ ### Architecture
42
+ - **Renamed Internal Methods**: `insertMany`/`updateMany` in `AbstractSqlQuerier` and `MongodbQuerier` are now `internalInsertMany`/`internalUpdateMany` (protected). Public `insertMany`/`updateMany` in `AbstractQuerier` wrap them with hook emission.
43
+ - **New Utility**: `runHooks()` in `util/hook.util.ts` — lightweight hook invocation engine using `entity.prototype[method].call(payload, ctx)`.
44
+ - **Hook Inheritance**: Entity hooks are inherited from parent classes (parent hooks execute first).
45
+
46
+ ### Test Coverage
47
+ - **22 new tests** (11 for decorators, 11 for `runHooks`). Total: **1602 tests passing**. Coverage: Statements 97.2%, Branches 90.1%, Functions 98.4%, Lines 98.0%.
48
+
49
+ ## [3.14.0] - 2026-03-07
50
+ ### Type Safety
51
+ - **Map-Only `$select`**: `$select` now only accepts the map form (e.g., `{ id: true, name: true }`), removing the less type-safe array form. Relation selections are now additive in map form.
52
+ - **Stricter `$and`/`$or`/`$not`/`$nor`**: Logical operators now only accept `QueryWhereMap | QueryRaw` elements — bare ID values (e.g., `$or: [5]`) must use the explicit form `$or: [{ id: 5 }]`. This restores TypeScript's excess property checking inside logical clauses.
53
+ - **Wider JSON Array Operators**: `$elemMatch` and `$all` now accept JSON fields without requiring `as any` casts, thanks to widened fallback types for non-array field types. Removed 6 unnecessary `as any` casts from tests.
54
+
55
+ ### Refactoring
56
+ - **Simplified Express Middleware**: `$where` ID injection in `querierMiddleware` now always uses map form, properly converting array `$where` from query strings to `{ id: { $in: [...] } }`.
57
+ - **Removed `QueryWhereSingle`**: Consolidated into a flattened `QueryWhere<E>` union. Introduced reusable `QueryWhereArray<E>` type alias.
58
+
59
+ ## [3.13.1] - 2026-03-07
60
+ ### Type Safety
61
+ - **Fully Typed Querier Returns**: Remaining querier methods now return proper types instead of `unknown`, enabling IDE autocompletion and compile-time validation on query results for all methods.
62
+ - **Semantic `RawRow` Type**: Introduced `RawRow` as a reusable semantic alias for raw database result rows, replacing scattered `Record<string, unknown>` and `any` across queriers, introspection, and SQL utilities.
63
+ - **Typed MySQL Driver**: Replaced `any` in MySQL2 querier with proper `ResultSetHeader` type from the driver.
64
+ - **Smarter `$select` Validation**: Field and relation selections are now validated simultaneously, catching invalid property names at compile time.
65
+ - **Stricter Null Comparisons**: `null` is now only accepted in `$eq` and `$ne` operators — invalid comparisons like `$gt: null` are caught at compile time.
66
+ - **Typed `defaultValue`**: Entity field defaults are now type-checked instead of accepting `any`.
67
+
68
+ ### API Surface & DX
69
+ - **Cleaner Querier Interfaces**: `ClientQuerier` and `UniversalQuerier` are now properly separated with documented contracts, preventing confusing type mismatches.
70
+ - **Reduced Public API**: Removed unused/redundant type exports (`QuerySearchOne`, `QueryConflictPathsMap`), making the API surface smaller and easier to navigate.
71
+ - **Improved JSDoc**: Added cross-references between related operators (`$not` root vs field) for better discoverability.
72
+
73
+ ### Refactoring
74
+ - **DRY Relation Iteration**: Consolidated duplicated relation iteration logic into `forEachJoinableRelation`, eliminating ~35 duplicated lines.
75
+ - **DRY `compareJsonPath`**: Simplified from 6 parameters to 3, removing redundant internal calls.
76
+ - **DRY `extractInsertResult`**: Shared utility for INSERT result ID extraction across all RETURNING-based drivers (pg, neon, maria), eliminating duplicated logic.
77
+ - **Eliminated Type Casts**: Replaced `Record<string, unknown>` casts with proper type guards across the dialect layer.
78
+ - **Typo Fix**: Renamed `buldQueryWhereAsMap` → `buildQueryWhereAsMap`.
79
+
80
+ ## [3.13.0] - 2026-03-07
81
+ ### New Features
82
+ - **`QueryRaw` Class Refactoring**: Replaced the opaque type + type-guard pattern with a proper `class` using `Symbol`-keyed properties (`RAW_VALUE`, `RAW_ALIAS`). Enables `instanceof QueryRaw` checks, eliminates autocomplete pollution, and prevents accidental structural matches.
83
+ - **JSON `$merge`/`$unset` Operators**: Restored type-safe partial update of JSONB fields via `$merge` (shallow merge) and `$unset` (key removal) in `update()` payloads. Works across PostgreSQL (`||`/`-`), MySQL (`JSON_MERGE_PATCH`/`JSON_REMOVE`), and SQLite (`json_patch`/`json_remove`).
84
+ ```ts
85
+ await querier.updateMany(Company, { $where: { id: 1 } }, {
86
+ kind: { $merge: { theme: 'dark' }, $unset: ['deprecated'] },
87
+ });
88
+ ```
89
+ - **JSON Dot-Notation Sorting**: `$sort` now supports JSONB dot-notation paths (e.g. `{ 'kind.priority': 'desc' }`), sharing the `resolveJsonDotPath` helper with `$where` for DRY consistency.
90
+
91
+
92
+ ## [3.12.1] - 2026-03-05
93
+ ### Bug Fixes
94
+ - **Null-Safe JSONB `$ne`**: JSONB dot-notation `$ne` now uses null-safe operators (`IS DISTINCT FROM` on PostgreSQL, `IS NOT` on SQLite) so that absent keys (which return SQL `NULL`) are correctly included in results. Previously, `{ 'settings.isArchived': { $ne: true } }` would silently exclude rows where the key didn't exist.
95
+ - **JSONB `$eq`/`$ne` with `null`**: `$eq: null` and `$ne: null` on JSONB paths now correctly generate `IS NULL` / `IS NOT NULL` instead of `= NULL` / `<> NULL`.
96
+
97
+ ### Improvements & Refactoring
98
+ - **`QueryWhereMap` Type Safety**: Replaced the overly permissive `Record<string, ...>` catch-all with explicit typed unions: template literal `` `${string}.${string}` `` for dot-paths, `RelationKey<E>` for relation filtering, and `JsonFieldPaths<E>` for IDE autocompletion.
99
+ - **`DeepJsonKeys` Recursive Type**: `JsonFieldPaths<E>` now derives dot-notation paths up to 5 levels deep (previously only 1 level), enabling autocompletion for nested JSONB structures like `'kind.theme.color'`.
100
+ - **DRY `compare()` Signature**: Simplified `compare()` from `<E, K extends keyof QueryWhereMap<E>>(key: K, val: QueryWhereMap<E>[K])` to `<E>(key: string, val: unknown)` across all dialect overrides, removing redundant generic constraints.
101
+ - **DRY SQLite Config**: SQLite's `getBaseJsonConfig()` now spreads from `super` instead of duplicating 4 identical fields.
102
+
103
+ ### Test Coverage
104
+ - Removed ~20 `as any` casts from tests (now unnecessary with improved types). Added null-safe `$ne` tests across all dialects. Total: **1,563 tests passing**.
105
+
106
+ ## [3.12.0] - 2026-03-05
107
+ ### New Features
108
+ - **JSONB Dot-Notation Operators**: Filter by nested JSON field paths directly in `$where` with full operator support (`$eq`, `$ne`, `$gt`, `$lt`, `$like`, `$ilike`, `$in`, `$nin`, `$regex`, etc.). Works across PostgreSQL, MySQL, and SQLite.
109
+ ```ts
110
+ await querier.findMany(User, {
111
+ $where: { 'settings.isArchived': { $ne: true } },
112
+ });
113
+ ```
114
+ - **Relation Filtering**: Filter by ManyToMany and OneToMany relations using automatic EXISTS subqueries. No more manual `raw()` joins.
115
+ ```ts
116
+ await querier.findMany(Item, {
117
+ $where: { tags: { name: 'important' } },
118
+ });
119
+ ```
120
+ - **`Json<T>` Marker Type**: Wrap JSONB field types with `Json<T>` to ensure they are classified as `FieldKey` (not `RelationKey`), enabling type-safe usage in `$where`, `$select`, and `$sort`.
121
+ ```ts
122
+ @Field({ type: 'jsonb' })
123
+ settings?: Json<{ isArchived?: boolean }>;
124
+ ```
125
+ - **`JsonFieldPaths<E>` Autocompletion**: Template literal type that derives valid dot-notation paths from `Json<T>` fields (e.g., `'kind.public' | 'kind.private'`). Provides IDE autocompletion for JSONB `$where` queries without restricting arbitrary string paths.
126
+
127
+ ### Bug Fixes
128
+ - **raw() String Prefix Fix**: String-based `raw()` values in `$and`/`$or` are no longer incorrectly table-prefixed (e.g., `raw("kind IS NOT NULL")` previously produced `resource.kind IS NOT NULL` instead of `kind IS NOT NULL`).
129
+
130
+ ### Improvements & Refactoring
131
+ - **DRY JSON Config**: Extracted `getBaseJsonConfig()` in each dialect — `$elemMatch` and dot-notation now compose from a single config source, eliminating ~20 lines of duplication.
132
+ - **Extracted `normalizeWhereValue()`**: Deduplicated the `Array→$in / object→passthrough / scalar→$eq` normalization used by both regular field and JSON path comparisons.
133
+ - **Cleaner Dot-Notation Detection**: Uses `indexOf`+`slice` instead of two `split('.')` calls for efficient dot-path parsing.
134
+ - **Relation Safety Guard**: `compareRelation()` now throws a descriptive `TypeError` if `rel.references` is missing, instead of a cryptic undefined crash.
135
+ - **TypeScript 6 Compatibility**: Fixed `QueryWhereMap` circular type reference and expanded `QueryWhereOptions.clause` union.
136
+
137
+ ### Test Coverage
138
+ - **46 new tests** across 3 dialects (base, PostgreSQL, SQLite) covering all new features and edge cases. Total: **1561 tests passing**.
139
+
140
+ ## [3.11.1] - 2026-02-26
141
+ ### Improvements
142
+ - **Expanded ColumnType Aliases**: Added `integer`, `tinyint`, `bool`, `datetime`, and `smallserial` as first-class `ColumnType` values (aliases for `int`, `boolean`, `timestamp`, `smallserial`, and `serial` respectively). Users can now use standard SQL keywords interchangeably (e.g., `integer` or `int`, `bool` or `boolean`, `datetime` or `timestamp`).
143
+ - **Auto-Increment Fix**: `smallserial` columns are now correctly detected as auto-incrementing, consistent with `serial` and `bigserial`.
144
+
145
+ ## [3.11.0] - 2026-02-21
146
+ ### New Features
147
+ - **Scoped Querier**: Added `pool.withQuerier(callback)` — the non-transactional counterpart to `pool.transaction()`. Acquires a querier, runs the callback, and guarantees release via `try/finally`. Useful for scoping connection lifetime without transaction overhead.
148
+
149
+ ```ts
150
+ const users = await pool.withQuerier(async (querier) => {
151
+ return querier.findMany(User, { $limit: 10 });
152
+ });
153
+ // querier is automatically released here
154
+ ```
155
+
156
+ ## [3.10.0] - 2026-02-18
157
+ ### New Features
158
+ - **Bulk Upsert**: Added `upsertMany` operation to the `Querier` and `UniversalQuerier` interfaces, enabling efficient bulk insert-or-update across all supported databases.
159
+ - **SQL** (PostgreSQL, MySQL, MariaDB, SQLite): Uses a single `INSERT ... ON CONFLICT/ON DUPLICATE KEY UPDATE` statement with array payloads.
160
+ - **MongoDB**: Uses `bulkWrite` with `updateOne` + `upsert: true` operations.
161
+ - `upsertOne` now delegates to `upsertMany` in SQL dialects for DRY internals; MongoDB retains independent `findOneAndUpdate` for optimal single-document behavior.
162
+
163
+ ### Test Coverage
164
+ - **Branch coverage improved from ~88% to 90%** with targeted tests across `schemaAST`, `entityMerger`, `driftDetector`, `canonicalType`, and `tableBuilder`.
165
+
166
+ ### Dependencies
167
+ - `@biomejs/biome` 2.3.15 → 2.4.2
168
+ - `rimraf` 6.1.2 → 6.1.3
169
+ - `mariadb` 3.4.5 → 3.5.1
170
+ - `mysql2` 3.17.1 → 3.17.2
171
+
172
+ ## [3.9.2] - 2026-02-13
173
+ ### Improvements & Refactoring
174
+ - **Reduced Cognitive Complexity**: Extracted `compareLogicalOperator` from `AbstractSqlDialect.compare` and `countBraces` helper from `EntityMerger.findInsertPosition`, bringing both functions under the biome complexity threshold.
175
+ - **Tighter Type Safety**: Replaced `any` with `unknown` across the logger interface, field utilities, and D1 bindings. Typed all DB querier constructors with `ExtraOptions` instead of `any`.
176
+
177
+ ## [3.9.1] - 2026-02-13
178
+ ### Improvements & Refactoring
179
+ - **TypeScript Upgrade**: Upgraded to TypeScript ^5.9.3 and hardened `tsconfig.json` with strict flags (`noPropertyAccessFromIndexSignature`, `verbatimModuleSyntax`, etc.).
180
+ - **Type Safety Polish**: Propagated `E extends object` constraint across the `Querier` hierarchy and refined driver signatures to eliminate type casts (`as any`).
181
+
182
+ ### Bug Fixes
183
+ - **MySQL Introspection Fix**: Fixed a bug where string default values were returned with surrounding quotes (e.g., `'active'`) during schema discovery in MySQL and MariaDB.
184
+
185
+ ## [3.9.0] - 2026-02-13
186
+ ### New Features
187
+ - **New Query Operators**: Added `$between`, `$isNull`, `$isNotNull`, `$all`, `$size`, and `$elemMatch` operators with full support across PostgreSQL, MySQL, SQLite, and MongoDB.
188
+ - **Dual-API Pattern**: Querier read and delete methods (`findOne`, `findMany`, `findManyAndCount`, `count`, `deleteMany`) now accept either the classic `(Entity, query)` call or an RPC-friendly `({ $entity: Entity, ...query })` call. This enables cleaner serialization for RPC/REST endpoints.
189
+
190
+ ### Improvements & Refactoring
191
+ - **Structured Slow-Query Config**: Replaced flat `slowQueryThreshold: number` with a `slowQuery: { threshold, logParams? }` object. Use `logParams: false` to suppress sensitive query parameters from slow-query logs.
192
+ - **DRY Dialect Refactor**: Extracted shared `$elemMatch` field-condition logic into `buildJsonFieldCondition` in `AbstractSqlDialect` with a `JsonFieldConfig` type. Each SQL dialect now passes a small config object (~10 lines) instead of duplicating a ~60-line switch across MySQL, PostgreSQL, and SQLite.
193
+ - **Safer Abstract Base**: `$all`, `$size`, and `$elemMatch` now throw in the abstract SQL dialect base class, forcing each dialect subclass to provide its own implementation. This prevents silent inheritance of dialect-specific syntax.
194
+
195
+ ### Bug Fixes
196
+ - **SQLite `$in`/`$nin` Fix**: Fixed a critical bug where `buildJsonFieldOperator` used `vals.shift()` inside `.map()`, mutating the input array and only processing half the values.
197
+ - **Accurate Slow-Query Logging**: The `@Log()` timer now excludes connection establishment (TCP/SSL handshake) time. Previously, the first query on a new connection could trigger false slow-query alerts. Connection setup (`lazyConnect()`) is now centralized in `all()`/`run()` outside the `@Log()` scope.
198
+
199
+ ## [3.8.4] - 2026-01-09
200
+ ### Improvements
201
+ - **Strict Type Polish**: Replaced remaining `any` type usage with `unknown` in the SQL introspection layer for improved safety. Refactored `toNumber` to handle more robustly various database numeric results during schema crawling.
202
+
203
+ ## [3.8.3] - 2026-01-09
204
+ ### Improvements & Refactoring
205
+ - **Unified SQL Introspectors**: Refactored the database introspection layer using a template-method pattern via `AbstractSqlSchemaIntrospector`. This consolidated shared logic for **PostgreSQL**, **MySQL**, **MariaDB**, and **SQLite**, reducing code duplication by ~280 lines while ensuring consistent behavior across all SQL dialects.
206
+ - **Enhanced `@Index` Decorator**: Completed the implementation for composite and customized indexes. Developers can now define multi-column indexes with support for custom `name`, `unique` constraints, and dialect-specific `type` (e.g., `btree`, `hash`, `gin`, `gist`) and `where` clauses.
207
+ - **Reliable Schema Generation**: Synced `SqlSchemaGenerator` with the **Schema AST** for initial `CREATE TABLE` operations. This ensures that manually defined composite indexes and complex constraints are automatically included in new migrations and `autoSync` actions.
208
+ - **Robust SQLite Introspection**: Optimized SQLite-specific PRAGMA handling to correctly manage non-standard placeholder support, resolving "Too many parameters" errors and improving stability for **LibSQL** and **Cloudflare D1**.
209
+ - **Refined Type Safety**: Fixed TypeScript compilation issues related to `override` modifiers and corrected internal type mismatches in `SchemaASTBuilder`, achieving a perfectly clean `tsc` output and 100% test coverage for all introspector modules.
210
+
211
+ ## [3.8.2] - 2026-01-08
212
+ ### Improvements & Refactoring
213
+ - **Refactored Dialect Configuration**: Grouped dialect-specific flags into a cohesive `features` object within `DialectConfig`. Introduced a new `foreignKeyAlter` flag to explicitly manage support for post-creation foreign key constraints, improving architectural clarity.
214
+ - **Enhanced Table Builder**: Foreign key definitions created via the fluent `.references()` API are now automatically promoted to table-level constraints during the build process. This ensures full compatibility with **SQLite** and other dialects that require foreign keys to be defined within the `CREATE TABLE` statement.
215
+ - **Predictable SQL Expressions**: Removed brittle string auto-detection in `formatDefaultValue`. Developers are now encouraged to use the explicit `raw()` helper or the `t.now()` shortcut for SQL expressions like `CURRENT_TIMESTAMP`, ensuring deterministic behavior across all databases.
216
+ - **Robust Introspection Tests**: Refactored the integration test suite to use explicit SQL expression helpers and non-shadowed callback parameters. Standardized timestamp type assertions for MySQL and MariaDB, achieving 100% pass rate across the entire test suite (1,383 tests).
217
+
218
+ ## [3.8.0] - 2026-01-08
219
+ ### Schema Sync System & AST Engine
220
+ - **Schema AST Feature**: Introduced a revolutionary **Schema AST (Abstract Syntax Tree)** engine that treats the database schema as a graph. This enables features like **Circular Dependency Detection** and automatic topological sorting for `CREATE`/`DROP` operations, solving complex schema edge cases that simple list-based approaches cannot handle.
221
+ - **Smart Relation Detection**: When scaffolding entities from an existing database (`generate:from-db`), UQL now automatically infers **OneToOne** and **ManyToMany** relationships by analyzing foreign key structures and naming conventions (e.g., `user_id` -> `User` entity), significantly reducing manual boilerplate.
222
+ - **Drift Detection**: Added the `drift:check` command to detect discrepancies between your TypeScript entities and the actual database schema. It reports critical issues (missing tables, risk of data truncation) and warnings (missing indexes) to ensure production safety.
223
+ - **Bidirectional Index Sync**: Indexes are now fully synchronized in both directions. `@Field({ index: true })` definitions are pushed to the database, and existing database indexes are reflected in generated entity files.
224
+ - **Unified Migration Builder API**: Refactored the migration builder to use a cohesive **Options Object** API (e.g., `t.string('email', { length: 255, unique: true })`). This replaces the old positional argument style, aligning strictly with the `@Field` decorator options for a consistent developer experience.
225
+ - **Refactored Generators**: Consolidated `SqlSchemaGenerator` and `MongoSchemaGenerator` into a unified architecture, sharing core logic for simpler maintenance and better type safety.
226
+
227
+ ## [3.7.14] - 2026-01-06
228
+ ### Documentation
229
+ - **README Refinement**: Improved docs about new Migrations feature.
230
+
231
+ ## [3.7.12] - 2026-01-06
232
+ ### Improvements
233
+ - **Expanded Float Support**: Added `float4`, `float8`, and `double precision` to `ColumnType`, with proper mapping across PostgreSQL, MySQL, and SQLite.
234
+ - **Type Grouping & Safety**: Introduced specialized union types (`NumericColumnType`, `StringColumnType`, `DateColumnType`, etc.) for better internal organization and exhaustive type checking.
235
+ - **Optimized Type Helpers**: Refactored `field.util.ts` to use `as const satisfies Record<T, true>` for all column type groups, ensuring compile-time verification when adding new types.
236
+ - **Dialect Refactoring**: Standardized SQL dialects to use centralized type helpers (`isNumericType`, `isJsonType`), improving code reuse and consistency.
237
+
238
+ ## [3.7.11] - 2026-01-04
239
+ ### Improvements
240
+ - **Enhanced Down Migrations**: `generateAlterTableDown` now generates complete reversals for column alterations (restores original type) and index additions (drops them). For dropped columns/indexes, a TODO comment is added since the original schema isn't stored.
241
+ - **Bun Documentation**: Added note in README for Bun users with TypeScript path aliases to use `--bun` flag for proper resolution.
242
+
243
+ ## [3.7.10] - 2026-01-04
244
+ ### Improvements
245
+ - **Robust Config Loading**: Integrated `jiti` into the CLI configuration loader. This allows `uql-migrate` to natively support TypeScript configuration files (`uql.config.ts`) and properly resolve ESM/CJS interop logic across all node environments (Node.js, Bun, etc.) without requiring custom runtime flags.
246
+
247
+ ## [3.7.9] - 2026-01-04
248
+ - **Manual Migrations**: Updated the root README to explicitly document the `generate` command for creating manual incremental migrations (`npx uql-migrate generate <name>`), ensuring developers know how to create empty migration files efficiently.
249
+
250
+ ### Bug Fixes
251
+ - **CLI Entry Point**: Fixed a critical issue where the `uql-migrate` command would silently fail in certain environments (e.g., when run via `npx` or symlinks) due to brittle entry point detection. The CLI now reliably executes regardless of how it is invoked.
252
+
253
+ ## [3.7.7] - 2026-01-04
254
+ ### Refined Foreign Key Handling & Control
255
+ - **Recursive Type Inheritance**: Foreign key columns now automatically inherit the exact SQL type of their referenced primary keys (e.g., `UUID` -> `UUID`), ensuring perfect compatibility even in complex inheritance or self-referencing relationships.
256
+ - **Custom Foreign Key Control**: Introduced the `foreignKey` option in `@Field` and `@Id` to allow specifying custom semantic names for constraints or disabling physical constraints (`false`) while maintaining logical references.
257
+ - **Deterministic Constraint Naming**: Standardized default foreign key naming to `` `fk_${tableName}_${columnName}` ``, ensuring uniqueness and predictability across the database.
258
+ - **Enhanced Schema Robustness**: Improved the schema generator's resilience against entities using circular dependencies or deep inheritance chains.
259
+ - **Express Middleware Fix**: Resolved an issue in `query.util.ts` where the query parser could crash when receiving array-based query parameters (e.g., `$where[]=1`), preventing correct filtering in Express applications.
260
+ - **Field Utility Optimization**: Refactored `isNumericType` to use a `Set` for O(1) lookups and resolved strict type checking issues in `field.util.ts`.
261
+
262
+ ## [3.7.5] - 2026-01-04
263
+ ### Enhanced Type Inference & Default Value Comparison
264
+ - **Strict Field Type Safety**: Standardized the `type` property in `@Field` and `@Id` to use a strict union of global constructors (`String`, `Number`, etc.) and verified `ColumnType` strings.
265
+ - **Removed String Aliases**: Deprecated and removed support for informal string aliases like `'string'`, `'number'`, `'boolean'`, and `'date'` in the `type` property. Developers should use the corresponding TypeScript constructors for logical mapping.
266
+ - **Semantic Type Inference**: Added robust support for `'uuid'`, `'json'`, `'jsonb'`, and `'vector'` as valid semantic values for the `type` property. This ensures correct cross-database SQL mapping even when specified as semantic strings.
267
+
268
+ ## [3.7.4] - 2026-01-04
269
+ ### Enhanced Schema Generation & Type Safety
270
+ - **Fixed Foreign Key Type Mismatch**: Resolved an issue where foreign key columns could default to incompatible types (e.g., `TEXT`) when referencing primary keys of a different type (e.g., `UUID`). Foreign keys now automatically inherit the exact SQL type of the column they reference.
271
+ - **Improved Default Value Comparison**: Standardized default value normalization to handle complex PostgreSQL type casts (e.g., `'[]'::jsonb[]`) and accurately compare object/array defaults using `JSON.stringify`, effectively eliminating "phantom diffs."
272
+ - **Improved Primary Key Inference**: String-based primary keys (including UUIDs) no longer incorrectly default to `BIGINT` auto-incrementing serials. The ORM now only applies auto-increment logic to numeric types (`number`, `BigInt`) unless explicitly configured via `@Id({ autoIncrement: true })`.
273
+ - **Architectural Refactor**: Consolidated schema generation to use a unified `fieldToColumnSchema` path for both initial creation and synchronization, ensuring perfect structural consistency and eliminating "phantom diffs".
274
+ - **Reusable Field Utilities**: Created `field.util.ts` for centralized logic regarding auto-increment and numeric type checks, improving maintainability across the ORM.
275
+ - **Safety Fix**: Refined `generateColumnDefinitionFromSchema` to safely strip redundant `PRIMARY KEY` constraints during `ALTER TABLE` operations, avoiding "Duplicate Primary Key" errors while maintaining auto-incrementing properties.
276
+ - **Expanded Unit Tests**: Added comprehensive branch testing for field properties and type inference to ensure long-term stability across all 8 supported databases.
277
+
278
+ ## [3.7.3] - 2026-01-04
279
+ ### Robust Schema Synchronization
280
+ - **Safe AutoSync**: Primary keys are now immune to automated alterations, preventing dangerous schema changes and ensuring database stability.
281
+ - **Modern Primary Keys**: Standardized on **64-bit** auto-increment primary keys across all SQL dialects to align with TypeScript's `number` type:
282
+ - **PostgreSQL**: Now uses `BIGINT GENERATED BY DEFAULT AS IDENTITY` (SQL Standard).
283
+ - **MySQL / MariaDB**: Now uses `BIGINT UNSIGNED AUTO_INCREMENT`.
284
+ - **SQLite / LibSQL / D1**: Consistently uses 64-bit `INTEGER PRIMARY KEY`.
285
+ - **SQLite `STRICT` Mode**: Tables generated for SQLite, LibSQL, and Cloudflare D1 now use **`STRICT` mode** by default, enforcing type integrity at the database level.
286
+ - **Polymorphic Type Resolution**: Refactored `getSqlType` to be dialect-aware for all core types (Numbers, Strings, Booleans, Dates), preventing dialect-specific types from leaking into incompatible databases.
287
+ - **Semantic Type Comparison**: Implemented intelligent type normalization that understands dialect-specific aliases (e.g., `INTEGER` vs `INT`) and ignores implementation details like MySQL display widths (`BIGINT(20)`).
288
+ - **Fixed ALTER Syntax**: Resolved "Duplicate primary key" errors in MySQL/MariaDB by ensuring `MODIFY COLUMN` statements omit existing constraints during type or nullability updates.
289
+ - **Improved Postgres Introspection**: Enhanced default value comparison to correctly handle complex Postgres type casts (e.g., `::timestamp without time zone`) and quoted strings.
290
+ - **Expanded Testing**: Added **SQLite**, **LibSQL**, and **Cloudflare D1** scenarios to the integration test suite, ensuring 100% behavioral consistency across all 8 supported databases.
291
+ - **Predictable Test Assertions**: Refactored all schema synchronization and introspection tests to use direct, non-conditional assertions, improving test reliability and failure clarity by removing optional chaining and non-null assertions.
292
+ - **Clean Test Logic**: Removed imperative conditionals from test generators, replacing them with declarative mapping objects for dialect-specific type verification.
293
+
294
+ ## [3.7.2] - 2026-01-04
295
+ ### Improve documentation
296
+ - **AutoSync**: Clarified that entities must be imported/loaded before calling `autoSync()`. Added examples for both explicit entity passing (recommended) and auto-discovery approaches, plus debugging tips
297
+
298
+ ## [3.7.1] - 2026-01-04
299
+ ### Improve documentation
300
+ - Update examples in docs and improve formatting of README
301
+
302
+ ## [3.7.0] - 2026-01-04
303
+ ### Improvements
304
+ - **Repository Pattern Removal**: Removed the built-in Repository pattern implementation (`GenericRepository`, etc.) to simplify the framework architecture (KISS). Users should rely on the `Querier` interface or implement custom layers if needed.
305
+ - **Testing**: Added comprehensive tests for `HttpQuerier` and integration tests for the CLI entry point (`bin.ts`), achieving >99% code coverage.
306
+
307
+ ## [3.6.1] - 2026-01-04
308
+ ### New Features
309
+ - **CLI**: Added `--config` / `-c` flag to `uql-migrate` to load a custom configuration file.
310
+ - **CLI**: Improved error handling when loading configuration files (syntax errors are no longer swallowed).
311
+
312
+ ## [3.6.0] - 2026-01-04
313
+ ### New Features
314
+ - **CLI**: Added default logger, support to log slow-queries in a parameterized way, and ability to define custom loggers.
315
+
316
+ ## [3.5.0] - 2026-01-03
317
+ ### Refactor
318
+ - **Dialect-Aware String Defaults**: Optimized default column types for TypeScript `string` fields across all supported databases.
319
+ - **PostgreSQL**: Defaults to `TEXT` (idiomatic, no length limits, slightly faster).
320
+ - **SQLite**: Defaults to `TEXT` (matches internal type affinity).
321
+ - **MySQL / MariaDB**: Defaults to `VARCHAR(255)` (ensures out-of-the-box compatibility for indices and unique constraints).
322
+ - Automatically transitions to `VARCHAR(n)` when an explicit `length` is provided in the `@Field()` decorator.
323
+
324
+ ## [3.4.1]
325
+ ### Improve documentation
326
+
327
+ - Update examples in docs
328
+
329
+ ## [3.1.1](https://github.com/rogerpadilla/uql/compare/uql-orm@3.1.0...uql-orm@3.1.1) (2025-12-30)
330
+ ### Bug Fixes
331
+ * adjust relative paths for README and CHANGELOG in copyfiles script ([741c2ee](https://github.com/rogerpadilla/uql/commit/741c2ee8839376ca89a860a53950ef6b6d234596))
332
+
333
+ ## [3.1.0](https://github.com/rogerpadilla/uql/compare/uql-orm@3.0.0...uql-orm@3.1.0) (2025-12-30)
334
+ ### Bug Fixes
335
+
336
+ * adjust relative paths for README and CHANGELOG in copyfiles script ([7a61a01](https://github.com/rogerpadilla/uql/commit/7a61a0135da2d0459e588cda7d94f324bb9eebca))
337
+
338
+ ## [3.0.0](https://github.com/rogerpadilla/uql/compare/uql-orm@2.0.0...uql-orm@3.0.0) (2025-12-30)
339
+ Reflect major changes in the package structure and dependencies.
340
+
341
+ ## [2.0.0] - 2025-12-29
342
+ - **Major Rebranding**: Rebranded the project from **Nukak** to **UQL** (Universal Query Language - this was the original name!).
343
+ - New Slogan: **"One Language. Frontend to Backend."**
344
+ - Project homepage: [uql-orm.dev](https://uql-orm.dev).
345
+ - **Package Unification**: Unified all database adapters (`mysql`, `postgres`, `maria`, `sqlite`, `mongo`) and `express` middleware into a single core package: `uql-orm`.
346
+ - **Scoped Naming**:
347
+ - `uql-orm`: The main ORM engine and all database adapters.
348
+ - `uql-orm/migrate`: The database migration system (formerly `nukak-migrate`).
349
+ - **Improved API Surface**:
350
+ - Database-specific logic is now accessible via sub-paths (e.g., `import { ... } from 'uql-orm/postgres'`).
351
+ - Unified `NamingStrategy` and `QueryContext` across all unified adapters.
352
+ - **Build & Distribution**:
353
+ - Integrated `bunchee` for high-performance browser bundle generation (`uql-orm/browser`).
354
+ - Minimized core dependency footprint by moving database drivers to optional `peerDependencies`.
355
+ - **Enhanced Type Safety**: Fully updated internal type resolution to support the unified package structure.
356
+
357
+ ## [1.8.0] - 2025-12-29
358
+ - **New Feature**: Added support for **Naming Strategies**.
359
+ - Automatically translate TypeScript entity and property names to database-specific identifiers (e.g., camelCase to snake_case).
360
+ - Built-in `DefaultNamingStrategy` and `SnakeCaseNamingStrategy`.
361
+ - Comprehensive support across all SQL dialects and MongoDB.
362
+ - **Refactoring**:
363
+ - Unified naming and metadata resolution logic into a new `AbstractDialect` base class shared by both DML (Dialects) and DDL (Schema Generators).
364
+ - Improved `MongoDialect` to respect naming strategies for collection and field names on both read and write operations.
365
+
366
+ ## [1.7.0] - 2025-12-29
367
+ - **New Package**: Introduced `nukak-migrate` for database migrations.
368
+ - Supports version-controlled schema changes via local migration files.
369
+ - Automatic migration generation from entity definitions using schema introspection.
370
+ - Full support for PostgreSQL, MySQL, MariaDB, and SQLite.
371
+ - CLI tool for managing migrations (`up`, `down`, `status`, `generate`, `sync`).
372
+ - Database-backed migration tracking (Database or JSON storage).
373
+ - **Core Improvements**:
374
+ - Expanded `@Field()` decorator with schema metadata: `length`, `precision`, `scale`, `unique`, `index`, `columnType`, `defaultValue`, and `comment`.
375
+ - Added schema generation and introspection capabilities to SQL dialects.
376
+
377
+ ## [1.6.0] - 2025-12-28
378
+ - **Architectural Change**: Migrated from "Values as Parameter" to "Context Object" pattern for SQL generation.
379
+ - This pattern centralizes query parameters and SQL fragments into a `QueryContext`, ensuring robust placeholder management and preventing out-of-sync parameter indices.
380
+ - Improved compatibility with PostgreSQL's indexed placeholders ($1, $2, etc.) and complex sub-queries.
381
+ - Standardized dialect interfaces to operate directly on the `QueryContext` for higher performance and cleaner code.
382
+ - Fixed linter issues and unified type safety for `raw()` SQL snippets across all drivers.
383
+
384
+ ## [1.5.0] - 2025-12-28
385
+ - **BREAKING CHANGE**: Implemented "Sticky Connections" for performance. `Querier` instances now hold their connection until `release()` is explicitly called.
386
+ - If you manually retrieve a querier via `pool.getQuerier()`, you **MUST** call `await querier.release()` when finished, otherwise connections will leak.
387
+ - `Repositories` and `pool.transaction(...)` callbacks automatically handle this, so high-level usage remains unchanged.
388
+ - Unified serialization logic: `@Serialized()` decorator is now centralized in `AbstractSqlQuerier`, removing redundant overrides in drivers.
389
+ - Fixed MongoDB consistency: `beginTransaction`, `commitTransaction`, and `rollbackTransaction` are now serialized to prevent race conditions.
390
+ - Fix Cross-Dialect SQL JSON bug by moving PostgreSQL-specific casts to the appropriate dialect.
391
+ - Fix transaction race conditions by serializing transaction lifecycle methods and implementing an internal execution pattern.
392
+
393
+ ## [1.4.16] - 2025-12-28
394
+
395
+ - Implement a "Serialized Task Queue" at the core of the framework to ensure database connections are thread-safe and race-condition free.
396
+ - Introduce `@Serialized()` decorator to simplify the serialization of database operations across all drivers.
397
+
398
+ ## [1.4.14] - 2025-12-28
399
+
400
+ - Robust `upsert` implementation across all SQL dialects (PostgreSQL, MySQL, MariaDB, SQLite).
401
+
402
+ ## [1.4.10] - 2025-12-27
403
+
404
+ - Improve types, tests, migrate from EsLint/Prettier to Biome, and update dependencies.
405
+
406
+ ## [1.4.6] - 2024-11-06
407
+
408
+ - Update dependencies and improve readme.
409
+
410
+ ## [1.4.5] - 2024-09-26
411
+
412
+ - Imperative transactions have to be closed manually.
413
+
414
+ ## [1.4.4] - 2024-09-26
415
+
416
+ - Ensure own connection is always released even if exception occurs.
417
+ - Correct issue when empty or null list is passed to `insertMany` operations.
418
+
419
+ ## [1.4.3] - 2024-09-25
420
+
421
+ - Ensure the connection is auto-released after `commit` or `rollback` runs.
422
+ - Update dependencies.
423
+
424
+ ## [1.4.2] - 2024-09-20
425
+
426
+ - Fix projection of `@OneToMany` field when the 'one' side produces empty result.
427
+ - Update dependencies.
428
+
429
+ ## [1.4.1] - 2024-08-21
430
+
431
+ - Add nukak-maku logo.
432
+ - Update dependencies (functionality keeps the same in this release).
433
+
434
+ ## [1.4.0] - 2024-08-15
435
+
436
+ - Automatically release the querier unless it is inside a current transaction.
437
+ - Remove unnecessary wrapper for transactions from `AbstractQuerierPool` class.
438
+
439
+ ## [1.3.3] - 2024-08-13
440
+
441
+ - Improve typings of first inserted ID.
442
+
443
+ ## [1.3.2] - 2024-08-13
444
+
445
+ - Return the inserted IDs in the response of the queriers' `run` function.
446
+
447
+ ## [1.3.1] - 2024-08-13
448
+
449
+ - Fix an issue related to the `$where` condition of selected relations missed in the final criteria for `@OneToMany` and `@ManyToMany` relationships.
450
+
451
+ ## [1.3.0] - 2024-08-13
452
+
453
+ - Add support for `json` and `jsonb` fields. Automatically parse the JSON values when persisting with `JSON.parse` function.
454
+ - Improve type-safety in general.
455
+ - Move `getPersistables` inside dialect for higher reusability.
456
+ - Add support for `vector` fields.
457
+
458
+ ## [1.2.0] - 2024-08-12
459
+
460
+ - Add support for `raw` in values (previously, it was only supported by `$select` and `$where` operators). Allows safe use of any SQL query/clause as the value in an insert or update operation that shouldn't be automatically escaped by the ORM.
461
+
462
+ ## [1.1.0] - 2024-08-11
463
+
464
+ - Add support for `upsert` operations.
465
+ - Migrate SQLite package driver from `sqlite3` to `better-sqlite3` for better performance.
466
+ - Make Maria package to use the `RETURNING id` clause to get the inserted IDs.
467
+
468
+ ## [1.0.1] - 2024-08-10
469
+
470
+ - Rename `$project` operator to `$select` for consistency with most established frameworks so far.
471
+ - Rename `$filter` operator to `$where` for consistency with most established frameworks so far.
472
+
473
+ ## [1.0.0] - 2024-08-10
474
+
475
+ - Allow to set a field as non-eager (i.e. lazy) with `eager: false` (by default fields are `eager: true`).
476
+ - Allow to set a field as non-updatable (i.e. insertable and read-only) with `updatable: false` (by default fields are `updatable: true`).
477
+
478
+ ## [0.4.0] - 2023-11-06
479
+
480
+ - Move project inside query parameter [#63](https://github.com/rogerpadilla/nukak/pull/63)
481
+
482
+ ## [0.3.3] - 2023-10-25
483
+
484
+ - Update usage example in the README.md.
485
+
486
+ ## [0.3.2] - 2023-10-24
487
+
488
+ - Improve usage examples in the README.md, and make the overview section more concise.
489
+
490
+ ## [0.3.1] - 2023-10-19
491
+
492
+ 1. Remove `$group` and `$having` as they detriment type safety as currently implemented (support may be redesigned later if required).
493
+ 2. Improve type safety of `$project` operator.
494
+ 3. Improve type safety of `$filter` operator.
495
+ 4. Remove projection operators (`$count`, `$min`, `$max`, `$min`, and `$sum`) as they detriment type safety as currently implemented. This can be done via Virtual fields instead as currently supported for better type safety.
496
+
497
+ ## [0.3.0] - 2023-10-18
498
+
499
+ - Add support for `transaction` operations using a QuerierPool.
500
+ Automatically wraps the code of the callback inside a transaction, and auto-releases the querier after running.
501
+ - Update dependencies.
502
+
503
+ ```ts
504
+ const ids = await pool.transaction(async (querier) => {
505
+ const data = await querier.findMany(...);
506
+ const ids = await querier.insertMany(...);
507
+ return ids;
508
+ });
509
+ ```
510
+
511
+ ## [0.2.21] 2023-04-15
512
+
513
+ - fix(nukak-browser): check if ids are returned before use $in to delete them.
514
+
515
+ - Reuse community open-source npm packages to escape literal-values according to each DB vendor.
516
+
517
+ ## [0.2.0] 2023-01-02
518
+
519
+ - Move projection to a new parameter to improve type inference of the results.
520
+
521
+ - Support dynamic operations while projecting fields, and move `$project` as an independent parameter in the `find*` functions [#55](https://github.com/rogerpadilla/nukak/pull/55).
package/LICENSE.md ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015-present UQL Contributors
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.