@uql/core 3.1.1 → 3.1.3

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 (599) hide show
  1. package/CHANGELOG.md +136 -185
  2. package/{dist/README.md → README.md} +22 -27
  3. package/dist/browser/cc-BEf4wTUm.js +535 -0
  4. package/dist/browser/cc-BEf4wTUm.js.map +1 -0
  5. package/dist/browser/http/bus.d.ts +1 -0
  6. package/dist/browser/http/bus.d.ts.map +1 -0
  7. package/dist/browser/http/bus.js +1 -1
  8. package/dist/browser/http/bus.js.map +1 -0
  9. package/dist/browser/http/http.d.ts +1 -0
  10. package/dist/browser/http/http.d.ts.map +1 -0
  11. package/dist/browser/http/http.js +1 -1
  12. package/dist/browser/http/http.js.map +1 -0
  13. package/dist/browser/http/index.d.ts +1 -0
  14. package/dist/browser/http/index.d.ts.map +1 -0
  15. package/dist/browser/http/index.js +1 -1
  16. package/dist/browser/http/index.js.map +1 -0
  17. package/dist/browser/index.d.ts +1 -0
  18. package/dist/browser/index.d.ts.map +1 -0
  19. package/dist/browser/index.js +1 -1
  20. package/dist/browser/index.js.map +1 -0
  21. package/dist/browser/options.d.ts +1 -0
  22. package/dist/browser/options.d.ts.map +1 -0
  23. package/dist/browser/options.js +1 -1
  24. package/dist/browser/options.js.map +1 -0
  25. package/dist/browser/querier/genericClientRepository.d.ts +1 -0
  26. package/dist/browser/querier/genericClientRepository.d.ts.map +1 -0
  27. package/dist/browser/querier/genericClientRepository.js +1 -1
  28. package/dist/browser/querier/genericClientRepository.js.map +1 -0
  29. package/dist/browser/querier/httpQuerier.d.ts +1 -0
  30. package/dist/browser/querier/httpQuerier.d.ts.map +1 -0
  31. package/dist/browser/querier/httpQuerier.js +1 -1
  32. package/dist/browser/querier/httpQuerier.js.map +1 -0
  33. package/dist/browser/querier/index.d.ts +1 -0
  34. package/dist/browser/querier/index.d.ts.map +1 -0
  35. package/dist/browser/querier/index.js +1 -1
  36. package/dist/browser/querier/index.js.map +1 -0
  37. package/dist/browser/querier/querier.util.d.ts +1 -0
  38. package/dist/browser/querier/querier.util.d.ts.map +1 -0
  39. package/dist/browser/querier/querier.util.js +1 -1
  40. package/dist/browser/querier/querier.util.js.map +1 -0
  41. package/dist/browser/type/clientQuerier.d.ts +1 -0
  42. package/dist/browser/type/clientQuerier.d.ts.map +1 -0
  43. package/dist/browser/type/clientQuerier.js +1 -1
  44. package/dist/browser/type/clientQuerier.js.map +1 -0
  45. package/dist/browser/type/clientQuerierPool.d.ts +1 -0
  46. package/dist/browser/type/clientQuerierPool.d.ts.map +1 -0
  47. package/dist/browser/type/clientQuerierPool.js +1 -1
  48. package/dist/browser/type/clientQuerierPool.js.map +1 -0
  49. package/dist/browser/type/clientRepository.d.ts +1 -0
  50. package/dist/browser/type/clientRepository.d.ts.map +1 -0
  51. package/dist/browser/type/clientRepository.js +1 -1
  52. package/dist/browser/type/clientRepository.js.map +1 -0
  53. package/dist/browser/type/index.d.ts +1 -0
  54. package/dist/browser/type/index.d.ts.map +1 -0
  55. package/dist/browser/type/index.js +1 -1
  56. package/dist/browser/type/index.js.map +1 -0
  57. package/dist/browser/type/request.d.ts +1 -0
  58. package/dist/browser/type/request.d.ts.map +1 -0
  59. package/dist/browser/type/request.js +1 -1
  60. package/dist/browser/type/request.js.map +1 -0
  61. package/dist/dialect/abstractDialect.d.ts +1 -0
  62. package/dist/dialect/abstractDialect.d.ts.map +1 -0
  63. package/dist/dialect/abstractDialect.js +1 -1
  64. package/dist/dialect/abstractDialect.js.map +1 -0
  65. package/dist/dialect/abstractSqlDialect.d.ts +1 -0
  66. package/dist/dialect/abstractSqlDialect.d.ts.map +1 -0
  67. package/dist/dialect/abstractSqlDialect.js +1 -1
  68. package/dist/dialect/abstractSqlDialect.js.map +1 -0
  69. package/dist/dialect/index.d.ts +1 -0
  70. package/dist/dialect/index.d.ts.map +1 -0
  71. package/dist/dialect/index.js +1 -1
  72. package/dist/dialect/index.js.map +1 -0
  73. package/dist/dialect/queryContext.d.ts +1 -0
  74. package/dist/dialect/queryContext.d.ts.map +1 -0
  75. package/dist/dialect/queryContext.js +1 -1
  76. package/dist/dialect/queryContext.js.map +1 -0
  77. package/dist/entity/decorator/definition.d.ts +1 -0
  78. package/dist/entity/decorator/definition.d.ts.map +1 -0
  79. package/dist/entity/decorator/definition.js +1 -2
  80. package/dist/entity/decorator/definition.js.map +1 -0
  81. package/dist/entity/decorator/entity.d.ts +1 -0
  82. package/dist/entity/decorator/entity.d.ts.map +1 -0
  83. package/dist/entity/decorator/entity.js +1 -1
  84. package/dist/entity/decorator/entity.js.map +1 -0
  85. package/dist/entity/decorator/field.d.ts +1 -0
  86. package/dist/entity/decorator/field.d.ts.map +1 -0
  87. package/dist/entity/decorator/field.js +1 -1
  88. package/dist/entity/decorator/field.js.map +1 -0
  89. package/dist/entity/decorator/id.d.ts +1 -0
  90. package/dist/entity/decorator/id.d.ts.map +1 -0
  91. package/dist/entity/decorator/id.js +1 -1
  92. package/dist/entity/decorator/id.js.map +1 -0
  93. package/dist/entity/decorator/index.d.ts +1 -0
  94. package/dist/entity/decorator/index.d.ts.map +1 -0
  95. package/dist/entity/decorator/index.js +1 -1
  96. package/dist/entity/decorator/index.js.map +1 -0
  97. package/dist/entity/decorator/relation.d.ts +1 -0
  98. package/dist/entity/decorator/relation.d.ts.map +1 -0
  99. package/dist/entity/decorator/relation.js +1 -1
  100. package/dist/entity/decorator/relation.js.map +1 -0
  101. package/dist/entity/index.d.ts +1 -0
  102. package/dist/entity/index.d.ts.map +1 -0
  103. package/dist/entity/index.js +1 -1
  104. package/dist/entity/index.js.map +1 -0
  105. package/dist/express/index.d.ts +1 -0
  106. package/dist/express/index.d.ts.map +1 -0
  107. package/dist/express/index.js +1 -1
  108. package/dist/express/index.js.map +1 -0
  109. package/dist/express/querierMiddleware.d.ts +1 -0
  110. package/dist/express/querierMiddleware.d.ts.map +1 -0
  111. package/dist/express/querierMiddleware.js +1 -1
  112. package/dist/express/querierMiddleware.js.map +1 -0
  113. package/dist/express/query.util.d.ts +1 -0
  114. package/dist/express/query.util.d.ts.map +1 -0
  115. package/dist/express/query.util.js +1 -1
  116. package/dist/express/query.util.js.map +1 -0
  117. package/dist/index.d.ts +1 -1
  118. package/dist/index.d.ts.map +1 -0
  119. package/dist/index.js +1 -2
  120. package/dist/index.js.map +1 -0
  121. package/dist/maria/index.d.ts +1 -0
  122. package/dist/maria/index.d.ts.map +1 -0
  123. package/dist/maria/index.js +1 -1
  124. package/dist/maria/index.js.map +1 -0
  125. package/dist/maria/mariaDialect.d.ts +1 -0
  126. package/dist/maria/mariaDialect.d.ts.map +1 -0
  127. package/dist/maria/mariaDialect.js +1 -1
  128. package/dist/maria/mariaDialect.js.map +1 -0
  129. package/dist/maria/mariadbQuerier.d.ts +1 -0
  130. package/dist/maria/mariadbQuerier.d.ts.map +1 -0
  131. package/dist/maria/mariadbQuerier.js +1 -1
  132. package/dist/maria/mariadbQuerier.js.map +1 -0
  133. package/dist/maria/mariadbQuerierPool.d.ts +1 -0
  134. package/dist/maria/mariadbQuerierPool.d.ts.map +1 -0
  135. package/dist/maria/mariadbQuerierPool.js +1 -1
  136. package/dist/maria/mariadbQuerierPool.js.map +1 -0
  137. package/dist/migrate/cli.d.ts +1 -0
  138. package/dist/migrate/cli.d.ts.map +1 -0
  139. package/dist/migrate/cli.js +3 -3
  140. package/dist/migrate/cli.js.map +1 -0
  141. package/dist/migrate/generator/index.d.ts +1 -0
  142. package/dist/migrate/generator/index.d.ts.map +1 -0
  143. package/dist/migrate/generator/index.js +1 -1
  144. package/dist/migrate/generator/index.js.map +1 -0
  145. package/dist/migrate/generator/mongoSchemaGenerator.d.ts +1 -0
  146. package/dist/migrate/generator/mongoSchemaGenerator.d.ts.map +1 -0
  147. package/dist/migrate/generator/mongoSchemaGenerator.js +1 -1
  148. package/dist/migrate/generator/mongoSchemaGenerator.js.map +1 -0
  149. package/dist/migrate/generator/mysqlSchemaGenerator.d.ts +1 -0
  150. package/dist/migrate/generator/mysqlSchemaGenerator.d.ts.map +1 -0
  151. package/dist/migrate/generator/mysqlSchemaGenerator.js +1 -1
  152. package/dist/migrate/generator/mysqlSchemaGenerator.js.map +1 -0
  153. package/dist/migrate/generator/postgresSchemaGenerator.d.ts +1 -0
  154. package/dist/migrate/generator/postgresSchemaGenerator.d.ts.map +1 -0
  155. package/dist/migrate/generator/postgresSchemaGenerator.js +1 -1
  156. package/dist/migrate/generator/postgresSchemaGenerator.js.map +1 -0
  157. package/dist/migrate/generator/sqliteSchemaGenerator.d.ts +1 -0
  158. package/dist/migrate/generator/sqliteSchemaGenerator.d.ts.map +1 -0
  159. package/dist/migrate/generator/sqliteSchemaGenerator.js +1 -1
  160. package/dist/migrate/generator/sqliteSchemaGenerator.js.map +1 -0
  161. package/dist/migrate/index.d.ts +1 -0
  162. package/dist/migrate/index.d.ts.map +1 -0
  163. package/dist/migrate/index.js +1 -1
  164. package/dist/migrate/index.js.map +1 -0
  165. package/dist/migrate/introspection/index.d.ts +1 -0
  166. package/dist/migrate/introspection/index.d.ts.map +1 -0
  167. package/dist/migrate/introspection/index.js +1 -1
  168. package/dist/migrate/introspection/index.js.map +1 -0
  169. package/dist/migrate/introspection/mongoIntrospector.d.ts +1 -0
  170. package/dist/migrate/introspection/mongoIntrospector.d.ts.map +1 -0
  171. package/dist/migrate/introspection/mongoIntrospector.js +1 -1
  172. package/dist/migrate/introspection/mongoIntrospector.js.map +1 -0
  173. package/dist/migrate/introspection/mysqlIntrospector.d.ts +1 -0
  174. package/dist/migrate/introspection/mysqlIntrospector.d.ts.map +1 -0
  175. package/dist/migrate/introspection/mysqlIntrospector.js +1 -1
  176. package/dist/migrate/introspection/mysqlIntrospector.js.map +1 -0
  177. package/dist/migrate/introspection/postgresIntrospector.d.ts +1 -0
  178. package/dist/migrate/introspection/postgresIntrospector.d.ts.map +1 -0
  179. package/dist/migrate/introspection/postgresIntrospector.js +1 -1
  180. package/dist/migrate/introspection/postgresIntrospector.js.map +1 -0
  181. package/dist/migrate/introspection/sqliteIntrospector.d.ts +1 -0
  182. package/dist/migrate/introspection/sqliteIntrospector.d.ts.map +1 -0
  183. package/dist/migrate/introspection/sqliteIntrospector.js +1 -1
  184. package/dist/migrate/introspection/sqliteIntrospector.js.map +1 -0
  185. package/dist/migrate/migrator.d.ts +1 -0
  186. package/dist/migrate/migrator.d.ts.map +1 -0
  187. package/dist/migrate/migrator.js +1 -1
  188. package/dist/migrate/migrator.js.map +1 -0
  189. package/dist/migrate/schemaGenerator.d.ts +1 -0
  190. package/dist/migrate/schemaGenerator.d.ts.map +1 -0
  191. package/dist/migrate/schemaGenerator.js +1 -1
  192. package/dist/migrate/schemaGenerator.js.map +1 -0
  193. package/dist/migrate/storage/databaseStorage.d.ts +1 -0
  194. package/dist/migrate/storage/databaseStorage.d.ts.map +1 -0
  195. package/dist/migrate/storage/databaseStorage.js +1 -1
  196. package/dist/migrate/storage/databaseStorage.js.map +1 -0
  197. package/dist/migrate/storage/index.d.ts +1 -0
  198. package/dist/migrate/storage/index.d.ts.map +1 -0
  199. package/dist/migrate/storage/index.js +1 -1
  200. package/dist/migrate/storage/index.js.map +1 -0
  201. package/dist/migrate/storage/jsonStorage.d.ts +1 -0
  202. package/dist/migrate/storage/jsonStorage.d.ts.map +1 -0
  203. package/dist/migrate/storage/jsonStorage.js +1 -1
  204. package/dist/migrate/storage/jsonStorage.js.map +1 -0
  205. package/dist/migrate/type.d.ts +1 -0
  206. package/dist/migrate/type.d.ts.map +1 -0
  207. package/dist/migrate/type.js +1 -1
  208. package/dist/migrate/type.js.map +1 -0
  209. package/dist/mongo/index.d.ts +1 -0
  210. package/dist/mongo/index.d.ts.map +1 -0
  211. package/dist/mongo/index.js +1 -1
  212. package/dist/mongo/index.js.map +1 -0
  213. package/dist/mongo/mongoDialect.d.ts +1 -0
  214. package/dist/mongo/mongoDialect.d.ts.map +1 -0
  215. package/dist/mongo/mongoDialect.js +1 -1
  216. package/dist/mongo/mongoDialect.js.map +1 -0
  217. package/dist/mongo/mongodbQuerier.d.ts +1 -0
  218. package/dist/mongo/mongodbQuerier.d.ts.map +1 -0
  219. package/dist/mongo/mongodbQuerier.js +1 -1
  220. package/dist/mongo/mongodbQuerier.js.map +1 -0
  221. package/dist/mongo/mongodbQuerierPool.d.ts +1 -0
  222. package/dist/mongo/mongodbQuerierPool.d.ts.map +1 -0
  223. package/dist/mongo/mongodbQuerierPool.js +1 -1
  224. package/dist/mongo/mongodbQuerierPool.js.map +1 -0
  225. package/dist/mysql/index.d.ts +1 -0
  226. package/dist/mysql/index.d.ts.map +1 -0
  227. package/dist/mysql/index.js +1 -1
  228. package/dist/mysql/index.js.map +1 -0
  229. package/dist/mysql/mysql2Querier.d.ts +1 -0
  230. package/dist/mysql/mysql2Querier.d.ts.map +1 -0
  231. package/dist/mysql/mysql2Querier.js +1 -1
  232. package/dist/mysql/mysql2Querier.js.map +1 -0
  233. package/dist/mysql/mysql2QuerierPool.d.ts +1 -0
  234. package/dist/mysql/mysql2QuerierPool.d.ts.map +1 -0
  235. package/dist/mysql/mysql2QuerierPool.js +1 -1
  236. package/dist/mysql/mysql2QuerierPool.js.map +1 -0
  237. package/dist/mysql/mysqlDialect.d.ts +1 -0
  238. package/dist/mysql/mysqlDialect.d.ts.map +1 -0
  239. package/dist/mysql/mysqlDialect.js +1 -1
  240. package/dist/mysql/mysqlDialect.js.map +1 -0
  241. package/dist/namingStrategy/defaultNamingStrategy.d.ts +1 -0
  242. package/dist/namingStrategy/defaultNamingStrategy.d.ts.map +1 -0
  243. package/dist/namingStrategy/defaultNamingStrategy.js +1 -1
  244. package/dist/namingStrategy/defaultNamingStrategy.js.map +1 -0
  245. package/dist/namingStrategy/index.d.ts +1 -0
  246. package/dist/namingStrategy/index.d.ts.map +1 -0
  247. package/dist/namingStrategy/index.js +1 -1
  248. package/dist/namingStrategy/index.js.map +1 -0
  249. package/dist/namingStrategy/snakeCaseNamingStrategy.d.ts +1 -0
  250. package/dist/namingStrategy/snakeCaseNamingStrategy.d.ts.map +1 -0
  251. package/dist/namingStrategy/snakeCaseNamingStrategy.js +1 -1
  252. package/dist/namingStrategy/snakeCaseNamingStrategy.js.map +1 -0
  253. package/dist/options.d.ts +1 -0
  254. package/dist/options.d.ts.map +1 -0
  255. package/dist/options.js +1 -1
  256. package/dist/options.js.map +1 -0
  257. package/dist/postgres/index.d.ts +1 -0
  258. package/dist/postgres/index.d.ts.map +1 -0
  259. package/dist/postgres/index.js +1 -1
  260. package/dist/postgres/index.js.map +1 -0
  261. package/dist/postgres/pgQuerier.d.ts +1 -0
  262. package/dist/postgres/pgQuerier.d.ts.map +1 -0
  263. package/dist/postgres/pgQuerier.js +1 -1
  264. package/dist/postgres/pgQuerier.js.map +1 -0
  265. package/dist/postgres/pgQuerierPool.d.ts +1 -0
  266. package/dist/postgres/pgQuerierPool.d.ts.map +1 -0
  267. package/dist/postgres/pgQuerierPool.js +1 -1
  268. package/dist/postgres/pgQuerierPool.js.map +1 -0
  269. package/dist/postgres/postgresDialect.d.ts +1 -0
  270. package/dist/postgres/postgresDialect.d.ts.map +1 -0
  271. package/dist/postgres/postgresDialect.js +1 -1
  272. package/dist/postgres/postgresDialect.js.map +1 -0
  273. package/dist/querier/abstractQuerier.d.ts +1 -0
  274. package/dist/querier/abstractQuerier.d.ts.map +1 -0
  275. package/dist/querier/abstractQuerier.js +1 -1
  276. package/dist/querier/abstractQuerier.js.map +1 -0
  277. package/dist/querier/abstractQuerierPool.d.ts +1 -0
  278. package/dist/querier/abstractQuerierPool.d.ts.map +1 -0
  279. package/dist/querier/abstractQuerierPool.js +1 -1
  280. package/dist/querier/abstractQuerierPool.js.map +1 -0
  281. package/dist/querier/abstractSqlQuerier.d.ts +1 -0
  282. package/dist/querier/abstractSqlQuerier.d.ts.map +1 -0
  283. package/dist/querier/abstractSqlQuerier.js +1 -1
  284. package/dist/querier/abstractSqlQuerier.js.map +1 -0
  285. package/dist/querier/decorator/index.d.ts +1 -0
  286. package/dist/querier/decorator/index.d.ts.map +1 -0
  287. package/dist/querier/decorator/index.js +1 -1
  288. package/dist/querier/decorator/index.js.map +1 -0
  289. package/dist/querier/decorator/injectQuerier.d.ts +1 -0
  290. package/dist/querier/decorator/injectQuerier.d.ts.map +1 -0
  291. package/dist/querier/decorator/injectQuerier.js +1 -1
  292. package/dist/querier/decorator/injectQuerier.js.map +1 -0
  293. package/dist/querier/decorator/serialized.d.ts +1 -0
  294. package/dist/querier/decorator/serialized.d.ts.map +1 -0
  295. package/dist/querier/decorator/serialized.js +1 -1
  296. package/dist/querier/decorator/serialized.js.map +1 -0
  297. package/dist/querier/decorator/transactional.d.ts +1 -0
  298. package/dist/querier/decorator/transactional.d.ts.map +1 -0
  299. package/dist/querier/decorator/transactional.js +1 -1
  300. package/dist/querier/decorator/transactional.js.map +1 -0
  301. package/dist/querier/index.d.ts +1 -0
  302. package/dist/querier/index.d.ts.map +1 -0
  303. package/dist/querier/index.js +1 -1
  304. package/dist/querier/index.js.map +1 -0
  305. package/dist/repository/genericRepository.d.ts +1 -0
  306. package/dist/repository/genericRepository.d.ts.map +1 -0
  307. package/dist/repository/genericRepository.js +1 -1
  308. package/dist/repository/genericRepository.js.map +1 -0
  309. package/dist/repository/index.d.ts +1 -0
  310. package/dist/repository/index.d.ts.map +1 -0
  311. package/dist/repository/index.js +1 -1
  312. package/dist/repository/index.js.map +1 -0
  313. package/dist/sqlite/index.d.ts +1 -0
  314. package/dist/sqlite/index.d.ts.map +1 -0
  315. package/dist/sqlite/index.js +1 -1
  316. package/dist/sqlite/index.js.map +1 -0
  317. package/dist/sqlite/sqliteDialect.d.ts +1 -0
  318. package/dist/sqlite/sqliteDialect.d.ts.map +1 -0
  319. package/dist/sqlite/sqliteDialect.js +1 -1
  320. package/dist/sqlite/sqliteDialect.js.map +1 -0
  321. package/dist/sqlite/sqliteQuerier.d.ts +1 -0
  322. package/dist/sqlite/sqliteQuerier.d.ts.map +1 -0
  323. package/dist/sqlite/sqliteQuerier.js +1 -1
  324. package/dist/sqlite/sqliteQuerier.js.map +1 -0
  325. package/dist/sqlite/sqliteQuerierPool.d.ts +1 -0
  326. package/dist/sqlite/sqliteQuerierPool.d.ts.map +1 -0
  327. package/dist/sqlite/sqliteQuerierPool.js +1 -1
  328. package/dist/sqlite/sqliteQuerierPool.js.map +1 -0
  329. package/dist/type/entity.d.ts +1 -0
  330. package/dist/type/entity.d.ts.map +1 -0
  331. package/dist/type/entity.js +1 -1
  332. package/dist/type/entity.js.map +1 -0
  333. package/dist/type/index.d.ts +1 -0
  334. package/dist/type/index.d.ts.map +1 -0
  335. package/dist/type/index.js +1 -1
  336. package/dist/type/index.js.map +1 -0
  337. package/dist/type/migration.d.ts +1 -0
  338. package/dist/type/migration.d.ts.map +1 -0
  339. package/dist/type/migration.js +1 -1
  340. package/dist/type/migration.js.map +1 -0
  341. package/dist/type/namingStrategy.d.ts +1 -0
  342. package/dist/type/namingStrategy.d.ts.map +1 -0
  343. package/dist/type/namingStrategy.js +1 -1
  344. package/dist/type/namingStrategy.js.map +1 -0
  345. package/dist/type/querier.d.ts +1 -0
  346. package/dist/type/querier.d.ts.map +1 -0
  347. package/dist/type/querier.js +1 -1
  348. package/dist/type/querier.js.map +1 -0
  349. package/dist/type/querierPool.d.ts +1 -0
  350. package/dist/type/querierPool.d.ts.map +1 -0
  351. package/dist/type/querierPool.js +1 -1
  352. package/dist/type/querierPool.js.map +1 -0
  353. package/dist/type/query.d.ts +1 -0
  354. package/dist/type/query.d.ts.map +1 -0
  355. package/dist/type/query.js +1 -1
  356. package/dist/type/query.js.map +1 -0
  357. package/dist/type/repository.d.ts +1 -0
  358. package/dist/type/repository.d.ts.map +1 -0
  359. package/dist/type/repository.js +1 -1
  360. package/dist/type/repository.js.map +1 -0
  361. package/dist/type/universalQuerier.d.ts +1 -0
  362. package/dist/type/universalQuerier.d.ts.map +1 -0
  363. package/dist/type/universalQuerier.js +1 -1
  364. package/dist/type/universalQuerier.js.map +1 -0
  365. package/dist/type/utility.d.ts +1 -0
  366. package/dist/type/utility.d.ts.map +1 -0
  367. package/dist/type/utility.js +1 -1
  368. package/dist/type/utility.js.map +1 -0
  369. package/dist/util/dialect.util.d.ts +1 -0
  370. package/dist/util/dialect.util.d.ts.map +1 -0
  371. package/dist/util/dialect.util.js +1 -1
  372. package/dist/util/dialect.util.js.map +1 -0
  373. package/dist/util/index.d.ts +1 -0
  374. package/dist/util/index.d.ts.map +1 -0
  375. package/dist/util/index.js +1 -1
  376. package/dist/util/index.js.map +1 -0
  377. package/dist/util/object.util.d.ts +1 -0
  378. package/dist/util/object.util.d.ts.map +1 -0
  379. package/dist/util/object.util.js +1 -1
  380. package/dist/util/object.util.js.map +1 -0
  381. package/dist/util/raw.d.ts +1 -0
  382. package/dist/util/raw.d.ts.map +1 -0
  383. package/dist/util/raw.js +1 -1
  384. package/dist/util/raw.js.map +1 -0
  385. package/dist/util/sql.util.d.ts +1 -0
  386. package/dist/util/sql.util.d.ts.map +1 -0
  387. package/dist/util/sql.util.js +1 -1
  388. package/dist/util/sql.util.js.map +1 -0
  389. package/dist/util/string.util.d.ts +1 -0
  390. package/dist/util/string.util.d.ts.map +1 -0
  391. package/dist/util/string.util.js +1 -1
  392. package/dist/util/string.util.js.map +1 -0
  393. package/package.json +32 -26
  394. package/dist/CHANGELOG.md +0 -186
  395. package/dist/maria/mariaQuerierPool.test.d.ts +0 -5
  396. package/dist/maria/mariaQuerierPool.test.js +0 -19
  397. package/dist/maria/mariadbQuerier.test.d.ts +0 -4
  398. package/dist/maria/mariadbQuerier.test.js +0 -19
  399. package/dist/migrate/migrator-mongo.test.d.ts +0 -1
  400. package/dist/migrate/migrator-mongo.test.js +0 -54
  401. package/dist/migrate/migrator.test.d.ts +0 -1
  402. package/dist/migrate/migrator.test.js +0 -106
  403. package/dist/mongo/mongodbQuerier.test.d.ts +0 -1
  404. package/dist/mongo/mongodbQuerier.test.js +0 -36
  405. package/dist/mongo/mongodbQuerierPool.test.d.ts +0 -1
  406. package/dist/mongo/mongodbQuerierPool.test.js +0 -21
  407. package/dist/mysql/mysql2Querier.test.d.ts +0 -4
  408. package/dist/mysql/mysql2Querier.test.js +0 -16
  409. package/dist/mysql/mysql2QuerierPool.test.d.ts +0 -5
  410. package/dist/mysql/mysql2QuerierPool.test.js +0 -16
  411. package/dist/package.json +0 -131
  412. package/dist/postgres/pgQuerier.test.d.ts +0 -4
  413. package/dist/postgres/pgQuerier.test.js +0 -20
  414. package/dist/postgres/pgQuerierPool.test.d.ts +0 -5
  415. package/dist/postgres/pgQuerierPool.test.js +0 -23
  416. package/dist/querier/abstractQuerier-test.d.ts +0 -45
  417. package/dist/querier/abstractQuerier-test.js +0 -461
  418. package/dist/querier/abstractQuerierPool-test.d.ts +0 -9
  419. package/dist/querier/abstractQuerierPool-test.js +0 -18
  420. package/dist/querier/abstractSqlQuerier-test.d.ts +0 -9
  421. package/dist/querier/abstractSqlQuerier-test.js +0 -16
  422. package/dist/sqlite/sqliteQuerier.test.d.ts +0 -5
  423. package/dist/sqlite/sqliteQuerier.test.js +0 -19
  424. package/dist/sqlite/sqliteQuerierPool.test.d.ts +0 -5
  425. package/dist/sqlite/sqliteQuerierPool.test.js +0 -10
  426. package/dist/test/entityMock.d.ts +0 -164
  427. package/dist/test/entityMock.js +0 -554
  428. package/dist/test/index.d.ts +0 -3
  429. package/dist/test/index.js +0 -4
  430. package/dist/test/it.util.d.ts +0 -4
  431. package/dist/test/it.util.js +0 -55
  432. package/dist/test/spec.util.d.ts +0 -14
  433. package/dist/test/spec.util.js +0 -50
  434. package/src/@types/index.d.ts +0 -1
  435. package/src/@types/jest.d.ts +0 -6
  436. package/src/browser/http/bus.spec.ts +0 -22
  437. package/src/browser/http/bus.ts +0 -17
  438. package/src/browser/http/http.spec.ts +0 -70
  439. package/src/browser/http/http.ts +0 -55
  440. package/src/browser/http/index.ts +0 -2
  441. package/src/browser/index.ts +0 -4
  442. package/src/browser/options.spec.ts +0 -37
  443. package/src/browser/options.ts +0 -18
  444. package/src/browser/querier/genericClientRepository.spec.ts +0 -105
  445. package/src/browser/querier/genericClientRepository.ts +0 -49
  446. package/src/browser/querier/httpQuerier.ts +0 -82
  447. package/src/browser/querier/index.ts +0 -3
  448. package/src/browser/querier/querier.util.spec.ts +0 -35
  449. package/src/browser/querier/querier.util.ts +0 -18
  450. package/src/browser/type/clientQuerier.ts +0 -45
  451. package/src/browser/type/clientQuerierPool.ts +0 -5
  452. package/src/browser/type/clientRepository.ts +0 -22
  453. package/src/browser/type/index.ts +0 -4
  454. package/src/browser/type/request.ts +0 -25
  455. package/src/dialect/abstractDialect.ts +0 -28
  456. package/src/dialect/abstractSqlDialect-spec.ts +0 -1309
  457. package/src/dialect/abstractSqlDialect.ts +0 -805
  458. package/src/dialect/index.ts +0 -3
  459. package/src/dialect/namingStrategy.spec.ts +0 -52
  460. package/src/dialect/queryContext.ts +0 -69
  461. package/src/entity/decorator/definition.spec.ts +0 -736
  462. package/src/entity/decorator/definition.ts +0 -265
  463. package/src/entity/decorator/entity.ts +0 -8
  464. package/src/entity/decorator/field.ts +0 -9
  465. package/src/entity/decorator/id.ts +0 -9
  466. package/src/entity/decorator/index.ts +0 -5
  467. package/src/entity/decorator/relation.spec.ts +0 -41
  468. package/src/entity/decorator/relation.ts +0 -34
  469. package/src/entity/index.ts +0 -1
  470. package/src/express/@types/express.d.ts +0 -8
  471. package/src/express/@types/index.d.ts +0 -1
  472. package/src/express/index.ts +0 -2
  473. package/src/express/querierMiddleware.ts +0 -217
  474. package/src/express/query.util.spec.ts +0 -40
  475. package/src/express/query.util.ts +0 -21
  476. package/src/index.ts +0 -9
  477. package/src/maria/index.ts +0 -3
  478. package/src/maria/mariaDialect.spec.ts +0 -207
  479. package/src/maria/mariaDialect.ts +0 -42
  480. package/src/maria/mariaQuerierPool.test.ts +0 -23
  481. package/src/maria/mariadbQuerier.test.ts +0 -23
  482. package/src/maria/mariadbQuerier.ts +0 -45
  483. package/src/maria/mariadbQuerierPool.ts +0 -21
  484. package/src/migrate/cli.ts +0 -301
  485. package/src/migrate/generator/index.ts +0 -4
  486. package/src/migrate/generator/mongoSchemaGenerator.spec.ts +0 -112
  487. package/src/migrate/generator/mongoSchemaGenerator.ts +0 -115
  488. package/src/migrate/generator/mysqlSchemaGenerator.spec.ts +0 -34
  489. package/src/migrate/generator/mysqlSchemaGenerator.ts +0 -92
  490. package/src/migrate/generator/postgresSchemaGenerator.spec.ts +0 -44
  491. package/src/migrate/generator/postgresSchemaGenerator.ts +0 -127
  492. package/src/migrate/generator/sqliteSchemaGenerator.spec.ts +0 -33
  493. package/src/migrate/generator/sqliteSchemaGenerator.ts +0 -81
  494. package/src/migrate/index.ts +0 -41
  495. package/src/migrate/introspection/index.ts +0 -4
  496. package/src/migrate/introspection/mongoIntrospector.spec.ts +0 -75
  497. package/src/migrate/introspection/mongoIntrospector.ts +0 -47
  498. package/src/migrate/introspection/mysqlIntrospector.spec.ts +0 -113
  499. package/src/migrate/introspection/mysqlIntrospector.ts +0 -278
  500. package/src/migrate/introspection/postgresIntrospector.spec.ts +0 -112
  501. package/src/migrate/introspection/postgresIntrospector.ts +0 -329
  502. package/src/migrate/introspection/sqliteIntrospector.spec.ts +0 -112
  503. package/src/migrate/introspection/sqliteIntrospector.ts +0 -296
  504. package/src/migrate/migrator-mongo.test.ts +0 -54
  505. package/src/migrate/migrator.spec.ts +0 -255
  506. package/src/migrate/migrator.test.ts +0 -94
  507. package/src/migrate/migrator.ts +0 -719
  508. package/src/migrate/namingStrategy.spec.ts +0 -22
  509. package/src/migrate/schemaGenerator-advanced.spec.ts +0 -138
  510. package/src/migrate/schemaGenerator.spec.ts +0 -190
  511. package/src/migrate/schemaGenerator.ts +0 -478
  512. package/src/migrate/storage/databaseStorage.spec.ts +0 -69
  513. package/src/migrate/storage/databaseStorage.ts +0 -100
  514. package/src/migrate/storage/index.ts +0 -2
  515. package/src/migrate/storage/jsonStorage.ts +0 -58
  516. package/src/migrate/type.ts +0 -1
  517. package/src/mongo/index.ts +0 -3
  518. package/src/mongo/mongoDialect.spec.ts +0 -251
  519. package/src/mongo/mongoDialect.ts +0 -238
  520. package/src/mongo/mongodbQuerier.test.ts +0 -45
  521. package/src/mongo/mongodbQuerier.ts +0 -256
  522. package/src/mongo/mongodbQuerierPool.test.ts +0 -25
  523. package/src/mongo/mongodbQuerierPool.ts +0 -24
  524. package/src/mysql/index.ts +0 -3
  525. package/src/mysql/mysql2Querier.test.ts +0 -20
  526. package/src/mysql/mysql2Querier.ts +0 -49
  527. package/src/mysql/mysql2QuerierPool.test.ts +0 -20
  528. package/src/mysql/mysql2QuerierPool.ts +0 -21
  529. package/src/mysql/mysqlDialect.spec.ts +0 -20
  530. package/src/mysql/mysqlDialect.ts +0 -16
  531. package/src/namingStrategy/defaultNamingStrategy.ts +0 -18
  532. package/src/namingStrategy/index.spec.ts +0 -36
  533. package/src/namingStrategy/index.ts +0 -2
  534. package/src/namingStrategy/snakeCaseNamingStrategy.ts +0 -15
  535. package/src/options.spec.ts +0 -41
  536. package/src/options.ts +0 -18
  537. package/src/postgres/index.ts +0 -3
  538. package/src/postgres/manual-types.d.ts +0 -4
  539. package/src/postgres/pgQuerier.test.ts +0 -25
  540. package/src/postgres/pgQuerier.ts +0 -45
  541. package/src/postgres/pgQuerierPool.test.ts +0 -28
  542. package/src/postgres/pgQuerierPool.ts +0 -21
  543. package/src/postgres/postgresDialect.spec.ts +0 -428
  544. package/src/postgres/postgresDialect.ts +0 -144
  545. package/src/querier/abstractQuerier-test.ts +0 -584
  546. package/src/querier/abstractQuerier.ts +0 -353
  547. package/src/querier/abstractQuerierPool-test.ts +0 -20
  548. package/src/querier/abstractQuerierPool.ts +0 -18
  549. package/src/querier/abstractSqlQuerier-spec.ts +0 -979
  550. package/src/querier/abstractSqlQuerier-test.ts +0 -21
  551. package/src/querier/abstractSqlQuerier.ts +0 -138
  552. package/src/querier/decorator/index.ts +0 -3
  553. package/src/querier/decorator/injectQuerier.spec.ts +0 -74
  554. package/src/querier/decorator/injectQuerier.ts +0 -45
  555. package/src/querier/decorator/serialized.spec.ts +0 -98
  556. package/src/querier/decorator/serialized.ts +0 -13
  557. package/src/querier/decorator/transactional.spec.ts +0 -240
  558. package/src/querier/decorator/transactional.ts +0 -56
  559. package/src/querier/index.ts +0 -4
  560. package/src/repository/genericRepository.spec.ts +0 -111
  561. package/src/repository/genericRepository.ts +0 -74
  562. package/src/repository/index.ts +0 -1
  563. package/src/sqlite/index.ts +0 -3
  564. package/src/sqlite/manual-types.d.ts +0 -4
  565. package/src/sqlite/sqliteDialect.spec.ts +0 -155
  566. package/src/sqlite/sqliteDialect.ts +0 -76
  567. package/src/sqlite/sqliteQuerier.spec.ts +0 -36
  568. package/src/sqlite/sqliteQuerier.test.ts +0 -21
  569. package/src/sqlite/sqliteQuerier.ts +0 -37
  570. package/src/sqlite/sqliteQuerierPool.test.ts +0 -12
  571. package/src/sqlite/sqliteQuerierPool.ts +0 -38
  572. package/src/test/entityMock.ts +0 -375
  573. package/src/test/index.ts +0 -3
  574. package/src/test/it.util.ts +0 -69
  575. package/src/test/spec.util.ts +0 -57
  576. package/src/type/entity.ts +0 -218
  577. package/src/type/index.ts +0 -9
  578. package/src/type/migration.ts +0 -241
  579. package/src/type/namingStrategy.ts +0 -17
  580. package/src/type/querier.ts +0 -143
  581. package/src/type/querierPool.ts +0 -26
  582. package/src/type/query.ts +0 -506
  583. package/src/type/repository.ts +0 -142
  584. package/src/type/universalQuerier.ts +0 -133
  585. package/src/type/utility.ts +0 -21
  586. package/src/util/dialect.util-extra.spec.ts +0 -96
  587. package/src/util/dialect.util.spec.ts +0 -23
  588. package/src/util/dialect.util.ts +0 -134
  589. package/src/util/index.ts +0 -5
  590. package/src/util/object.util.spec.ts +0 -29
  591. package/src/util/object.util.ts +0 -27
  592. package/src/util/raw.ts +0 -11
  593. package/src/util/sql.util-extra.spec.ts +0 -17
  594. package/src/util/sql.util.spec.ts +0 -208
  595. package/src/util/sql.util.ts +0 -104
  596. package/src/util/string.util.spec.ts +0 -46
  597. package/src/util/string.util.ts +0 -35
  598. package/tsconfig.build.json +0 -5
  599. package/tsconfig.json +0 -8
package/src/type/query.ts DELETED
@@ -1,506 +0,0 @@
1
- import type { FieldKey, IdValue, Key, RelationKey } from './entity.js';
2
- import type { BooleanLike, ExpandScalar, Scalar, Type, Unpacked } from './utility.js';
3
-
4
- export type QueryOptions = {
5
- /**
6
- * use or omit `softDelete` attribute.
7
- */
8
- softDelete?: boolean;
9
- /**
10
- * prefix the query with this.
11
- */
12
- prefix?: string;
13
- /**
14
- * automatically infer the prefix for the query.
15
- */
16
- autoPrefix?: boolean;
17
- };
18
-
19
- export type QuerySelectOptions = {
20
- /**
21
- * prefix the query with this.
22
- */
23
- prefix?: string;
24
- /**
25
- * automatically add the prefix for the alias.
26
- */
27
- autoPrefixAlias?: boolean;
28
- };
29
-
30
- /**
31
- * query selection as an array.
32
- */
33
- export type QuerySelectArray<E> = (Key<E> | QueryRaw)[];
34
-
35
- /**
36
- * query selection as a map.
37
- */
38
- export type QuerySelectMap<E> = QuerySelectFieldMap<E> | QuerySelectRelationMap<E>;
39
-
40
- /**
41
- * query selection.
42
- */
43
- export type QuerySelect<E> = QuerySelectArray<E> | QuerySelectMap<E>;
44
-
45
- /**
46
- * query selection of fields as a map.
47
- */
48
- export type QuerySelectFieldMap<E> = {
49
- [K in FieldKey<E>]?: BooleanLike;
50
- };
51
-
52
- /**
53
- * query conflict paths map.
54
- */
55
- export type QueryConflictPathsMap<E> = {
56
- [K in FieldKey<E>]?: true;
57
- };
58
-
59
- /**
60
- * query conflict paths.
61
- */
62
- export type QueryConflictPaths<E> = QueryConflictPathsMap<E>;
63
-
64
- /**
65
- * query selection of relations as a map.
66
- */
67
- export type QuerySelectRelationMap<E> = {
68
- [K in RelationKey<E>]?: BooleanLike | Key<Unpacked<E[K]>>[] | QuerySelectRelationOptions<E[K]>;
69
- };
70
-
71
- /**
72
- * options to select a relation.
73
- */
74
- export type QuerySelectRelationOptions<E> = (E extends unknown[] ? Query<Unpacked<E>> : QueryUnique<Unpacked<E>>) & {
75
- $required?: boolean;
76
- };
77
-
78
- /**
79
- * options for full-text-search operator.
80
- */
81
- export type QueryTextSearchOptions<E> = {
82
- /**
83
- * text to search for.
84
- */
85
- $value: string;
86
- /**
87
- * list of fields to search on.
88
- */
89
- $fields?: FieldKey<E>[];
90
- };
91
-
92
- /**
93
- * comparison by fields.
94
- */
95
- export type QueryWhereFieldMap<E> = { [K in FieldKey<E>]?: QueryWhereFieldValue<E[K]> };
96
-
97
- /**
98
- * complex operators.
99
- */
100
- export type QueryWhereMap<E> = QueryWhereFieldMap<E> & QueryWhereRootOperator<E>;
101
-
102
- export type QueryWhereRootOperator<E> = {
103
- /**
104
- * joins query clauses with a logical `AND`, returns records that match all the clauses.
105
- */
106
- $and?: QueryWhereArray<E>;
107
- /**
108
- * joins query clauses with a logical `OR`, returns records that match any of the clauses.
109
- */
110
- $or?: QueryWhereArray<E>;
111
- /**
112
- * joins query clauses with a logical `AND`, returns records that do not match all the clauses.
113
- */
114
- $not?: QueryWhereArray<E>;
115
- /**
116
- * joins query clauses with a logical `OR`, returns records that do not match any of the clauses.
117
- */
118
- $nor?: QueryWhereArray<E>;
119
- /**
120
- * whether the specified fields match against a full-text search of the given string.
121
- */
122
- $text?: QueryTextSearchOptions<E>;
123
- /**
124
- * whether the record exists in the given sub-query.
125
- */
126
- $exists?: QueryRaw;
127
- /**
128
- * whether the record does not exists in the given sub-query.
129
- */
130
- $nexists?: QueryRaw;
131
- };
132
-
133
- export type QueryWhereFieldOperatorMap<T> = {
134
- /**
135
- * whether a value is equal to the given value.
136
- */
137
- $eq?: ExpandScalar<T>;
138
- /**
139
- * whether a value is not equal to the given value.
140
- */
141
- $ne?: ExpandScalar<T>;
142
- /**
143
- * negates the given comparison.
144
- */
145
- $not?: QueryWhereFieldValue<T>;
146
- /**
147
- * whether a value is less than the given value.
148
- */
149
- $lt?: ExpandScalar<T>;
150
- /**
151
- * whether a value is less than or equal to the given value.
152
- */
153
- $lte?: ExpandScalar<T>;
154
- /**
155
- * whether a value is greater than the given value.
156
- */
157
- $gt?: ExpandScalar<T>;
158
- /**
159
- * whether a value is greater than or equal to the given value.
160
- */
161
- $gte?: ExpandScalar<T>;
162
- /**
163
- * whether a string begins with the given string (case sensitive).
164
- */
165
- $startsWith?: string;
166
- /**
167
- * whether a string begins with the given string (case insensitive).
168
- */
169
- $istartsWith?: string;
170
- /**
171
- * whether a string ends with the given string (case sensitive).
172
- */
173
- $endsWith?: string;
174
- /**
175
- * whether a string ends with the given string (case insensitive).
176
- */
177
- $iendsWith?: string;
178
- /**
179
- * whether a string is contained within the given string (case sensitive).
180
- */
181
- $includes?: string;
182
- /**
183
- * whether a string is contained within the given string (case insensitive).
184
- */
185
- $iincludes?: string;
186
- /**
187
- * whether a string fulfills the given pattern (case sensitive).
188
- */
189
- $like?: string;
190
- /**
191
- * whether a string fulfills the given pattern (case insensitive).
192
- */
193
- $ilike?: string;
194
- /**
195
- * whether a string matches the given regular expression.
196
- */
197
- $regex?: string;
198
- /**
199
- * whether a value matches any of the given values.
200
- */
201
- $in?: ExpandScalar<T>[];
202
- /**
203
- * whether a value does not match any of the given values.
204
- */
205
- $nin?: ExpandScalar<T>[];
206
- };
207
-
208
- /**
209
- * Value for a field comparison.
210
- */
211
- export type QueryWhereFieldValue<T> = T | T[] | QueryWhereFieldOperatorMap<T> | QueryRaw;
212
-
213
- /**
214
- * query single filter.
215
- */
216
- export type QueryWhereSingle<E> = IdValue<E> | IdValue<E>[] | QueryWhereMap<E> | QueryRaw;
217
-
218
- /**
219
- * query filter array.
220
- */
221
- export type QueryWhereArray<E> = QueryWhereSingle<E>[];
222
-
223
- /**
224
- * query filter.
225
- */
226
- export type QueryWhere<E> = QueryWhereSingle<E> | QueryWhereArray<E>;
227
-
228
- /**
229
- * direction for the sort.
230
- */
231
- export type QuerySortDirection = -1 | 1 | 'asc' | 'desc';
232
-
233
- /**
234
- * sort by tuples
235
- */
236
- export type QuerySortTuples<E> = [FieldKey<E>, QuerySortDirection][];
237
-
238
- /**
239
- * sort by objects.
240
- */
241
- export type QuerySortObjects<E> = { field: FieldKey<E>; sort: QuerySortDirection }[];
242
-
243
- /**
244
- * sort by fields.
245
- */
246
- export type QuerySortFieldMap<E> = {
247
- [K in FieldKey<E>]?: QuerySortDirection;
248
- };
249
-
250
- /**
251
- * sort by relations fields.
252
- */
253
- export type QuerySortRelationMap<E> = {
254
- [K in RelationKey<E>]?: QuerySortMap<Unpacked<E[K]>>;
255
- };
256
-
257
- /**
258
- * sort by map.
259
- */
260
- export type QuerySortMap<E> = QuerySortFieldMap<E> | QuerySortRelationMap<E>;
261
-
262
- /**
263
- * sort options.
264
- */
265
- export type QuerySort<E> = QuerySortMap<E> | QuerySortTuples<E> | QuerySortObjects<E>;
266
-
267
- /**
268
- * pager options.
269
- */
270
- export type QueryPager = {
271
- /**
272
- * Index from where start the search
273
- */
274
- $skip?: number;
275
-
276
- /**
277
- * Max number of records to retrieve
278
- */
279
- $limit?: number;
280
- };
281
-
282
- /**
283
- * search options.
284
- */
285
- export type QuerySearch<E> = {
286
- /**
287
- * filtering options.
288
- */
289
- $where?: QueryWhere<E>;
290
-
291
- /**
292
- * sorting options.
293
- */
294
- $sort?: QuerySort<E>;
295
- } & QueryPager;
296
-
297
- /**
298
- * criteria one options.
299
- */
300
- export type QuerySearchOne<E> = Omit<QuerySearch<E>, '$limit'>;
301
-
302
- /**
303
- * query options.
304
- */
305
- export type Query<E> = {
306
- /**
307
- * selection options.
308
- */
309
- $select?: QuerySelect<E>;
310
- } & QuerySearch<E>;
311
-
312
- /**
313
- * options to get a single record.
314
- */
315
- export type QueryOne<E> = Omit<Query<E>, '$limit'>;
316
-
317
- /**
318
- * options to get an unique record.
319
- */
320
- export type QueryUnique<E> = Pick<QueryOne<E>, '$select' | '$where'>;
321
-
322
- /**
323
- * stringified query.
324
- */
325
- export type QueryStringified = {
326
- [K in keyof Query<unknown>]?: string;
327
- };
328
-
329
- /**
330
- * result of an update operation.
331
- */
332
- export type QueryUpdateResult = {
333
- /**
334
- * number of affected records.
335
- */
336
- changes?: number;
337
- /**
338
- * the inserted IDs.
339
- */
340
- ids?: number[] | string[];
341
- /**
342
- * first inserted ID.
343
- */
344
- firstId?: number | string;
345
- };
346
-
347
- /**
348
- * options for the `raw` function.
349
- */
350
- export type QueryRawFnOptions = {
351
- /**
352
- * the current dialect.
353
- */
354
- dialect?: QueryDialect;
355
- /**
356
- * the prefix.
357
- */
358
- prefix?: string;
359
- /**
360
- * the escaped prefix.
361
- */
362
- escapedPrefix?: string;
363
- /**
364
- * the query context.
365
- */
366
- ctx?: QueryContext;
367
- };
368
-
369
- /**
370
- * a `raw` function
371
- */
372
- export type QueryRawFn = (opts?: QueryRawFnOptions) => void | Scalar;
373
-
374
- export class QueryRaw {
375
- constructor(
376
- readonly value: Scalar | QueryRawFn,
377
- readonly alias?: string,
378
- ) {}
379
- }
380
-
381
- /**
382
- * comparison options.
383
- */
384
- export type QueryComparisonOptions = QueryOptions & {
385
- /**
386
- * use precedence for the comparison or not.
387
- */
388
- usePrecedence?: boolean;
389
- };
390
-
391
- /**
392
- * query filter options.
393
- */
394
- export type QueryWhereOptions = QueryComparisonOptions & {
395
- /**
396
- * clause to be used in the filter.
397
- */
398
- clause?: 'WHERE' | false;
399
- };
400
-
401
- export interface QueryContext {
402
- append(sql: string): this;
403
- addValue(value: unknown): this;
404
- pushValue(value: unknown): this;
405
- readonly sql: string;
406
- readonly values: unknown[];
407
- }
408
-
409
- export interface QueryDialect {
410
- /**
411
- * obtains the records matching the given search parameters.
412
- * @param ctx the query context
413
- * @param entity the target entity
414
- * @param q the criteria options
415
- * @param opts the query options
416
- */
417
- find<E>(ctx: QueryContext, entity: Type<E>, q: Query<E>, opts?: QueryOptions): void;
418
-
419
- /**
420
- * counts the number of records matching the given search parameters.
421
- * @param ctx the query context
422
- * @param entity the target entity
423
- * @param q the criteria options
424
- * @param opts the query options
425
- */
426
- count<E>(ctx: QueryContext, entity: Type<E>, q: QuerySearch<E>, opts?: QueryOptions): void;
427
-
428
- /**
429
- * insert records.
430
- * @param ctx the query context
431
- * @param entity the target entity
432
- * @param payload the payload
433
- * @param opts the query options
434
- */
435
- insert<E>(ctx: QueryContext, entity: Type<E>, payload: E | E[], opts?: QueryOptions): void;
436
-
437
- /**
438
- * update records.
439
- * @param ctx the query context
440
- * @param entity the target entity
441
- * @param q the criteria options
442
- * @param payload
443
- * @param opts the query options
444
- */
445
- update<E>(ctx: QueryContext, entity: Type<E>, q: QuerySearch<E>, payload: E, opts?: QueryOptions): void;
446
-
447
- /**
448
- * upsert records.
449
- * @param ctx the query context
450
- * @param entity the target entity
451
- * @param conflictPaths the conflict paths
452
- * @param payload
453
- */
454
- upsert<E>(ctx: QueryContext, entity: Type<E>, conflictPaths: QueryConflictPaths<E>, payload: E): void;
455
-
456
- /**
457
- * delete records.
458
- * @param ctx the query context
459
- * @param entity the target entity
460
- * @param q the criteria options
461
- * @param opts the query options
462
- */
463
- delete<E>(ctx: QueryContext, entity: Type<E>, q: QuerySearch<E>, opts?: QueryOptions): void;
464
-
465
- /**
466
- * escape an identifier.
467
- * @param val the value to be escaped
468
- * @param forbidQualified don't escape dots
469
- * @param addDot use a dot as suffix
470
- */
471
- escapeId(val: string, forbidQualified?: boolean, addDot?: boolean): string;
472
-
473
- /**
474
- * escape a value.
475
- * @param val the value to escape
476
- */
477
- escape(val: unknown): string;
478
-
479
- /**
480
- * add a value to the query.
481
- * @param values the values array
482
- * @param value the value to add
483
- */
484
- addValue(values: unknown[], value: unknown): string;
485
-
486
- /**
487
- * create a new query context.
488
- */
489
- createContext(): QueryContext;
490
- }
491
-
492
- /**
493
- * Minimal dialect interface exposing escapeIdChar for SQL operations
494
- */
495
- export interface SqlQueryDialect extends QueryDialect {
496
- /**
497
- * the escape character for identifiers.
498
- */
499
- readonly escapeIdChar: '"' | '`';
500
-
501
- /**
502
- * Get the placeholder for a parameter at the given index (1-based).
503
- * Default: '?' for MySQL/MariaDB/SQLite, '$n' for PostgreSQL.
504
- */
505
- placeholder(index: number): string;
506
- }
@@ -1,142 +0,0 @@
1
- import type { IdValue } from './entity.js';
2
- import type { Query, QueryConflictPaths, QueryOne, QueryOptions, QuerySearch, QueryUpdateResult } from './query.js';
3
- import type { UniversalQuerier } from './universalQuerier.js';
4
- import type { Type } from './utility.js';
5
-
6
- /**
7
- * A `repository` allows to interact with the datasource to perform persistence operations on a specific entity.
8
- */
9
- export type UniversalRepository<E> = {
10
- /**
11
- * the `entity` class to which this `repository` is linked to.
12
- */
13
- readonly entity: Type<E>;
14
-
15
- /**
16
- * the `querier` instance to which this `repository` is linked to.
17
- */
18
- readonly querier: UniversalQuerier;
19
-
20
- /**
21
- * obtains the record with the given primary key.
22
- * @param id the primary key value
23
- * @param q the criteria options
24
- */
25
- findOneById(id: IdValue<E>, q?: QueryOne<E>): Promise<unknown>;
26
-
27
- /**
28
- * obtains the first record matching the given search parameters.
29
- * @param q the criteria options
30
- */
31
- findOne(q: QueryOne<E>): Promise<unknown>;
32
-
33
- /**
34
- * obtains the records matching the given search parameters.
35
- * @param q the criteria options
36
- */
37
- findMany(q: Query<E>): Promise<unknown>;
38
-
39
- /**
40
- * obtains the records matching the given search parameters,
41
- * also counts the number of matches ignoring pagination.
42
- * @param q the criteria options
43
- */
44
- findManyAndCount(q: Query<E>): Promise<unknown>;
45
-
46
- /**
47
- * counts the number of records matching the given search parameters.
48
- * @param q the search options
49
- */
50
- count(q: QuerySearch<E>): Promise<unknown>;
51
-
52
- /**
53
- * inserts a record.
54
- * @param payload the data to be persisted
55
- */
56
- insertOne(payload: E): Promise<unknown>;
57
-
58
- /**
59
- * Inserts many records.
60
- * @param entity the entity to persist on
61
- * @param payload the data to be persisted
62
- */
63
- insertMany?(payload: E[]): Promise<unknown>;
64
-
65
- /**
66
- * updates a record partially.
67
- * @param id the primary key of the record to be updated
68
- * @param payload the data to be persisted
69
- */
70
- updateOneById(id: IdValue<E>, payload: E): Promise<unknown>;
71
-
72
- /**
73
- * updates many records partially.
74
- * @param qm the criteria to look for the records
75
- * @param payload the data to be persisted
76
- */
77
- updateMany?(qm: QuerySearch<E>, payload: E): Promise<unknown>;
78
-
79
- /**
80
- * Insert or update a record given a search criteria.
81
- * @param conflictPaths the keys to use for the unique search.
82
- * @param payload the data to insert or update.
83
- */
84
- upsertOne?(conflictPaths: QueryConflictPaths<E>, payload: E): Promise<unknown>;
85
-
86
- /**
87
- * Insert or update a record.
88
- * @param payload the data to be persisted
89
- */
90
- saveOne(payload: E): Promise<unknown>;
91
-
92
- /**
93
- * insert or update records.
94
- * @param payload the data to be persisted
95
- */
96
- saveMany?(payload: E[]): Promise<unknown>;
97
-
98
- /**
99
- * delete or SoftDelete a record.
100
- * @param id the primary key of the record
101
- */
102
- deleteOneById(id: IdValue<E>, opts?: QueryOptions): Promise<unknown>;
103
-
104
- /**
105
- * delete or SoftDelete records.
106
- * @param qm the criteria to look for the records
107
- */
108
- deleteMany(qm: QuerySearch<E>, opts?: QueryOptions): Promise<unknown>;
109
- };
110
-
111
- /**
112
- * base contract for the backend repositories.
113
- */
114
- export interface Repository<E> extends UniversalRepository<E> {
115
- findOneById(id: IdValue<E>, q?: QueryOne<E>): Promise<E>;
116
-
117
- findOne(qm: QueryOne<E>): Promise<E>;
118
-
119
- findMany(qm: Query<E>): Promise<E[]>;
120
-
121
- findManyAndCount(qm: Query<E>): Promise<[E[], number]>;
122
-
123
- count(q?: QuerySearch<E>): Promise<number>;
124
-
125
- insertOne(payload: E): Promise<IdValue<E>>;
126
-
127
- insertMany(payload: E[]): Promise<IdValue<E>[]>;
128
-
129
- updateOneById(id: IdValue<E>, payload: E): Promise<number>;
130
-
131
- updateMany(qm: QuerySearch<E>, payload: E): Promise<number>;
132
-
133
- upsertOne(conflictPaths: QueryConflictPaths<E>, payload: E): Promise<QueryUpdateResult>;
134
-
135
- saveOne(payload: E): Promise<IdValue<E>>;
136
-
137
- saveMany?(payload: E[]): Promise<IdValue<E>[]>;
138
-
139
- deleteOneById(id: IdValue<E>, opts?: QueryOptions): Promise<number>;
140
-
141
- deleteMany(qm: QuerySearch<E>, opts?: QueryOptions): Promise<number>;
142
- }