uql-orm 0.20.1 → 0.21.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 (745) hide show
  1. package/README.md +45 -109
  2. package/dist/browser/http/bus.d.ts +0 -1
  3. package/dist/browser/http/bus.js +0 -1
  4. package/dist/browser/http/http.d.ts +0 -1
  5. package/dist/browser/http/http.js +0 -1
  6. package/dist/browser/http/index.d.ts +0 -1
  7. package/dist/browser/http/index.js +0 -1
  8. package/dist/browser/index.d.ts +0 -1
  9. package/dist/browser/index.js +0 -1
  10. package/dist/browser/options.d.ts +0 -1
  11. package/dist/browser/options.js +0 -1
  12. package/dist/browser/querier/httpQuerier.d.ts +0 -1
  13. package/dist/browser/querier/httpQuerier.js +0 -1
  14. package/dist/browser/querier/index.d.ts +0 -1
  15. package/dist/browser/querier/index.js +0 -1
  16. package/dist/browser/type/clientQuerier.d.ts +0 -1
  17. package/dist/browser/type/clientQuerier.js +0 -1
  18. package/dist/browser/type/clientQuerierPool.d.ts +0 -1
  19. package/dist/browser/type/clientQuerierPool.js +0 -1
  20. package/dist/browser/type/index.d.ts +0 -1
  21. package/dist/browser/type/index.js +0 -1
  22. package/dist/browser/type/request.d.ts +0 -1
  23. package/dist/browser/type/request.js +0 -1
  24. package/dist/browser/uql-browser.min.js +2 -2
  25. package/dist/browser/uql-browser.min.js.map +1 -1
  26. package/dist/bunSql/bunSql.util.d.ts +0 -1
  27. package/dist/bunSql/bunSql.util.js +0 -1
  28. package/dist/bunSql/bunSqlCockroachDialect.d.ts +0 -1
  29. package/dist/bunSql/bunSqlCockroachDialect.js +0 -1
  30. package/dist/bunSql/bunSqlPostgresDialect.d.ts +0 -1
  31. package/dist/bunSql/bunSqlPostgresDialect.js +0 -1
  32. package/dist/bunSql/bunSqlQuerier.d.ts +0 -1
  33. package/dist/bunSql/bunSqlQuerier.js +0 -1
  34. package/dist/bunSql/bunSqlQuerierPool.d.ts +0 -1
  35. package/dist/bunSql/bunSqlQuerierPool.js +0 -1
  36. package/dist/bunSql/bunSqliteDialect.d.ts +0 -1
  37. package/dist/bunSql/bunSqliteDialect.js +0 -1
  38. package/dist/bunSql/index.d.ts +0 -1
  39. package/dist/bunSql/index.js +0 -1
  40. package/dist/cockroachdb/cockroachDialect.d.ts +0 -1
  41. package/dist/cockroachdb/cockroachDialect.js +0 -1
  42. package/dist/cockroachdb/crdbQuerier.d.ts +0 -1
  43. package/dist/cockroachdb/crdbQuerier.js +0 -1
  44. package/dist/cockroachdb/crdbQuerierPool.d.ts +0 -1
  45. package/dist/cockroachdb/crdbQuerierPool.js +0 -1
  46. package/dist/cockroachdb/index.d.ts +0 -1
  47. package/dist/cockroachdb/index.js +0 -1
  48. package/dist/context/context.browser.d.ts +0 -1
  49. package/dist/context/context.browser.js +0 -1
  50. package/dist/context/context.d.ts +0 -1
  51. package/dist/context/context.js +0 -1
  52. package/dist/context/securityError.d.ts +0 -1
  53. package/dist/context/securityError.js +0 -1
  54. package/dist/d1/d1Querier.d.ts +0 -1
  55. package/dist/d1/d1Querier.js +0 -1
  56. package/dist/d1/d1QuerierPool.d.ts +0 -1
  57. package/dist/d1/d1QuerierPool.js +0 -1
  58. package/dist/d1/d1SqliteDialect.d.ts +0 -1
  59. package/dist/d1/d1SqliteDialect.js +0 -1
  60. package/dist/d1/index.d.ts +0 -1
  61. package/dist/d1/index.js +0 -1
  62. package/dist/dialect/abstractDialect.d.ts +13 -2
  63. package/dist/dialect/abstractDialect.js +17 -1
  64. package/dist/dialect/abstractSqlDialect.d.ts +27 -15
  65. package/dist/dialect/abstractSqlDialect.js +121 -139
  66. package/dist/dialect/index.d.ts +0 -1
  67. package/dist/dialect/index.js +0 -1
  68. package/dist/dialect/jsonArrayElemMatchUtils.d.ts +0 -1
  69. package/dist/dialect/jsonArrayElemMatchUtils.js +0 -1
  70. package/dist/dialect/jsonSql.d.ts +0 -1
  71. package/dist/dialect/jsonSql.js +1 -2
  72. package/dist/dialect/mysqlLikeSqlDialect.d.ts +0 -1
  73. package/dist/dialect/mysqlLikeSqlDialect.js +2 -4
  74. package/dist/dialect/pgLikeSqlDialect.d.ts +3 -3
  75. package/dist/dialect/pgLikeSqlDialect.js +7 -18
  76. package/dist/dialect/queryContext.d.ts +0 -1
  77. package/dist/dialect/queryContext.js +0 -1
  78. package/dist/dialect/vectorCast.d.ts +11 -0
  79. package/dist/dialect/vectorCast.js +13 -0
  80. package/dist/dialect/vectorSqlDialect.d.ts +1 -2
  81. package/dist/dialect/vectorSqlDialect.js +1 -2
  82. package/dist/entity/decorator/entity.d.ts +0 -1
  83. package/dist/entity/decorator/entity.js +0 -1
  84. package/dist/entity/decorator/field.d.ts +0 -1
  85. package/dist/entity/decorator/field.js +0 -1
  86. package/dist/entity/decorator/filter.d.ts +0 -1
  87. package/dist/entity/decorator/filter.js +0 -1
  88. package/dist/entity/decorator/hook.d.ts +0 -1
  89. package/dist/entity/decorator/hook.js +0 -1
  90. package/dist/entity/decorator/id.d.ts +0 -1
  91. package/dist/entity/decorator/id.js +0 -1
  92. package/dist/entity/decorator/index-decorator.d.ts +0 -1
  93. package/dist/entity/decorator/index-decorator.js +0 -1
  94. package/dist/entity/decorator/index.d.ts +0 -1
  95. package/dist/entity/decorator/index.js +0 -1
  96. package/dist/entity/decorator/relation.d.ts +0 -1
  97. package/dist/entity/decorator/relation.js +0 -1
  98. package/dist/entity/index.d.ts +0 -1
  99. package/dist/entity/index.js +0 -1
  100. package/dist/entity/metadata/definition.d.ts +0 -2
  101. package/dist/entity/metadata/definition.js +6 -3
  102. package/dist/express/index.d.ts +0 -1
  103. package/dist/express/index.js +0 -1
  104. package/dist/express/querierMiddleware.d.ts +0 -1
  105. package/dist/express/querierMiddleware.js +0 -1
  106. package/dist/http/contract.d.ts +0 -1
  107. package/dist/http/contract.js +0 -1
  108. package/dist/http/fetchHandler.d.ts +0 -1
  109. package/dist/http/fetchHandler.js +0 -1
  110. package/dist/http/handler.d.ts +0 -1
  111. package/dist/http/handler.js +0 -1
  112. package/dist/http/index.d.ts +0 -1
  113. package/dist/http/index.js +0 -1
  114. package/dist/http/query.d.ts +0 -1
  115. package/dist/http/query.js +0 -1
  116. package/dist/index.d.ts +0 -1
  117. package/dist/index.js +0 -1
  118. package/dist/libsql/index.d.ts +0 -1
  119. package/dist/libsql/index.js +0 -1
  120. package/dist/libsql/libsqlDialect.d.ts +0 -1
  121. package/dist/libsql/libsqlDialect.js +0 -1
  122. package/dist/libsql/libsqlQuerier.d.ts +0 -1
  123. package/dist/libsql/libsqlQuerier.js +9 -2
  124. package/dist/libsql/libsqlQuerierPool.d.ts +0 -1
  125. package/dist/libsql/libsqlQuerierPool.js +0 -1
  126. package/dist/maria/index.d.ts +0 -1
  127. package/dist/maria/index.js +0 -1
  128. package/dist/maria/mariaDialect.d.ts +0 -1
  129. package/dist/maria/mariaDialect.js +0 -1
  130. package/dist/maria/mariadbQuerier.d.ts +0 -1
  131. package/dist/maria/mariadbQuerier.js +0 -1
  132. package/dist/maria/mariadbQuerierPool.d.ts +0 -1
  133. package/dist/maria/mariadbQuerierPool.js +0 -1
  134. package/dist/migrate/acquireQuerierForMigrations.d.ts +0 -1
  135. package/dist/migrate/acquireQuerierForMigrations.js +0 -1
  136. package/dist/migrate/assertCliConfig.d.ts +0 -1
  137. package/dist/migrate/assertCliConfig.js +0 -1
  138. package/dist/migrate/bin.d.ts +0 -1
  139. package/dist/migrate/bin.js +0 -1
  140. package/dist/migrate/builder/columnBuilder.d.ts +0 -1
  141. package/dist/migrate/builder/columnBuilder.js +0 -1
  142. package/dist/migrate/builder/expressions.d.ts +0 -1
  143. package/dist/migrate/builder/expressions.js +0 -1
  144. package/dist/migrate/builder/index.d.ts +0 -1
  145. package/dist/migrate/builder/index.js +0 -1
  146. package/dist/migrate/builder/migrationBuilder.d.ts +0 -1
  147. package/dist/migrate/builder/migrationBuilder.js +0 -1
  148. package/dist/migrate/builder/splitSqlStatements.d.ts +0 -1
  149. package/dist/migrate/builder/splitSqlStatements.js +0 -1
  150. package/dist/migrate/builder/tableBuilder.d.ts +0 -1
  151. package/dist/migrate/builder/tableBuilder.js +0 -1
  152. package/dist/migrate/builder/types.d.ts +0 -1
  153. package/dist/migrate/builder/types.js +0 -1
  154. package/dist/migrate/cli-config.d.ts +0 -1
  155. package/dist/migrate/cli-config.js +9 -5
  156. package/dist/migrate/cli.d.ts +0 -1
  157. package/dist/migrate/cli.js +3 -3
  158. package/dist/migrate/codegen/entityCodeGenerator.d.ts +0 -1
  159. package/dist/migrate/codegen/entityCodeGenerator.js +0 -1
  160. package/dist/migrate/codegen/entityMerger.d.ts +0 -1
  161. package/dist/migrate/codegen/entityMerger.js +0 -1
  162. package/dist/migrate/codegen/index.d.ts +0 -1
  163. package/dist/migrate/codegen/index.js +0 -1
  164. package/dist/migrate/codegen/migrationCodeGenerator.d.ts +0 -1
  165. package/dist/migrate/codegen/migrationCodeGenerator.js +0 -1
  166. package/dist/migrate/codegen/migrationFile.d.ts +0 -1
  167. package/dist/migrate/codegen/migrationFile.js +0 -1
  168. package/dist/migrate/codegen/smartRelationDetector.d.ts +0 -1
  169. package/dist/migrate/codegen/smartRelationDetector.js +0 -1
  170. package/dist/migrate/drift/driftDetector.d.ts +0 -1
  171. package/dist/migrate/drift/driftDetector.js +0 -1
  172. package/dist/migrate/drift/index.d.ts +0 -1
  173. package/dist/migrate/drift/index.js +0 -1
  174. package/dist/migrate/generator/index.d.ts +0 -1
  175. package/dist/migrate/generator/index.js +0 -1
  176. package/dist/migrate/generator/mongoSchemaGenerator.d.ts +0 -1
  177. package/dist/migrate/generator/mongoSchemaGenerator.js +0 -1
  178. package/dist/migrate/index.d.ts +0 -1
  179. package/dist/migrate/index.js +0 -1
  180. package/dist/migrate/introspection/abstractSqlSchemaIntrospector.d.ts +0 -1
  181. package/dist/migrate/introspection/abstractSqlSchemaIntrospector.js +0 -1
  182. package/dist/migrate/introspection/baseSqlIntrospector.d.ts +0 -1
  183. package/dist/migrate/introspection/baseSqlIntrospector.js +0 -1
  184. package/dist/migrate/introspection/index.d.ts +0 -1
  185. package/dist/migrate/introspection/index.js +0 -1
  186. package/dist/migrate/introspection/mongoIntrospector.d.ts +0 -1
  187. package/dist/migrate/introspection/mongoIntrospector.js +0 -1
  188. package/dist/migrate/introspection/mysqlIntrospector.d.ts +0 -1
  189. package/dist/migrate/introspection/mysqlIntrospector.js +0 -1
  190. package/dist/migrate/introspection/postgresIntrospector.d.ts +0 -1
  191. package/dist/migrate/introspection/postgresIntrospector.js +0 -1
  192. package/dist/migrate/introspection/sqliteIntrospector.d.ts +0 -1
  193. package/dist/migrate/introspection/sqliteIntrospector.js +0 -1
  194. package/dist/migrate/migrator.d.ts +0 -1
  195. package/dist/migrate/migrator.js +0 -1
  196. package/dist/migrate/schemaGenerator.d.ts +0 -1
  197. package/dist/migrate/schemaGenerator.js +0 -1
  198. package/dist/migrate/schemaGeneratorAsync.d.ts +0 -1
  199. package/dist/migrate/schemaGeneratorAsync.js +0 -1
  200. package/dist/migrate/storage/databaseStorage.d.ts +0 -1
  201. package/dist/migrate/storage/databaseStorage.js +0 -1
  202. package/dist/migrate/storage/index.d.ts +0 -1
  203. package/dist/migrate/storage/index.js +0 -1
  204. package/dist/migrate/storage/jsonStorage.d.ts +0 -1
  205. package/dist/migrate/storage/jsonStorage.js +0 -1
  206. package/dist/migrate/sync/index.d.ts +0 -1
  207. package/dist/migrate/sync/index.js +0 -1
  208. package/dist/migrate/sync/schemaSync.d.ts +0 -1
  209. package/dist/migrate/sync/schemaSync.js +0 -1
  210. package/dist/mongo/index.d.ts +0 -1
  211. package/dist/mongo/index.js +0 -1
  212. package/dist/mongo/mongoDialect.d.ts +91 -5
  213. package/dist/mongo/mongoDialect.js +301 -80
  214. package/dist/mongo/mongodbNativeDialect.d.ts +0 -1
  215. package/dist/mongo/mongodbNativeDialect.js +0 -1
  216. package/dist/mongo/mongodbQuerier.d.ts +5 -1
  217. package/dist/mongo/mongodbQuerier.js +61 -19
  218. package/dist/mongo/mongodbQuerierPool.d.ts +0 -1
  219. package/dist/mongo/mongodbQuerierPool.js +0 -1
  220. package/dist/mysql/index.d.ts +0 -1
  221. package/dist/mysql/index.js +0 -1
  222. package/dist/mysql/mysql2Dialect.d.ts +0 -1
  223. package/dist/mysql/mysql2Dialect.js +0 -1
  224. package/dist/mysql/mysql2Querier.d.ts +0 -1
  225. package/dist/mysql/mysql2Querier.js +0 -1
  226. package/dist/mysql/mysql2QuerierPool.d.ts +0 -1
  227. package/dist/mysql/mysql2QuerierPool.js +0 -1
  228. package/dist/mysql/mysqlDialect.d.ts +0 -1
  229. package/dist/mysql/mysqlDialect.js +0 -1
  230. package/dist/namingStrategy/defaultNamingStrategy.d.ts +0 -1
  231. package/dist/namingStrategy/defaultNamingStrategy.js +0 -1
  232. package/dist/namingStrategy/index.d.ts +0 -1
  233. package/dist/namingStrategy/index.js +0 -1
  234. package/dist/namingStrategy/snakeCaseNamingStrategy.d.ts +0 -1
  235. package/dist/namingStrategy/snakeCaseNamingStrategy.js +0 -1
  236. package/dist/neon/index.d.ts +0 -1
  237. package/dist/neon/index.js +0 -1
  238. package/dist/neon/neonDialect.d.ts +0 -1
  239. package/dist/neon/neonDialect.js +0 -1
  240. package/dist/neon/neonQuerier.d.ts +0 -1
  241. package/dist/neon/neonQuerier.js +0 -1
  242. package/dist/neon/neonQuerierPool.d.ts +0 -1
  243. package/dist/neon/neonQuerierPool.js +0 -1
  244. package/dist/nestjs/index.d.ts +0 -1
  245. package/dist/nestjs/index.js +0 -1
  246. package/dist/nestjs/uqlContextInterceptor.d.ts +0 -1
  247. package/dist/nestjs/uqlContextInterceptor.js +9 -2
  248. package/dist/nestjs/uqlModule.d.ts +0 -1
  249. package/dist/nestjs/uqlModule.js +12 -2
  250. package/dist/options.d.ts +0 -1
  251. package/dist/options.js +0 -1
  252. package/dist/postgres/abstractPgQuerier.d.ts +0 -1
  253. package/dist/postgres/abstractPgQuerier.js +0 -1
  254. package/dist/postgres/abstractPgQuerierPool.d.ts +0 -1
  255. package/dist/postgres/abstractPgQuerierPool.js +0 -1
  256. package/dist/postgres/index.d.ts +0 -1
  257. package/dist/postgres/index.js +0 -1
  258. package/dist/postgres/pgDialect.d.ts +0 -1
  259. package/dist/postgres/pgDialect.js +0 -1
  260. package/dist/postgres/pgQuerier.d.ts +0 -1
  261. package/dist/postgres/pgQuerier.js +0 -1
  262. package/dist/postgres/pgQuerierPool.d.ts +0 -1
  263. package/dist/postgres/pgQuerierPool.js +0 -1
  264. package/dist/postgres/postgresDialect.d.ts +0 -1
  265. package/dist/postgres/postgresDialect.js +0 -1
  266. package/dist/postgres/postgresWireDriverCapabilities.d.ts +0 -1
  267. package/dist/postgres/postgresWireDriverCapabilities.js +0 -1
  268. package/dist/querier/abstractPoolQuerier.d.ts +0 -1
  269. package/dist/querier/abstractPoolQuerier.js +0 -1
  270. package/dist/querier/abstractQuerier.d.ts +0 -1
  271. package/dist/querier/abstractQuerier.js +9 -2
  272. package/dist/querier/abstractQuerierPool.d.ts +0 -1
  273. package/dist/querier/abstractQuerierPool.js +0 -1
  274. package/dist/querier/abstractSqlQuerier.d.ts +0 -1
  275. package/dist/querier/abstractSqlQuerier.js +9 -2
  276. package/dist/querier/abstractSqlQuerierPool.d.ts +0 -1
  277. package/dist/querier/abstractSqlQuerierPool.js +0 -1
  278. package/dist/querier/decorator/index.d.ts +0 -1
  279. package/dist/querier/decorator/index.js +0 -1
  280. package/dist/querier/decorator/injectQuerier.d.ts +0 -1
  281. package/dist/querier/decorator/injectQuerier.js +0 -1
  282. package/dist/querier/decorator/log.d.ts +0 -1
  283. package/dist/querier/decorator/log.js +0 -1
  284. package/dist/querier/decorator/serialized.d.ts +0 -1
  285. package/dist/querier/decorator/serialized.js +0 -1
  286. package/dist/querier/decorator/transactional.d.ts +0 -1
  287. package/dist/querier/decorator/transactional.js +0 -1
  288. package/dist/querier/index.d.ts +0 -1
  289. package/dist/querier/index.js +0 -1
  290. package/dist/schema/canonicalType.d.ts +0 -11
  291. package/dist/schema/canonicalType.js +0 -13
  292. package/dist/schema/index.d.ts +0 -1
  293. package/dist/schema/index.js +0 -1
  294. package/dist/schema/schemaAST.d.ts +0 -1
  295. package/dist/schema/schemaAST.js +0 -1
  296. package/dist/schema/schemaASTBuilder.d.ts +0 -1
  297. package/dist/schema/schemaASTBuilder.js +0 -1
  298. package/dist/schema/schemaASTDiffer.d.ts +0 -1
  299. package/dist/schema/schemaASTDiffer.js +0 -1
  300. package/dist/schema/types.d.ts +0 -1
  301. package/dist/schema/types.js +0 -1
  302. package/dist/sqlite/abstractSqliteQuerier.d.ts +0 -1
  303. package/dist/sqlite/abstractSqliteQuerier.js +0 -1
  304. package/dist/sqlite/betterSqlite3Dialect.d.ts +0 -1
  305. package/dist/sqlite/betterSqlite3Dialect.js +0 -1
  306. package/dist/sqlite/index.d.ts +0 -1
  307. package/dist/sqlite/index.js +0 -1
  308. package/dist/sqlite/sqliteDialect.d.ts +0 -1
  309. package/dist/sqlite/sqliteDialect.js +0 -1
  310. package/dist/sqlite/sqliteQuerier.d.ts +0 -1
  311. package/dist/sqlite/sqliteQuerier.js +0 -1
  312. package/dist/sqlite/sqliteQuerierPool.d.ts +0 -1
  313. package/dist/sqlite/sqliteQuerierPool.js +0 -1
  314. package/dist/type/config.d.ts +0 -1
  315. package/dist/type/config.js +0 -1
  316. package/dist/type/dialect.d.ts +0 -1
  317. package/dist/type/dialect.js +0 -1
  318. package/dist/type/entity.d.ts +0 -1
  319. package/dist/type/entity.js +0 -1
  320. package/dist/type/index.d.ts +0 -1
  321. package/dist/type/index.js +0 -1
  322. package/dist/type/logger.d.ts +0 -1
  323. package/dist/type/logger.js +0 -1
  324. package/dist/type/migration.d.ts +0 -1
  325. package/dist/type/migration.js +0 -1
  326. package/dist/type/migratorDialect.d.ts +0 -1
  327. package/dist/type/migratorDialect.js +0 -1
  328. package/dist/type/namingStrategy.d.ts +0 -1
  329. package/dist/type/namingStrategy.js +0 -1
  330. package/dist/type/querier.d.ts +0 -1
  331. package/dist/type/querier.js +0 -1
  332. package/dist/type/querierPool.d.ts +0 -1
  333. package/dist/type/querierPool.js +0 -1
  334. package/dist/type/query.d.ts +0 -1
  335. package/dist/type/query.js +0 -1
  336. package/dist/type/queryAggregate.d.ts +0 -1
  337. package/dist/type/queryAggregate.js +0 -1
  338. package/dist/type/queryRaw.d.ts +0 -1
  339. package/dist/type/queryRaw.js +0 -1
  340. package/dist/type/queryWhere.d.ts +0 -1
  341. package/dist/type/queryWhere.js +0 -1
  342. package/dist/type/universalQuerier.d.ts +0 -1
  343. package/dist/type/universalQuerier.js +0 -1
  344. package/dist/type/utility.d.ts +0 -1
  345. package/dist/type/utility.js +0 -1
  346. package/dist/type/vector.d.ts +0 -1
  347. package/dist/type/vector.js +0 -1
  348. package/dist/util/dialect.util.d.ts +8 -2
  349. package/dist/util/dialect.util.js +16 -1
  350. package/dist/util/field.util.d.ts +0 -1
  351. package/dist/util/field.util.js +0 -1
  352. package/dist/util/filters.util.d.ts +0 -1
  353. package/dist/util/filters.util.js +0 -1
  354. package/dist/util/hook.util.d.ts +0 -1
  355. package/dist/util/hook.util.js +0 -1
  356. package/dist/util/index.d.ts +0 -1
  357. package/dist/util/index.js +0 -1
  358. package/dist/util/logger.d.ts +0 -1
  359. package/dist/util/logger.js +0 -1
  360. package/dist/util/object.util.d.ts +0 -1
  361. package/dist/util/object.util.js +0 -1
  362. package/dist/util/raw.d.ts +0 -1
  363. package/dist/util/raw.js +0 -1
  364. package/dist/util/relationQuery.util.d.ts +0 -1
  365. package/dist/util/relationQuery.util.js +0 -1
  366. package/dist/util/sql.util.d.ts +0 -1
  367. package/dist/util/sql.util.js +0 -1
  368. package/dist/util/sqlLiteral.d.ts +19 -0
  369. package/dist/util/sqlLiteral.js +108 -0
  370. package/dist/util/string.util.d.ts +0 -1
  371. package/dist/util/string.util.js +0 -1
  372. package/package.json +44 -27
  373. package/CHANGELOG.md +0 -1349
  374. package/dist/browser/http/bus.d.ts.map +0 -1
  375. package/dist/browser/http/bus.js.map +0 -1
  376. package/dist/browser/http/http.d.ts.map +0 -1
  377. package/dist/browser/http/http.js.map +0 -1
  378. package/dist/browser/http/index.d.ts.map +0 -1
  379. package/dist/browser/http/index.js.map +0 -1
  380. package/dist/browser/index.d.ts.map +0 -1
  381. package/dist/browser/index.js.map +0 -1
  382. package/dist/browser/options.d.ts.map +0 -1
  383. package/dist/browser/options.js.map +0 -1
  384. package/dist/browser/querier/httpQuerier.d.ts.map +0 -1
  385. package/dist/browser/querier/httpQuerier.js.map +0 -1
  386. package/dist/browser/querier/index.d.ts.map +0 -1
  387. package/dist/browser/querier/index.js.map +0 -1
  388. package/dist/browser/type/clientQuerier.d.ts.map +0 -1
  389. package/dist/browser/type/clientQuerier.js.map +0 -1
  390. package/dist/browser/type/clientQuerierPool.d.ts.map +0 -1
  391. package/dist/browser/type/clientQuerierPool.js.map +0 -1
  392. package/dist/browser/type/index.d.ts.map +0 -1
  393. package/dist/browser/type/index.js.map +0 -1
  394. package/dist/browser/type/request.d.ts.map +0 -1
  395. package/dist/browser/type/request.js.map +0 -1
  396. package/dist/bunSql/bunSql.util.d.ts.map +0 -1
  397. package/dist/bunSql/bunSql.util.js.map +0 -1
  398. package/dist/bunSql/bunSqlCockroachDialect.d.ts.map +0 -1
  399. package/dist/bunSql/bunSqlCockroachDialect.js.map +0 -1
  400. package/dist/bunSql/bunSqlPostgresDialect.d.ts.map +0 -1
  401. package/dist/bunSql/bunSqlPostgresDialect.js.map +0 -1
  402. package/dist/bunSql/bunSqlQuerier.d.ts.map +0 -1
  403. package/dist/bunSql/bunSqlQuerier.js.map +0 -1
  404. package/dist/bunSql/bunSqlQuerierPool.d.ts.map +0 -1
  405. package/dist/bunSql/bunSqlQuerierPool.js.map +0 -1
  406. package/dist/bunSql/bunSqliteDialect.d.ts.map +0 -1
  407. package/dist/bunSql/bunSqliteDialect.js.map +0 -1
  408. package/dist/bunSql/index.d.ts.map +0 -1
  409. package/dist/bunSql/index.js.map +0 -1
  410. package/dist/cockroachdb/cockroachDialect.d.ts.map +0 -1
  411. package/dist/cockroachdb/cockroachDialect.js.map +0 -1
  412. package/dist/cockroachdb/crdbQuerier.d.ts.map +0 -1
  413. package/dist/cockroachdb/crdbQuerier.js.map +0 -1
  414. package/dist/cockroachdb/crdbQuerierPool.d.ts.map +0 -1
  415. package/dist/cockroachdb/crdbQuerierPool.js.map +0 -1
  416. package/dist/cockroachdb/index.d.ts.map +0 -1
  417. package/dist/cockroachdb/index.js.map +0 -1
  418. package/dist/context/context.browser.d.ts.map +0 -1
  419. package/dist/context/context.browser.js.map +0 -1
  420. package/dist/context/context.d.ts.map +0 -1
  421. package/dist/context/context.js.map +0 -1
  422. package/dist/context/securityError.d.ts.map +0 -1
  423. package/dist/context/securityError.js.map +0 -1
  424. package/dist/d1/d1Querier.d.ts.map +0 -1
  425. package/dist/d1/d1Querier.js.map +0 -1
  426. package/dist/d1/d1QuerierPool.d.ts.map +0 -1
  427. package/dist/d1/d1QuerierPool.js.map +0 -1
  428. package/dist/d1/d1SqliteDialect.d.ts.map +0 -1
  429. package/dist/d1/d1SqliteDialect.js.map +0 -1
  430. package/dist/d1/index.d.ts.map +0 -1
  431. package/dist/d1/index.js.map +0 -1
  432. package/dist/dialect/abstractDialect.d.ts.map +0 -1
  433. package/dist/dialect/abstractDialect.js.map +0 -1
  434. package/dist/dialect/abstractSqlDialect.d.ts.map +0 -1
  435. package/dist/dialect/abstractSqlDialect.js.map +0 -1
  436. package/dist/dialect/index.d.ts.map +0 -1
  437. package/dist/dialect/index.js.map +0 -1
  438. package/dist/dialect/jsonArrayElemMatchUtils.d.ts.map +0 -1
  439. package/dist/dialect/jsonArrayElemMatchUtils.js.map +0 -1
  440. package/dist/dialect/jsonSql.d.ts.map +0 -1
  441. package/dist/dialect/jsonSql.js.map +0 -1
  442. package/dist/dialect/mysqlLikeSqlDialect.d.ts.map +0 -1
  443. package/dist/dialect/mysqlLikeSqlDialect.js.map +0 -1
  444. package/dist/dialect/pgLikeSqlDialect.d.ts.map +0 -1
  445. package/dist/dialect/pgLikeSqlDialect.js.map +0 -1
  446. package/dist/dialect/queryContext.d.ts.map +0 -1
  447. package/dist/dialect/queryContext.js.map +0 -1
  448. package/dist/dialect/vectorSqlDialect.d.ts.map +0 -1
  449. package/dist/dialect/vectorSqlDialect.js.map +0 -1
  450. package/dist/entity/decorator/entity.d.ts.map +0 -1
  451. package/dist/entity/decorator/entity.js.map +0 -1
  452. package/dist/entity/decorator/field.d.ts.map +0 -1
  453. package/dist/entity/decorator/field.js.map +0 -1
  454. package/dist/entity/decorator/filter.d.ts.map +0 -1
  455. package/dist/entity/decorator/filter.js.map +0 -1
  456. package/dist/entity/decorator/hook.d.ts.map +0 -1
  457. package/dist/entity/decorator/hook.js.map +0 -1
  458. package/dist/entity/decorator/id.d.ts.map +0 -1
  459. package/dist/entity/decorator/id.js.map +0 -1
  460. package/dist/entity/decorator/index-decorator.d.ts.map +0 -1
  461. package/dist/entity/decorator/index-decorator.js.map +0 -1
  462. package/dist/entity/decorator/index.d.ts.map +0 -1
  463. package/dist/entity/decorator/index.js.map +0 -1
  464. package/dist/entity/decorator/relation.d.ts.map +0 -1
  465. package/dist/entity/decorator/relation.js.map +0 -1
  466. package/dist/entity/index.d.ts.map +0 -1
  467. package/dist/entity/index.js.map +0 -1
  468. package/dist/entity/metadata/definition.d.ts.map +0 -1
  469. package/dist/entity/metadata/definition.js.map +0 -1
  470. package/dist/entity/test-helpers.d.ts +0 -4
  471. package/dist/entity/test-helpers.d.ts.map +0 -1
  472. package/dist/entity/test-helpers.js +0 -16
  473. package/dist/entity/test-helpers.js.map +0 -1
  474. package/dist/express/index.d.ts.map +0 -1
  475. package/dist/express/index.js.map +0 -1
  476. package/dist/express/querierMiddleware.d.ts.map +0 -1
  477. package/dist/express/querierMiddleware.js.map +0 -1
  478. package/dist/http/contract.d.ts.map +0 -1
  479. package/dist/http/contract.js.map +0 -1
  480. package/dist/http/fetchHandler.d.ts.map +0 -1
  481. package/dist/http/fetchHandler.js.map +0 -1
  482. package/dist/http/handler.d.ts.map +0 -1
  483. package/dist/http/handler.js.map +0 -1
  484. package/dist/http/index.d.ts.map +0 -1
  485. package/dist/http/index.js.map +0 -1
  486. package/dist/http/query.d.ts.map +0 -1
  487. package/dist/http/query.js.map +0 -1
  488. package/dist/index.d.ts.map +0 -1
  489. package/dist/index.js.map +0 -1
  490. package/dist/libsql/index.d.ts.map +0 -1
  491. package/dist/libsql/index.js.map +0 -1
  492. package/dist/libsql/libsqlDialect.d.ts.map +0 -1
  493. package/dist/libsql/libsqlDialect.js.map +0 -1
  494. package/dist/libsql/libsqlQuerier.d.ts.map +0 -1
  495. package/dist/libsql/libsqlQuerier.js.map +0 -1
  496. package/dist/libsql/libsqlQuerierPool.d.ts.map +0 -1
  497. package/dist/libsql/libsqlQuerierPool.js.map +0 -1
  498. package/dist/maria/index.d.ts.map +0 -1
  499. package/dist/maria/index.js.map +0 -1
  500. package/dist/maria/mariaDialect.d.ts.map +0 -1
  501. package/dist/maria/mariaDialect.js.map +0 -1
  502. package/dist/maria/mariadbQuerier.d.ts.map +0 -1
  503. package/dist/maria/mariadbQuerier.js.map +0 -1
  504. package/dist/maria/mariadbQuerierPool.d.ts.map +0 -1
  505. package/dist/maria/mariadbQuerierPool.js.map +0 -1
  506. package/dist/migrate/acquireQuerierForMigrations.d.ts.map +0 -1
  507. package/dist/migrate/acquireQuerierForMigrations.js.map +0 -1
  508. package/dist/migrate/assertCliConfig.d.ts.map +0 -1
  509. package/dist/migrate/assertCliConfig.js.map +0 -1
  510. package/dist/migrate/bin.d.ts.map +0 -1
  511. package/dist/migrate/bin.js.map +0 -1
  512. package/dist/migrate/builder/columnBuilder.d.ts.map +0 -1
  513. package/dist/migrate/builder/columnBuilder.js.map +0 -1
  514. package/dist/migrate/builder/expressions.d.ts.map +0 -1
  515. package/dist/migrate/builder/expressions.js.map +0 -1
  516. package/dist/migrate/builder/index.d.ts.map +0 -1
  517. package/dist/migrate/builder/index.js.map +0 -1
  518. package/dist/migrate/builder/migrationBuilder.d.ts.map +0 -1
  519. package/dist/migrate/builder/migrationBuilder.js.map +0 -1
  520. package/dist/migrate/builder/splitSqlStatements.d.ts.map +0 -1
  521. package/dist/migrate/builder/splitSqlStatements.js.map +0 -1
  522. package/dist/migrate/builder/tableBuilder.d.ts.map +0 -1
  523. package/dist/migrate/builder/tableBuilder.js.map +0 -1
  524. package/dist/migrate/builder/types.d.ts.map +0 -1
  525. package/dist/migrate/builder/types.js.map +0 -1
  526. package/dist/migrate/cli-config.d.ts.map +0 -1
  527. package/dist/migrate/cli-config.js.map +0 -1
  528. package/dist/migrate/cli.d.ts.map +0 -1
  529. package/dist/migrate/cli.js.map +0 -1
  530. package/dist/migrate/codegen/entityCodeGenerator.d.ts.map +0 -1
  531. package/dist/migrate/codegen/entityCodeGenerator.js.map +0 -1
  532. package/dist/migrate/codegen/entityMerger.d.ts.map +0 -1
  533. package/dist/migrate/codegen/entityMerger.js.map +0 -1
  534. package/dist/migrate/codegen/index.d.ts.map +0 -1
  535. package/dist/migrate/codegen/index.js.map +0 -1
  536. package/dist/migrate/codegen/migrationCodeGenerator.d.ts.map +0 -1
  537. package/dist/migrate/codegen/migrationCodeGenerator.js.map +0 -1
  538. package/dist/migrate/codegen/migrationFile.d.ts.map +0 -1
  539. package/dist/migrate/codegen/migrationFile.js.map +0 -1
  540. package/dist/migrate/codegen/smartRelationDetector.d.ts.map +0 -1
  541. package/dist/migrate/codegen/smartRelationDetector.js.map +0 -1
  542. package/dist/migrate/drift/driftDetector.d.ts.map +0 -1
  543. package/dist/migrate/drift/driftDetector.js.map +0 -1
  544. package/dist/migrate/drift/index.d.ts.map +0 -1
  545. package/dist/migrate/drift/index.js.map +0 -1
  546. package/dist/migrate/generator/index.d.ts.map +0 -1
  547. package/dist/migrate/generator/index.js.map +0 -1
  548. package/dist/migrate/generator/mongoSchemaGenerator.d.ts.map +0 -1
  549. package/dist/migrate/generator/mongoSchemaGenerator.js.map +0 -1
  550. package/dist/migrate/index.d.ts.map +0 -1
  551. package/dist/migrate/index.js.map +0 -1
  552. package/dist/migrate/introspection/abstractSqlSchemaIntrospector.d.ts.map +0 -1
  553. package/dist/migrate/introspection/abstractSqlSchemaIntrospector.js.map +0 -1
  554. package/dist/migrate/introspection/baseSqlIntrospector.d.ts.map +0 -1
  555. package/dist/migrate/introspection/baseSqlIntrospector.js.map +0 -1
  556. package/dist/migrate/introspection/index.d.ts.map +0 -1
  557. package/dist/migrate/introspection/index.js.map +0 -1
  558. package/dist/migrate/introspection/mongoIntrospector.d.ts.map +0 -1
  559. package/dist/migrate/introspection/mongoIntrospector.js.map +0 -1
  560. package/dist/migrate/introspection/mysqlIntrospector.d.ts.map +0 -1
  561. package/dist/migrate/introspection/mysqlIntrospector.js.map +0 -1
  562. package/dist/migrate/introspection/postgresIntrospector.d.ts.map +0 -1
  563. package/dist/migrate/introspection/postgresIntrospector.js.map +0 -1
  564. package/dist/migrate/introspection/sqliteIntrospector.d.ts.map +0 -1
  565. package/dist/migrate/introspection/sqliteIntrospector.js.map +0 -1
  566. package/dist/migrate/migrator.d.ts.map +0 -1
  567. package/dist/migrate/migrator.js.map +0 -1
  568. package/dist/migrate/schemaGenerator.d.ts.map +0 -1
  569. package/dist/migrate/schemaGenerator.js.map +0 -1
  570. package/dist/migrate/schemaGeneratorAsync.d.ts.map +0 -1
  571. package/dist/migrate/schemaGeneratorAsync.js.map +0 -1
  572. package/dist/migrate/storage/databaseStorage.d.ts.map +0 -1
  573. package/dist/migrate/storage/databaseStorage.js.map +0 -1
  574. package/dist/migrate/storage/index.d.ts.map +0 -1
  575. package/dist/migrate/storage/index.js.map +0 -1
  576. package/dist/migrate/storage/jsonStorage.d.ts.map +0 -1
  577. package/dist/migrate/storage/jsonStorage.js.map +0 -1
  578. package/dist/migrate/sync/index.d.ts.map +0 -1
  579. package/dist/migrate/sync/index.js.map +0 -1
  580. package/dist/migrate/sync/schemaSync.d.ts.map +0 -1
  581. package/dist/migrate/sync/schemaSync.js.map +0 -1
  582. package/dist/mongo/index.d.ts.map +0 -1
  583. package/dist/mongo/index.js.map +0 -1
  584. package/dist/mongo/mongoDialect.d.ts.map +0 -1
  585. package/dist/mongo/mongoDialect.js.map +0 -1
  586. package/dist/mongo/mongodbNativeDialect.d.ts.map +0 -1
  587. package/dist/mongo/mongodbNativeDialect.js.map +0 -1
  588. package/dist/mongo/mongodbQuerier.d.ts.map +0 -1
  589. package/dist/mongo/mongodbQuerier.js.map +0 -1
  590. package/dist/mongo/mongodbQuerierPool.d.ts.map +0 -1
  591. package/dist/mongo/mongodbQuerierPool.js.map +0 -1
  592. package/dist/mysql/index.d.ts.map +0 -1
  593. package/dist/mysql/index.js.map +0 -1
  594. package/dist/mysql/mysql2Dialect.d.ts.map +0 -1
  595. package/dist/mysql/mysql2Dialect.js.map +0 -1
  596. package/dist/mysql/mysql2Querier.d.ts.map +0 -1
  597. package/dist/mysql/mysql2Querier.js.map +0 -1
  598. package/dist/mysql/mysql2QuerierPool.d.ts.map +0 -1
  599. package/dist/mysql/mysql2QuerierPool.js.map +0 -1
  600. package/dist/mysql/mysqlDialect.d.ts.map +0 -1
  601. package/dist/mysql/mysqlDialect.js.map +0 -1
  602. package/dist/namingStrategy/defaultNamingStrategy.d.ts.map +0 -1
  603. package/dist/namingStrategy/defaultNamingStrategy.js.map +0 -1
  604. package/dist/namingStrategy/index.d.ts.map +0 -1
  605. package/dist/namingStrategy/index.js.map +0 -1
  606. package/dist/namingStrategy/snakeCaseNamingStrategy.d.ts.map +0 -1
  607. package/dist/namingStrategy/snakeCaseNamingStrategy.js.map +0 -1
  608. package/dist/neon/index.d.ts.map +0 -1
  609. package/dist/neon/index.js.map +0 -1
  610. package/dist/neon/neonDialect.d.ts.map +0 -1
  611. package/dist/neon/neonDialect.js.map +0 -1
  612. package/dist/neon/neonQuerier.d.ts.map +0 -1
  613. package/dist/neon/neonQuerier.js.map +0 -1
  614. package/dist/neon/neonQuerierPool.d.ts.map +0 -1
  615. package/dist/neon/neonQuerierPool.js.map +0 -1
  616. package/dist/nestjs/index.d.ts.map +0 -1
  617. package/dist/nestjs/index.js.map +0 -1
  618. package/dist/nestjs/uqlContextInterceptor.d.ts.map +0 -1
  619. package/dist/nestjs/uqlContextInterceptor.js.map +0 -1
  620. package/dist/nestjs/uqlModule.d.ts.map +0 -1
  621. package/dist/nestjs/uqlModule.js.map +0 -1
  622. package/dist/options.d.ts.map +0 -1
  623. package/dist/options.js.map +0 -1
  624. package/dist/postgres/abstractPgQuerier.d.ts.map +0 -1
  625. package/dist/postgres/abstractPgQuerier.js.map +0 -1
  626. package/dist/postgres/abstractPgQuerierPool.d.ts.map +0 -1
  627. package/dist/postgres/abstractPgQuerierPool.js.map +0 -1
  628. package/dist/postgres/index.d.ts.map +0 -1
  629. package/dist/postgres/index.js.map +0 -1
  630. package/dist/postgres/pgDialect.d.ts.map +0 -1
  631. package/dist/postgres/pgDialect.js.map +0 -1
  632. package/dist/postgres/pgQuerier.d.ts.map +0 -1
  633. package/dist/postgres/pgQuerier.js.map +0 -1
  634. package/dist/postgres/pgQuerierPool.d.ts.map +0 -1
  635. package/dist/postgres/pgQuerierPool.js.map +0 -1
  636. package/dist/postgres/postgresDialect.d.ts.map +0 -1
  637. package/dist/postgres/postgresDialect.js.map +0 -1
  638. package/dist/postgres/postgresWireDriverCapabilities.d.ts.map +0 -1
  639. package/dist/postgres/postgresWireDriverCapabilities.js.map +0 -1
  640. package/dist/querier/abstractPoolQuerier.d.ts.map +0 -1
  641. package/dist/querier/abstractPoolQuerier.js.map +0 -1
  642. package/dist/querier/abstractQuerier.d.ts.map +0 -1
  643. package/dist/querier/abstractQuerier.js.map +0 -1
  644. package/dist/querier/abstractQuerierPool.d.ts.map +0 -1
  645. package/dist/querier/abstractQuerierPool.js.map +0 -1
  646. package/dist/querier/abstractSqlQuerier.d.ts.map +0 -1
  647. package/dist/querier/abstractSqlQuerier.js.map +0 -1
  648. package/dist/querier/abstractSqlQuerierPool.d.ts.map +0 -1
  649. package/dist/querier/abstractSqlQuerierPool.js.map +0 -1
  650. package/dist/querier/decorator/index.d.ts.map +0 -1
  651. package/dist/querier/decorator/index.js.map +0 -1
  652. package/dist/querier/decorator/injectQuerier.d.ts.map +0 -1
  653. package/dist/querier/decorator/injectQuerier.js.map +0 -1
  654. package/dist/querier/decorator/log.d.ts.map +0 -1
  655. package/dist/querier/decorator/log.js.map +0 -1
  656. package/dist/querier/decorator/serialized.d.ts.map +0 -1
  657. package/dist/querier/decorator/serialized.js.map +0 -1
  658. package/dist/querier/decorator/transactional.d.ts.map +0 -1
  659. package/dist/querier/decorator/transactional.js.map +0 -1
  660. package/dist/querier/index.d.ts.map +0 -1
  661. package/dist/querier/index.js.map +0 -1
  662. package/dist/schema/canonicalType.d.ts.map +0 -1
  663. package/dist/schema/canonicalType.js.map +0 -1
  664. package/dist/schema/index.d.ts.map +0 -1
  665. package/dist/schema/index.js.map +0 -1
  666. package/dist/schema/schemaAST.d.ts.map +0 -1
  667. package/dist/schema/schemaAST.js.map +0 -1
  668. package/dist/schema/schemaASTBuilder.d.ts.map +0 -1
  669. package/dist/schema/schemaASTBuilder.js.map +0 -1
  670. package/dist/schema/schemaASTDiffer.d.ts.map +0 -1
  671. package/dist/schema/schemaASTDiffer.js.map +0 -1
  672. package/dist/schema/types.d.ts.map +0 -1
  673. package/dist/schema/types.js.map +0 -1
  674. package/dist/sqlite/abstractSqliteQuerier.d.ts.map +0 -1
  675. package/dist/sqlite/abstractSqliteQuerier.js.map +0 -1
  676. package/dist/sqlite/betterSqlite3Dialect.d.ts.map +0 -1
  677. package/dist/sqlite/betterSqlite3Dialect.js.map +0 -1
  678. package/dist/sqlite/index.d.ts.map +0 -1
  679. package/dist/sqlite/index.js.map +0 -1
  680. package/dist/sqlite/sqliteDialect.d.ts.map +0 -1
  681. package/dist/sqlite/sqliteDialect.js.map +0 -1
  682. package/dist/sqlite/sqliteQuerier.d.ts.map +0 -1
  683. package/dist/sqlite/sqliteQuerier.js.map +0 -1
  684. package/dist/sqlite/sqliteQuerierPool.d.ts.map +0 -1
  685. package/dist/sqlite/sqliteQuerierPool.js.map +0 -1
  686. package/dist/type/config.d.ts.map +0 -1
  687. package/dist/type/config.js.map +0 -1
  688. package/dist/type/dialect.d.ts.map +0 -1
  689. package/dist/type/dialect.js.map +0 -1
  690. package/dist/type/entity.d.ts.map +0 -1
  691. package/dist/type/entity.js.map +0 -1
  692. package/dist/type/index.d.ts.map +0 -1
  693. package/dist/type/index.js.map +0 -1
  694. package/dist/type/logger.d.ts.map +0 -1
  695. package/dist/type/logger.js.map +0 -1
  696. package/dist/type/migration.d.ts.map +0 -1
  697. package/dist/type/migration.js.map +0 -1
  698. package/dist/type/migratorDialect.d.ts.map +0 -1
  699. package/dist/type/migratorDialect.js.map +0 -1
  700. package/dist/type/namingStrategy.d.ts.map +0 -1
  701. package/dist/type/namingStrategy.js.map +0 -1
  702. package/dist/type/querier.d.ts.map +0 -1
  703. package/dist/type/querier.js.map +0 -1
  704. package/dist/type/querierPool.d.ts.map +0 -1
  705. package/dist/type/querierPool.js.map +0 -1
  706. package/dist/type/query.d.ts.map +0 -1
  707. package/dist/type/query.js.map +0 -1
  708. package/dist/type/queryAggregate.d.ts.map +0 -1
  709. package/dist/type/queryAggregate.js.map +0 -1
  710. package/dist/type/queryRaw.d.ts.map +0 -1
  711. package/dist/type/queryRaw.js.map +0 -1
  712. package/dist/type/queryWhere.d.ts.map +0 -1
  713. package/dist/type/queryWhere.js.map +0 -1
  714. package/dist/type/universalQuerier.d.ts.map +0 -1
  715. package/dist/type/universalQuerier.js.map +0 -1
  716. package/dist/type/utility.d.ts.map +0 -1
  717. package/dist/type/utility.js.map +0 -1
  718. package/dist/type/vector.d.ts.map +0 -1
  719. package/dist/type/vector.js.map +0 -1
  720. package/dist/util/ansiSqlLiteral.d.ts +0 -23
  721. package/dist/util/ansiSqlLiteral.d.ts.map +0 -1
  722. package/dist/util/ansiSqlLiteral.js +0 -105
  723. package/dist/util/ansiSqlLiteral.js.map +0 -1
  724. package/dist/util/dialect.util.d.ts.map +0 -1
  725. package/dist/util/dialect.util.js.map +0 -1
  726. package/dist/util/field.util.d.ts.map +0 -1
  727. package/dist/util/field.util.js.map +0 -1
  728. package/dist/util/filters.util.d.ts.map +0 -1
  729. package/dist/util/filters.util.js.map +0 -1
  730. package/dist/util/hook.util.d.ts.map +0 -1
  731. package/dist/util/hook.util.js.map +0 -1
  732. package/dist/util/index.d.ts.map +0 -1
  733. package/dist/util/index.js.map +0 -1
  734. package/dist/util/logger.d.ts.map +0 -1
  735. package/dist/util/logger.js.map +0 -1
  736. package/dist/util/object.util.d.ts.map +0 -1
  737. package/dist/util/object.util.js.map +0 -1
  738. package/dist/util/raw.d.ts.map +0 -1
  739. package/dist/util/raw.js.map +0 -1
  740. package/dist/util/relationQuery.util.d.ts.map +0 -1
  741. package/dist/util/relationQuery.util.js.map +0 -1
  742. package/dist/util/sql.util.d.ts.map +0 -1
  743. package/dist/util/sql.util.js.map +0 -1
  744. package/dist/util/string.util.d.ts.map +0 -1
  745. package/dist/util/string.util.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import type { DialectFeatures, DialectName, EntityMeta, FieldOptions, InsertIdSource, NamingStrategy, Type } from '../type/index.js';
1
+ import type { DialectFeatures, DialectName, EntityMeta, FieldOptions, InsertIdSource, NamingStrategy, QueryOptions, QueryWhere, QueryWhereMap, Type } from '../type/index.js';
2
2
  /**
3
3
  * Options for initializing a dialect.
4
4
  */
@@ -36,5 +36,16 @@ export declare abstract class AbstractDialect {
36
36
  * Resolve the column/field name for a property, applying naming strategy if necessary.
37
37
  */
38
38
  resolveColumnName(key: string, field: FieldOptions | undefined): string;
39
+ /**
40
+ * {@link resolveColumnName} for a field key of `meta` - the form query builders need, so reading a
41
+ * column never depends on looking the field up by hand first. `MongoDialect` overrides it to map the
42
+ * primary key to `_id`.
43
+ */
44
+ columnOf<E>(meta: EntityMeta<E>, key: string): string;
45
+ /**
46
+ * A `$where` normalized to a map with the entity's active filters merged in - the only way any
47
+ * dialect should enter a new query scope, so a scope cannot be rendered with its `security: true`
48
+ * filters skipped. Recursion within one scope renders the returned map directly instead.
49
+ */
50
+ protected scopedWhereMap<E>(meta: EntityMeta<E>, where?: QueryWhere<E>, opts?: QueryOptions): QueryWhereMap<E>;
39
51
  }
40
- //# sourceMappingURL=abstractDialect.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { applyFilters, buildQueryWhereAsMap } from '../util/dialect.util.js';
1
2
  /**
2
3
  * Base abstract class for all database dialects (SQL and NoSQL).
3
4
  */
@@ -37,5 +38,20 @@ export class AbstractDialect {
37
38
  }
38
39
  return this.namingStrategy.columnName(field.name);
39
40
  }
41
+ /**
42
+ * {@link resolveColumnName} for a field key of `meta` - the form query builders need, so reading a
43
+ * column never depends on looking the field up by hand first. `MongoDialect` overrides it to map the
44
+ * primary key to `_id`.
45
+ */
46
+ columnOf(meta, key) {
47
+ return this.resolveColumnName(key, meta.fields[key]);
48
+ }
49
+ /**
50
+ * A `$where` normalized to a map with the entity's active filters merged in - the only way any
51
+ * dialect should enter a new query scope, so a scope cannot be rendered with its `security: true`
52
+ * filters skipped. Recursion within one scope renders the returned map directly instead.
53
+ */
54
+ scopedWhereMap(meta, where = {}, opts) {
55
+ return applyFilters(meta, buildQueryWhereAsMap(meta, where), opts);
56
+ }
40
57
  }
41
- //# sourceMappingURL=abstractDialect.js.map
@@ -1,4 +1,4 @@
1
- import { type EntityMeta, type FieldKey, type FieldOptions, type IsolationLevel, type JsonUpdateOp, type Query, type QueryAggMap, type QueryAggregate, type QueryComparisonOptions, type QueryConflictPaths, type QueryContext, type QueryDialect, type QueryExclude, type QueryGroupMap, type QueryHavingMap, type QueryOptions, type QueryPager, type QueryPopulate, QueryRaw, type QueryRawFnOptions, type QuerySearch, type QuerySelect, type QuerySelectOptions, type QuerySelectValue, type QuerySizeComparisonOps, type QuerySortMap, type QueryWhere, type QueryWhereArray, type QueryWhereFieldOperatorMap, type QueryWhereMap, type QueryWhereOptions, type RelationOptions, type SqlDialectName, type SqlQueryDialect, type Type, type UpdatePayload } from '../type/index.js';
1
+ import { type EntityMeta, type FieldKey, type FieldOptions, type IsolationLevel, type JsonColumnType, type JsonUpdateOp, type Query, type QueryAggMap, type QueryAggregate, type QueryComparisonOptions, type QueryConflictPaths, type QueryContext, type QueryDialect, type QueryExclude, type QueryGroupMap, type QueryHavingMap, type QueryOptions, type QueryPager, type QueryPopulate, QueryRaw, type QueryRawFnOptions, type QuerySearch, type QuerySelect, type QuerySelectOptions, type QuerySelectValue, type QuerySizeComparisonOps, type QuerySortMap, type QueryWhere, type QueryWhereArray, type QueryWhereFieldOperatorMap, type QueryWhereMap, type QueryWhereOptions, type RelationOptions, type SqlDialectName, type SqlQueryDialect, type Type, type UpdatePayload } from '../type/index.js';
2
2
  import { VectorSqlDialect } from './vectorSqlDialect.js';
3
3
  export declare abstract class AbstractSqlDialect extends VectorSqlDialect implements QueryDialect, SqlQueryDialect {
4
4
  abstract readonly dialectName: SqlDialectName;
@@ -66,6 +66,8 @@ export declare abstract class AbstractSqlDialect extends VectorSqlDialect implem
66
66
  compare<E>(ctx: QueryContext, entity: Type<E>, key: string, val: unknown, opts?: QueryComparisonOptions): void;
67
67
  protected compareLogicalOperator<E>(ctx: QueryContext, entity: Type<E>, key: '$and' | '$or' | '$not' | '$nor', val: QueryWhereArray<E>, opts: QueryComparisonOptions): void;
68
68
  /** Simple comparison operators: `getComparisonKey → op → addValue`. */
69
+ /** Memoizes {@link escapedColumnName}; see there for why it is per dialect instance. */
70
+ private readonly escapedColumns;
69
71
  private static readonly NEGATE_OP_MAP;
70
72
  private static readonly COMPARE_OP_MAP;
71
73
  private static readonly LIKE_OP_MAP;
@@ -188,7 +190,8 @@ export declare abstract class AbstractSqlDialect extends VectorSqlDialect implem
188
190
  protected having(ctx: QueryContext, having: QueryHavingMap, aggregateExpressions: Record<string, string>): void;
189
191
  private static readonly SORT_DIRECTION_MAP;
190
192
  private resolveSortDirection;
191
- private static readonly havingOpMap;
193
+ /** Scalar comparison operators shared by `HAVING` conditions and `$size` comparisons. */
194
+ private static readonly comparisonOpMap;
192
195
  protected havingCondition(ctx: QueryContext, expr: string, condition: QueryHavingMap[string]): void;
193
196
  find<E>(ctx: QueryContext, entity: Type<E>, q?: Query<E>, opts?: QueryOptions): void;
194
197
  insert<E>(ctx: QueryContext, entity: Type<E>, payload: E | E[], opts?: QueryOptions): void;
@@ -204,7 +207,14 @@ export declare abstract class AbstractSqlDialect extends VectorSqlDialect implem
204
207
  protected getUpsertConflictPathsStr<E>(meta: EntityMeta<E>, conflictPaths: QueryConflictPaths<E>): string;
205
208
  delete<E>(ctx: QueryContext, entity: Type<E>, q: QuerySearch<E>, opts?: QueryOptions): void;
206
209
  escapeId(val: string, forbidQualified?: boolean, addDot?: boolean): string;
207
- protected formatPersistableValue<E>(ctx: QueryContext, field: FieldOptions | undefined, value: unknown): void;
210
+ /**
211
+ * The single type dispatch for a persisted value. Dialects override {@link appendJsonValue} and
212
+ * {@link appendVectorValue} rather than this, so the chain runs once per value - overriding this
213
+ * and delegating back to `super` ran every check twice, measurably slowing every INSERT/UPDATE.
214
+ */
215
+ protected formatPersistableValue(ctx: QueryContext, field: FieldOptions | undefined, value: unknown): void;
216
+ protected appendJsonValue(ctx: QueryContext, value: unknown, _type: JsonColumnType): void;
217
+ protected appendVectorValue(ctx: QueryContext, value: readonly unknown[]): void;
208
218
  /**
209
219
  * Reads `operand` as a JSON value. Passing the `?` placeholder yields the cast for a bound
210
220
  * parameter, and passing an expression re-reads text as JSON - the same SQL either way, which is
@@ -274,21 +284,24 @@ export declare abstract class AbstractSqlDialect extends VectorSqlDialect implem
274
284
  */
275
285
  private normalizeWhereValue;
276
286
  /**
277
- * Filter by relation using an EXISTS subquery.
278
- * Supports all cardinalities: mm (via junction), 1m, m1, and 11.
287
+ * A field key's mapped column (`@Field({ name })`), escaped, memoized per dialect instance: field
288
+ * metadata is shared between dialects while this result is not, since `escapeIdChar` and the naming
289
+ * strategy differ. Weakly keyed so a transient entity's metadata stays collectable.
279
290
  */
291
+ private escapedColumnName;
292
+ private escapedColumn;
293
+ /** As {@link escapedColumn}, but qualified by the query alias when the parent is nested. */
294
+ private escapedParentColumn;
280
295
  /**
281
- * The parent side of a relation-filtering subquery: its table name, escaped id reference, and a
282
- * guard against a relation with no configured references. Shared by
283
- * `compareRelation`/`compareRelationSize`. `rel.references` is asserted non-null at call sites
284
- * relying on this guard, since the check lives here instead of in the caller's own scope.
296
+ * The single path from a relation operator to its target, so none can emit an unscoped subquery:
297
+ * the target's `$where` is merged with its active filters, making a trashed or out-of-scope row
298
+ * invisible here just as it is to a joined `$populate`. The caller's filter bypass is deliberately
299
+ * not propagated (`withDeleted()` does not reach into relations), matching `selectRelationJoins`.
285
300
  */
286
- private resolveRelationParent;
301
+ private appendRelationSubquery;
302
+ /** Filter by relation: a parent matches when {@link appendRelationSubquery} finds one target row. */
287
303
  protected compareRelation<E>(ctx: QueryContext, entity: Type<E>, key: string, val: QueryWhereMap<unknown>, rel: RelationOptions, opts: QueryComparisonOptions): void;
288
- /**
289
- * Filter by relation size using a `COUNT(*)` subquery.
290
- * Supports all cardinalities: mm (via junction), 1m.
291
- */
304
+ /** Filter by relation size: the same subquery, counting instead of testing for existence. */
292
305
  protected compareRelationSize<E>(ctx: QueryContext, entity: Type<E>, key: string, sizeVal: number | QuerySizeComparisonOps, rel: RelationOptions, opts: QueryComparisonOptions): void;
293
306
  /**
294
307
  * Build a complete `$size` comparison expression.
@@ -319,4 +332,3 @@ export declare abstract class AbstractSqlDialect extends VectorSqlDialect implem
319
332
  protected numericCast(expr: string): string;
320
333
  toString(): string;
321
334
  }
322
- //# sourceMappingURL=abstractSqlDialect.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { getMeta } from '../entity/index.js';
2
2
  import { QueryRaw, RAW_ALIAS, RAW_VALUE, } from '../type/index.js';
3
- import { escapeAnsiSqlLiteral, escapeSingleQuotes } from '../util/ansiSqlLiteral.js';
4
- import { applyFilters, asSelectMap, buildQueryWhereAsMap, buildSortMap, escapeSqlId, fillOnFields, filterFieldKeys, flatObject, getFieldKeys, getInsertFieldKeys, getKeys, getRelationRequestSummary, getSoftDeleteValue, hasKeys, hasMultipleKeys, isJsonType, isJsonUpdateOp, isOperatorObject, isOperatorOnlyObject, isPopulatingRelations, isVectorSearch, normalizeScalarFieldSelection, parseGroupMap, parseRelationAtKey, raw, someValue, withoutSoftDeleteFilter, } from '../util/index.js';
3
+ import { asSelectMap, buildQueryWhereAsMap, buildSortMap, escapeSqlId, fillOnFields, filterFieldKeys, flatObject, getFieldKeys, getInsertFieldKeys, getKeys, getRelationRequestSummary, getSoftDeleteValue, hasKeys, hasMultipleKeys, isJsonType, isJsonUpdateOp, isOperatorObject, isOperatorOnlyObject, isPopulatingRelations, isVectorSearch, normalizeScalarFieldSelection, parseGroupMap, parseRelationAtKey, parseRelationSize, raw, someValue, withoutSoftDeleteFilter, } from '../util/index.js';
4
+ import { escapeAnsiSqlLiteral, escapeSingleQuotes } from '../util/sqlLiteral.js';
5
5
  import { buildElemMatchConditions } from './jsonArrayElemMatchUtils.js';
6
6
  import { JSON_ELEM_ALIAS_PREFIX, jsonElemExists } from './jsonSql.js';
7
7
  import { SqlQueryContext } from './queryContext.js';
@@ -81,7 +81,7 @@ export class AbstractSqlDialect extends VectorSqlDialect {
81
81
  returningId(entity) {
82
82
  const meta = getMeta(entity);
83
83
  const idKey = (meta.id ?? 'id');
84
- const idName = this.resolveColumnName(idKey, meta.fields[idKey]);
84
+ const idName = this.columnOf(meta, idKey);
85
85
  return `RETURNING ${this.escapeId(idName)} ${this.escapeId('id')}`;
86
86
  }
87
87
  search(ctx, entity, q = {}, opts = {}) {
@@ -239,9 +239,8 @@ export class AbstractSqlDialect extends VectorSqlDialect {
239
239
  }
240
240
  where(ctx, entity, where = {}, opts = {}) {
241
241
  const meta = getMeta(entity);
242
- // Apply this entity's filters once, at the scope entry point; recursion uses `renderWhere`.
243
- const whereMap = applyFilters(meta, buildQueryWhereAsMap(meta, where), opts);
244
- this.renderWhere(ctx, entity, whereMap, opts);
242
+ // Filters are applied once, here at the scope entry point; recursion uses `renderWhere`.
243
+ this.renderWhere(ctx, entity, this.scopedWhereMap(meta, where, opts), opts);
245
244
  }
246
245
  /** Renders a `$where` tree without applying entity filters (used for same-scope `$and`/`$or` recursion). */
247
246
  renderWhere(ctx, entity, where = {}, opts = {}) {
@@ -322,13 +321,11 @@ export class AbstractSqlDialect extends VectorSqlDialect {
322
321
  if (key.includes('.')) {
323
322
  throw new TypeError(`path ${key} does not exist in ${meta.name}`);
324
323
  }
325
- // Detect relation filtering
326
324
  const rel = meta.relations[key];
327
325
  if (rel) {
328
- // Check if this is a $size query on a relation (count filtering)
329
- const valObj = val;
330
- if (valObj && typeof valObj === 'object' && '$size' in valObj && Object.keys(valObj).length === 1) {
331
- this.compareRelationSize(ctx, entity, key, valObj['$size'], rel, opts);
326
+ const sizeVal = parseRelationSize(val);
327
+ if (sizeVal !== undefined) {
328
+ this.compareRelationSize(ctx, entity, key, sizeVal, rel, opts);
332
329
  return;
333
330
  }
334
331
  this.compareRelation(ctx, entity, key, val, rel, opts);
@@ -382,6 +379,8 @@ export class AbstractSqlDialect extends VectorSqlDialect {
382
379
  }
383
380
  }
384
381
  /** Simple comparison operators: `getComparisonKey → op → addValue`. */
382
+ /** Memoizes {@link escapedColumnName}; see there for why it is per dialect instance. */
383
+ escapedColumns = new WeakMap();
385
384
  static NEGATE_OP_MAP = new Map([
386
385
  ['$not', '$and'],
387
386
  ['$nor', '$or'],
@@ -797,9 +796,7 @@ export class AbstractSqlDialect extends VectorSqlDialect {
797
796
  if (!sqlFn) {
798
797
  throw TypeError(`unsupported aggregate operator: ${entry.op}`);
799
798
  }
800
- const sqlArg = entry.fieldRef === '*'
801
- ? '*'
802
- : this.escapeId(this.resolveColumnName(entry.fieldRef, meta.fields[entry.fieldRef]));
799
+ const sqlArg = entry.fieldRef === '*' ? '*' : this.escapeId(this.columnOf(meta, entry.fieldRef));
803
800
  const expr = `${sqlFn}(${entry.distinct ? 'DISTINCT ' : ''}${sqlArg})`;
804
801
  aggregateExpressions[entry.alias] = expr;
805
802
  selectParts.push(`${expr} ${this.escapeId(entry.alias)}`);
@@ -860,7 +857,8 @@ export class AbstractSqlDialect extends VectorSqlDialect {
860
857
  }
861
858
  return direction;
862
859
  }
863
- static havingOpMap = new Map([
860
+ /** Scalar comparison operators shared by `HAVING` conditions and `$size` comparisons. */
861
+ static comparisonOpMap = new Map([
864
862
  ['$eq', '='],
865
863
  ['$ne', '<>'],
866
864
  ['$gt', '>'],
@@ -900,7 +898,7 @@ export class AbstractSqlDialect extends VectorSqlDialect {
900
898
  ctx.append(this.neExpr(expr, this.addValue(ctx.values, val)));
901
899
  }
902
900
  else {
903
- const sqlOp = AbstractSqlDialect.havingOpMap.get(op);
901
+ const sqlOp = AbstractSqlDialect.comparisonOpMap.get(op);
904
902
  if (!sqlOp)
905
903
  throw TypeError(`unsupported HAVING operator: ${op}`);
906
904
  ctx.append(`${expr} ${sqlOp} `);
@@ -916,29 +914,36 @@ export class AbstractSqlDialect extends VectorSqlDialect {
916
914
  const meta = getMeta(entity);
917
915
  const payloads = fillOnFields(meta, payload, 'onInsert');
918
916
  const keys = getInsertFieldKeys(meta, payloads);
919
- const columns = keys.map((key) => {
920
- const field = meta.fields[key];
921
- return this.escapeId(this.resolveColumnName(key, field));
922
- });
917
+ // Resolve each key's field and escaped column once, then index into them: re-reading
918
+ // `meta.fields[key]` per record cost 40 redundant lookups on a 10-row, 4-column insert.
919
+ const width = keys.length;
920
+ const fields = new Array(width);
921
+ const columns = new Array(width);
922
+ for (let i = 0; i < width; i++) {
923
+ const key = keys[i];
924
+ fields[i] = meta.fields[key];
925
+ columns[i] = this.escapedColumnName(meta, key);
926
+ }
923
927
  const tableName = this.resolveTableName(entity, meta);
924
928
  ctx.append(`INSERT INTO ${this.escapeId(tableName)} (${columns.join(', ')}) VALUES (`);
925
- payloads.forEach((it, recordIndex) => {
926
- if (recordIndex > 0) {
929
+ for (let r = 0; r < payloads.length; r++) {
930
+ if (r > 0) {
927
931
  ctx.append('), (');
928
932
  }
929
- keys.forEach((key, keyIndex) => {
930
- if (keyIndex > 0) {
933
+ const record = payloads[r];
934
+ for (let i = 0; i < width; i++) {
935
+ if (i > 0) {
931
936
  ctx.append(', ');
932
937
  }
933
- const field = meta.fields[key];
934
- if (it[key] === undefined) {
935
- this.appendDefaultInsertValue(ctx, field);
938
+ const value = record[keys[i]];
939
+ if (value === undefined) {
940
+ this.appendDefaultInsertValue(ctx, fields[i]);
936
941
  }
937
942
  else {
938
- this.formatPersistableValue(ctx, field, it[key]);
943
+ this.formatPersistableValue(ctx, fields[i], value);
939
944
  }
940
- });
941
- });
945
+ }
946
+ }
942
947
  ctx.append(')');
943
948
  }
944
949
  /**
@@ -955,13 +960,13 @@ export class AbstractSqlDialect extends VectorSqlDialect {
955
960
  const keys = filterFieldKeys(meta, filledPayload, 'onUpdate');
956
961
  const tableName = this.resolveTableName(entity, meta);
957
962
  ctx.append(`UPDATE ${this.escapeId(tableName)} SET `);
958
- keys.forEach((key, index) => {
959
- if (index > 0) {
963
+ for (let i = 0; i < keys.length; i++) {
964
+ if (i > 0) {
960
965
  ctx.append(', ');
961
966
  }
967
+ const key = keys[i];
962
968
  const field = meta.fields[key];
963
- const columnName = this.resolveColumnName(key, field);
964
- const escapedCol = this.escapeId(columnName);
969
+ const escapedCol = this.escapedColumnName(meta, key);
965
970
  const value = filledPayload[key];
966
971
  if (isJsonUpdateOp(value)) {
967
972
  this.formatJsonUpdate(ctx, escapedCol, value, field);
@@ -970,7 +975,7 @@ export class AbstractSqlDialect extends VectorSqlDialect {
970
975
  ctx.append(`${escapedCol} = `);
971
976
  this.formatPersistableValue(ctx, field, value);
972
977
  }
973
- });
978
+ }
974
979
  this.search(ctx, entity, q, opts);
975
980
  }
976
981
  upsert(ctx, entity, conflictPaths, payload) {
@@ -1039,21 +1044,33 @@ export class AbstractSqlDialect extends VectorSqlDialect {
1039
1044
  escapeId(val, forbidQualified, addDot) {
1040
1045
  return escapeSqlId(val, this.escapeIdChar, forbidQualified, addDot);
1041
1046
  }
1047
+ /**
1048
+ * The single type dispatch for a persisted value. Dialects override {@link appendJsonValue} and
1049
+ * {@link appendVectorValue} rather than this, so the chain runs once per value - overriding this
1050
+ * and delegating back to `super` ran every check twice, measurably slowing every INSERT/UPDATE.
1051
+ */
1042
1052
  formatPersistableValue(ctx, field, value) {
1043
1053
  if (value instanceof QueryRaw) {
1044
1054
  this.getRawValue(ctx, { value });
1045
1055
  return;
1046
1056
  }
1047
- if (isJsonType(field?.type)) {
1048
- ctx.addValue(value == null ? null : JSON.stringify(value));
1057
+ const type = field?.type;
1058
+ if (isJsonType(type)) {
1059
+ this.appendJsonValue(ctx, value, type);
1049
1060
  return;
1050
1061
  }
1051
- if (field?.type === 'vector' && Array.isArray(value)) {
1052
- ctx.addValue(`[${value.join(',')}]`);
1062
+ if (type === 'vector' && Array.isArray(value)) {
1063
+ this.appendVectorValue(ctx, value);
1053
1064
  return;
1054
1065
  }
1055
1066
  ctx.addValue(value);
1056
1067
  }
1068
+ appendJsonValue(ctx, value, _type) {
1069
+ ctx.addValue(value == null ? null : JSON.stringify(value));
1070
+ }
1071
+ appendVectorValue(ctx, value) {
1072
+ ctx.addValue(`[${value.join(',')}]`);
1073
+ }
1057
1074
  /**
1058
1075
  * Reads `operand` as a JSON value. Passing the `?` placeholder yields the cast for a bound
1059
1076
  * parameter, and passing an expression re-reads text as JSON - the same SQL either way, which is
@@ -1208,97 +1225,85 @@ export class AbstractSqlDialect extends VectorSqlDialect {
1208
1225
  return { $eq: val };
1209
1226
  }
1210
1227
  /**
1211
- * Filter by relation using an EXISTS subquery.
1212
- * Supports all cardinalities: mm (via junction), 1m, m1, and 11.
1228
+ * A field key's mapped column (`@Field({ name })`), escaped, memoized per dialect instance: field
1229
+ * metadata is shared between dialects while this result is not, since `escapeIdChar` and the naming
1230
+ * strategy differ. Weakly keyed so a transient entity's metadata stays collectable.
1213
1231
  */
1232
+ escapedColumnName(meta, key) {
1233
+ const field = meta.fields[key];
1234
+ if (!field) {
1235
+ return this.escapeId(this.columnOf(meta, key));
1236
+ }
1237
+ let escaped = this.escapedColumns.get(field);
1238
+ if (escaped === undefined) {
1239
+ escaped = this.escapeId(this.columnOf(meta, key));
1240
+ this.escapedColumns.set(field, escaped);
1241
+ }
1242
+ return escaped;
1243
+ }
1244
+ escapedColumn(table, meta, key) {
1245
+ return this.escapeId(table, false, true) + this.escapedColumnName(meta, key);
1246
+ }
1247
+ /** As {@link escapedColumn}, but qualified by the query alias when the parent is nested. */
1248
+ escapedParentColumn(parentTable, meta, opts, key) {
1249
+ return opts.prefix
1250
+ ? this.escapeId(opts.prefix, true, true) + this.escapedColumnName(meta, key)
1251
+ : this.escapedColumn(parentTable, meta, key);
1252
+ }
1214
1253
  /**
1215
- * The parent side of a relation-filtering subquery: its table name, escaped id reference, and a
1216
- * guard against a relation with no configured references. Shared by
1217
- * `compareRelation`/`compareRelationSize`. `rel.references` is asserted non-null at call sites
1218
- * relying on this guard, since the check lives here instead of in the caller's own scope.
1254
+ * The single path from a relation operator to its target, so none can emit an unscoped subquery:
1255
+ * the target's `$where` is merged with its active filters, making a trashed or out-of-scope row
1256
+ * invisible here just as it is to a joined `$populate`. The caller's filter bypass is deliberately
1257
+ * not propagated (`withDeleted()` does not reach into relations), matching `selectRelationJoins`.
1219
1258
  */
1220
- resolveRelationParent(entity, key, rel, opts) {
1259
+ appendRelationSubquery(ctx, entity, key, rel, opts, projection, val) {
1221
1260
  const meta = getMeta(entity);
1222
1261
  const parentTable = this.resolveTableName(entity, meta);
1223
1262
  if (!rel.references?.length) {
1224
1263
  throw new TypeError(`Relation '${key}' on '${parentTable}' has no references defined`);
1225
1264
  }
1226
- const escapedParentId = (opts.prefix ? this.escapeId(opts.prefix, true, true) : this.escapeId(parentTable, false, true)) +
1227
- this.escapeId(meta.id);
1228
- return { parentTable, escapedParentId };
1229
- }
1230
- compareRelation(ctx, entity, key, val, rel, opts) {
1231
- const { parentTable, escapedParentId } = this.resolveRelationParent(entity, key, rel, opts);
1232
1265
  const references = rel.references;
1266
+ const escapedParentId = this.escapedParentColumn(parentTable, meta, opts, meta.id);
1233
1267
  const relatedEntity = rel.entity();
1234
1268
  const relatedMeta = getMeta(relatedEntity);
1235
1269
  const relatedTable = this.resolveTableName(relatedEntity, relatedMeta);
1236
- ctx.append('EXISTS (SELECT 1 FROM ');
1270
+ // Resolved before any SQL is emitted: it also decides whether the mm form reaches the target.
1271
+ const targetWhere = this.scopedWhereMap(relatedMeta, val);
1272
+ ctx.append(`(SELECT ${projection} FROM `);
1237
1273
  if (rel.cardinality === 'mm' && rel.through) {
1238
- // ManyToMany: EXISTS (SELECT 1 FROM JunctionTable WHERE junction.localFk = parent.id AND junction.foreignFk IN (SELECT related.id FROM Related WHERE ...))
1239
1274
  const throughEntity = rel.through();
1240
1275
  const throughMeta = getMeta(throughEntity);
1241
1276
  const throughTable = this.resolveTableName(throughEntity, throughMeta);
1242
- const localFk = references[0].local;
1243
- const foreignFk = references[1].local;
1244
- const relatedId = relatedMeta.id;
1245
1277
  ctx.append(this.escapeId(throughTable));
1246
- ctx.append(` WHERE ${this.escapeId(throughTable, false, true)}${this.escapeId(localFk)} = ${escapedParentId}`);
1247
- ctx.append(` AND ${this.escapeId(throughTable, false, true)}${this.escapeId(foreignFk)} IN (`);
1248
- ctx.append(`SELECT ${this.escapeId(relatedTable, false, true)}${this.escapeId(relatedId)} FROM ${this.escapeId(relatedTable)}`);
1249
- this.where(ctx, relatedEntity, val, {
1250
- prefix: relatedTable,
1251
- clause: 'WHERE',
1252
- filters: { softDelete: false },
1253
- });
1254
- ctx.append(')');
1278
+ ctx.append(` WHERE ${this.escapedColumn(throughTable, throughMeta, references[0].local)} = ${escapedParentId}`);
1279
+ // The junction is a row being read too: a soft-deleted link is not a link.
1280
+ this.where(ctx, throughEntity, {}, { prefix: throughTable, clause: 'AND' });
1281
+ if (hasKeys(targetWhere)) {
1282
+ ctx.append(` AND ${this.escapedColumn(throughTable, throughMeta, references[1].local)} IN (`);
1283
+ ctx.append(`SELECT ${this.escapedColumn(relatedTable, relatedMeta, relatedMeta.id)} FROM ${this.escapeId(relatedTable)}`);
1284
+ this.renderWhere(ctx, relatedEntity, targetWhere, { prefix: relatedTable, clause: 'WHERE' });
1285
+ ctx.append(')');
1286
+ }
1255
1287
  }
1256
1288
  else {
1257
- // 1m / m1 / 11: EXISTS (SELECT 1 FROM Related WHERE related.fk_or_pk = parent.pk_or_fk AND ...)
1258
- // Left side is always relatedTable.references[0].foreign
1259
- // Right side is the parent's PK (1m) or the parent's FK (m1/11)
1260
- const joinLeft = `${this.escapeId(relatedTable, false, true)}${this.escapeId(references[0].foreign)}`;
1289
+ const joinLeft = this.escapedColumn(relatedTable, relatedMeta, references[0].foreign);
1261
1290
  const joinRight = rel.cardinality === '1m'
1262
1291
  ? escapedParentId
1263
- : (opts.prefix ? this.escapeId(opts.prefix, true, true) : this.escapeId(parentTable, false, true)) +
1264
- this.escapeId(references[0].local);
1292
+ : this.escapedParentColumn(parentTable, meta, opts, references[0].local);
1265
1293
  ctx.append(this.escapeId(relatedTable));
1266
1294
  ctx.append(` WHERE ${joinLeft} = ${joinRight}`);
1267
- this.where(ctx, relatedEntity, val, {
1268
- prefix: relatedTable,
1269
- clause: 'AND',
1270
- filters: { softDelete: false },
1271
- });
1295
+ this.renderWhere(ctx, relatedEntity, targetWhere, { prefix: relatedTable, clause: 'AND' });
1272
1296
  }
1273
1297
  ctx.append(')');
1274
1298
  }
1275
- /**
1276
- * Filter by relation size using a `COUNT(*)` subquery.
1277
- * Supports all cardinalities: mm (via junction), 1m.
1278
- */
1299
+ /** Filter by relation: a parent matches when {@link appendRelationSubquery} finds one target row. */
1300
+ compareRelation(ctx, entity, key, val, rel, opts) {
1301
+ ctx.append('EXISTS ');
1302
+ this.appendRelationSubquery(ctx, entity, key, rel, opts, '1', val);
1303
+ }
1304
+ /** Filter by relation size: the same subquery, counting instead of testing for existence. */
1279
1305
  compareRelationSize(ctx, entity, key, sizeVal, rel, opts) {
1280
- const { escapedParentId } = this.resolveRelationParent(entity, key, rel, opts);
1281
- const appendSubquery = () => {
1282
- ctx.append('(SELECT COUNT(*) FROM ');
1283
- if (rel.cardinality === 'mm' && rel.through) {
1284
- const throughEntity = rel.through();
1285
- const throughMeta = getMeta(throughEntity);
1286
- const throughTable = this.resolveTableName(throughEntity, throughMeta);
1287
- const localFk = rel.references[0].local;
1288
- ctx.append(this.escapeId(throughTable));
1289
- ctx.append(` WHERE ${this.escapeId(throughTable, false, true)}${this.escapeId(localFk)} = ${escapedParentId}`);
1290
- }
1291
- else {
1292
- const relatedEntity = rel.entity();
1293
- const relatedMeta = getMeta(relatedEntity);
1294
- const relatedTable = this.resolveTableName(relatedEntity, relatedMeta);
1295
- const joinLeft = `${this.escapeId(relatedTable, false, true)}${this.escapeId(rel.references[0].foreign)}`;
1296
- ctx.append(this.escapeId(relatedTable));
1297
- ctx.append(` WHERE ${joinLeft} = ${escapedParentId}`);
1298
- }
1299
- ctx.append(')');
1300
- };
1301
- this.buildSizeComparison(ctx, appendSubquery, sizeVal);
1306
+ this.buildSizeComparison(ctx, () => this.appendRelationSubquery(ctx, entity, key, rel, opts, 'COUNT(*)', {}), sizeVal);
1302
1307
  }
1303
1308
  /**
1304
1309
  * Build a complete `$size` comparison expression.
@@ -1331,42 +1336,20 @@ export class AbstractSqlDialect extends VectorSqlDialect {
1331
1336
  * Append a single size comparison operator and value to the context.
1332
1337
  */
1333
1338
  appendSizeOp(ctx, op, val) {
1334
- switch (op) {
1335
- case '$eq':
1336
- ctx.append(' = ');
1337
- ctx.addValue(val);
1338
- break;
1339
- case '$ne':
1340
- ctx.append(' <> ');
1341
- ctx.addValue(val);
1342
- break;
1343
- case '$gt':
1344
- ctx.append(' > ');
1345
- ctx.addValue(val);
1346
- break;
1347
- case '$gte':
1348
- ctx.append(' >= ');
1349
- ctx.addValue(val);
1350
- break;
1351
- case '$lt':
1352
- ctx.append(' < ');
1353
- ctx.addValue(val);
1354
- break;
1355
- case '$lte':
1356
- ctx.append(' <= ');
1357
- ctx.addValue(val);
1358
- break;
1359
- case '$between': {
1360
- const [min, max] = val;
1361
- ctx.append(' BETWEEN ');
1362
- ctx.addValue(min);
1363
- ctx.append(' AND ');
1364
- ctx.addValue(max);
1365
- break;
1366
- }
1367
- default:
1368
- throw TypeError(`unsupported $size comparison operator: ${op}`);
1339
+ if (op === '$between') {
1340
+ const [min, max] = val;
1341
+ ctx.append(' BETWEEN ');
1342
+ ctx.addValue(min);
1343
+ ctx.append(' AND ');
1344
+ ctx.addValue(max);
1345
+ return;
1346
+ }
1347
+ const sqlOp = AbstractSqlDialect.comparisonOpMap.get(op);
1348
+ if (!sqlOp) {
1349
+ throw TypeError(`unsupported $size comparison operator: ${op}`);
1369
1350
  }
1351
+ ctx.append(` ${sqlOp} `);
1352
+ ctx.addValue(val);
1370
1353
  }
1371
1354
  /** ANSI-style single-quote escaping. MySQL-family dialects override this for backslash escaping. */
1372
1355
  escape(value) {
@@ -1408,4 +1391,3 @@ export class AbstractSqlDialect extends VectorSqlDialect {
1408
1391
  return this.dialectName;
1409
1392
  }
1410
1393
  }
1411
- //# sourceMappingURL=abstractSqlDialect.js.map
@@ -6,4 +6,3 @@ export * from './abstractDialect.js';
6
6
  export * from './abstractSqlDialect.js';
7
7
  export * from './mysqlLikeSqlDialect.js';
8
8
  export * from './queryContext.js';
9
- //# sourceMappingURL=index.d.ts.map
@@ -6,4 +6,3 @@ export * from './abstractDialect.js';
6
6
  export * from './abstractSqlDialect.js';
7
7
  export * from './mysqlLikeSqlDialect.js';
8
8
  export * from './queryContext.js';
9
- //# sourceMappingURL=index.js.map
@@ -6,4 +6,3 @@
6
6
  * identical - they used to take different code paths and emit different SQL.
7
7
  */
8
8
  export declare function buildElemMatchConditions(match: Record<string, unknown>, onCondition: (field: string, op: string, value: unknown) => string): string[];
9
- //# sourceMappingURL=jsonArrayElemMatchUtils.d.ts.map
@@ -11,4 +11,3 @@ export function buildElemMatchConditions(match, onCondition) {
11
11
  ? Object.entries(value).map(([op, opVal]) => onCondition(field, op, opVal))
12
12
  : onCondition(field, '$eq', value));
13
13
  }
14
- //# sourceMappingURL=jsonArrayElemMatchUtils.js.map
@@ -41,4 +41,3 @@ export declare function jsonSetTarget(expr: string, field: FieldOptions | undefi
41
41
  export declare function jsonRemoveCall(fn: string, expr: string, keys: readonly string[]): string;
42
42
  /** `WHERE` is omitted for an empty `$elemMatch`, which asks only that the array has an element. */
43
43
  export declare function jsonElemExists(from: string, conditions: readonly string[]): string;
44
- //# sourceMappingURL=jsonSql.d.ts.map
@@ -1,4 +1,4 @@
1
- import { escapeSingleQuotes } from '../util/ansiSqlLiteral.js';
1
+ import { escapeSingleQuotes } from '../util/sqlLiteral.js';
2
2
  /**
3
3
  * Alias prefix for the derived table a dialect explodes a JSON array into to test `$all`/
4
4
  * `$elemMatch` (e.g. SQLite's `json_each(col) AS _uql_elem_1`). Passed to
@@ -54,4 +54,3 @@ export function jsonElemExists(from, conditions) {
54
54
  const where = conditions.length ? ` WHERE ${conditions.join(' AND ')}` : '';
55
55
  return `EXISTS (SELECT 1 FROM ${from}${where})`;
56
56
  }
57
- //# sourceMappingURL=jsonSql.js.map
@@ -72,4 +72,3 @@ export declare abstract class MysqlLikeSqlDialect extends AbstractSqlDialect {
72
72
  protected jsonElemFrom(jsonField: string, fields: readonly string[], alias: string, asJson?: boolean): string;
73
73
  protected jsonElemRef(alias: string, field?: string, asJson?: boolean): string;
74
74
  }
75
- //# sourceMappingURL=mysqlLikeSqlDialect.d.ts.map
@@ -1,5 +1,4 @@
1
- import SqlString from 'sqlstring';
2
- import { escapeSingleQuotes } from '../util/ansiSqlLiteral.js';
1
+ import { escapeMysqlSqlLiteral, escapeSingleQuotes } from '../util/sqlLiteral.js';
3
2
  import { AbstractSqlDialect } from './abstractSqlDialect.js';
4
3
  import { JSON_PULL_ALIAS, jsonAssignCall, jsonPath, jsonRemoveCall, jsonSetTarget } from './jsonSql.js';
5
4
  /**
@@ -46,7 +45,7 @@ export class MysqlLikeSqlDialect extends AbstractSqlDialect {
46
45
  insertIdSource = 'firstId';
47
46
  maxBindValues = 65535;
48
47
  escape(value) {
49
- return SqlString.escape(value);
48
+ return escapeMysqlSqlLiteral(value);
50
49
  }
51
50
  numericCast(expr) {
52
51
  return `CAST(${expr} AS DECIMAL)`;
@@ -132,4 +131,3 @@ export class MysqlLikeSqlDialect extends AbstractSqlDialect {
132
131
  return asJson ? this.jsonCast(ref) : ref;
133
132
  }
134
133
  }
135
- //# sourceMappingURL=mysqlLikeSqlDialect.js.map