@warlock.js/cascade 5.29.0 → 5.31.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 (392) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -5
  3. package/cjs/index.cjs +101 -102
  4. package/cjs/index.cjs.map +1 -1
  5. package/esm/context/database-data-source-context.d.mts +1 -1
  6. package/esm/context/database-data-source-context.d.mts.map +1 -1
  7. package/esm/context/database-data-source-context.mjs +1 -1
  8. package/esm/context/database-data-source-context.mjs.map +1 -1
  9. package/esm/context/database-transaction-context.d.mts +1 -1
  10. package/esm/context/database-transaction-context.d.mts.map +1 -1
  11. package/esm/context/database-transaction-context.mjs +1 -1
  12. package/esm/context/database-transaction-context.mjs.map +1 -1
  13. package/esm/contracts/database-driver.contract.d.mts +1 -1
  14. package/esm/contracts/database-driver.contract.d.mts.map +1 -1
  15. package/esm/contracts/database-id-generator.contract.d.mts +1 -1
  16. package/esm/contracts/database-id-generator.contract.d.mts.map +1 -1
  17. package/esm/contracts/database-remover.contract.d.mts +1 -1
  18. package/esm/contracts/database-remover.contract.d.mts.map +1 -1
  19. package/esm/contracts/database-restorer.contract.d.mts +1 -1
  20. package/esm/contracts/database-restorer.contract.d.mts.map +1 -1
  21. package/esm/contracts/database-writer.contract.d.mts +1 -1
  22. package/esm/contracts/database-writer.contract.d.mts.map +1 -1
  23. package/esm/contracts/driver-blueprint.contract.d.mts +1 -1
  24. package/esm/contracts/driver-blueprint.contract.d.mts.map +1 -1
  25. package/esm/contracts/migration-driver.contract.d.mts +1 -1
  26. package/esm/contracts/migration-driver.contract.d.mts.map +1 -1
  27. package/esm/contracts/query-builder.contract.d.mts +1 -1
  28. package/esm/contracts/query-builder.contract.d.mts.map +1 -1
  29. package/esm/contracts/sync-adapter.contract.d.mts +1 -1
  30. package/esm/contracts/sync-adapter.contract.d.mts.map +1 -1
  31. package/esm/data-source/data-source-registry.d.mts +1 -1
  32. package/esm/data-source/data-source-registry.d.mts.map +1 -1
  33. package/esm/data-source/data-source-registry.mjs +1 -1
  34. package/esm/data-source/data-source-registry.mjs.map +1 -1
  35. package/esm/data-source/data-source.d.mts +1 -1
  36. package/esm/data-source/data-source.d.mts.map +1 -1
  37. package/esm/data-source/data-source.mjs +1 -1
  38. package/esm/data-source/data-source.mjs.map +1 -1
  39. package/esm/database-dirty-tracker.d.mts +1 -1
  40. package/esm/database-dirty-tracker.d.mts.map +1 -1
  41. package/esm/database-dirty-tracker.mjs +1 -1
  42. package/esm/database-dirty-tracker.mjs.map +1 -1
  43. package/esm/drivers/mongodb/mongodb-blueprint.mjs +1 -1
  44. package/esm/drivers/mongodb/mongodb-blueprint.mjs.map +1 -1
  45. package/esm/drivers/mongodb/mongodb-driver.d.mts +1 -1
  46. package/esm/drivers/mongodb/mongodb-driver.d.mts.map +1 -1
  47. package/esm/drivers/mongodb/mongodb-driver.mjs +1 -1
  48. package/esm/drivers/mongodb/mongodb-driver.mjs.map +1 -1
  49. package/esm/drivers/mongodb/mongodb-id-generator.d.mts +1 -1
  50. package/esm/drivers/mongodb/mongodb-id-generator.d.mts.map +1 -1
  51. package/esm/drivers/mongodb/mongodb-id-generator.mjs +1 -1
  52. package/esm/drivers/mongodb/mongodb-id-generator.mjs.map +1 -1
  53. package/esm/drivers/mongodb/mongodb-migration-driver.d.mts +1 -1
  54. package/esm/drivers/mongodb/mongodb-migration-driver.d.mts.map +1 -1
  55. package/esm/drivers/mongodb/mongodb-migration-driver.mjs +1 -1
  56. package/esm/drivers/mongodb/mongodb-migration-driver.mjs.map +1 -1
  57. package/esm/drivers/mongodb/mongodb-query-builder.d.mts +1 -1
  58. package/esm/drivers/mongodb/mongodb-query-builder.d.mts.map +1 -1
  59. package/esm/drivers/mongodb/mongodb-query-builder.mjs +1 -1
  60. package/esm/drivers/mongodb/mongodb-query-builder.mjs.map +1 -1
  61. package/esm/drivers/mongodb/mongodb-query-operations.d.mts +1 -1
  62. package/esm/drivers/mongodb/mongodb-query-operations.d.mts.map +1 -1
  63. package/esm/drivers/mongodb/mongodb-query-operations.mjs +1 -1
  64. package/esm/drivers/mongodb/mongodb-query-operations.mjs.map +1 -1
  65. package/esm/drivers/mongodb/mongodb-query-parser.d.mts +1 -1
  66. package/esm/drivers/mongodb/mongodb-query-parser.d.mts.map +1 -1
  67. package/esm/drivers/mongodb/mongodb-query-parser.mjs +1 -1
  68. package/esm/drivers/mongodb/mongodb-query-parser.mjs.map +1 -1
  69. package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts +1 -1
  70. package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts.map +1 -1
  71. package/esm/drivers/mongodb/mongodb-sync-adapter.mjs +1 -1
  72. package/esm/drivers/mongodb/mongodb-sync-adapter.mjs.map +1 -1
  73. package/esm/drivers/mongodb/mongodb-update-translator.mjs +1 -1
  74. package/esm/drivers/mongodb/mongodb-update-translator.mjs.map +1 -1
  75. package/esm/drivers/mongodb/pipeline-stage-object.mjs +1 -1
  76. package/esm/drivers/mongodb/pipeline-stage-object.mjs.map +1 -1
  77. package/esm/drivers/mongodb/types.d.mts +1 -1
  78. package/esm/drivers/mongodb/types.d.mts.map +1 -1
  79. package/esm/drivers/postgres/naming.mjs +1 -1
  80. package/esm/drivers/postgres/naming.mjs.map +1 -1
  81. package/esm/drivers/postgres/postgres-blueprint.d.mts +1 -1
  82. package/esm/drivers/postgres/postgres-blueprint.d.mts.map +1 -1
  83. package/esm/drivers/postgres/postgres-blueprint.mjs +1 -1
  84. package/esm/drivers/postgres/postgres-blueprint.mjs.map +1 -1
  85. package/esm/drivers/postgres/postgres-dialect.d.mts +1 -1
  86. package/esm/drivers/postgres/postgres-dialect.d.mts.map +1 -1
  87. package/esm/drivers/postgres/postgres-dialect.mjs +1 -1
  88. package/esm/drivers/postgres/postgres-dialect.mjs.map +1 -1
  89. package/esm/drivers/postgres/postgres-driver.d.mts +1 -1
  90. package/esm/drivers/postgres/postgres-driver.d.mts.map +1 -1
  91. package/esm/drivers/postgres/postgres-driver.mjs +1 -1
  92. package/esm/drivers/postgres/postgres-driver.mjs.map +1 -1
  93. package/esm/drivers/postgres/postgres-migration-driver.d.mts +1 -1
  94. package/esm/drivers/postgres/postgres-migration-driver.d.mts.map +1 -1
  95. package/esm/drivers/postgres/postgres-migration-driver.mjs +1 -1
  96. package/esm/drivers/postgres/postgres-migration-driver.mjs.map +1 -1
  97. package/esm/drivers/postgres/postgres-query-builder.d.mts +1 -1
  98. package/esm/drivers/postgres/postgres-query-builder.d.mts.map +1 -1
  99. package/esm/drivers/postgres/postgres-query-builder.mjs +1 -1
  100. package/esm/drivers/postgres/postgres-query-builder.mjs.map +1 -1
  101. package/esm/drivers/postgres/postgres-query-parser.d.mts +1 -1
  102. package/esm/drivers/postgres/postgres-query-parser.d.mts.map +1 -1
  103. package/esm/drivers/postgres/postgres-query-parser.mjs +1 -2
  104. package/esm/drivers/postgres/postgres-query-parser.mjs.map +1 -1
  105. package/esm/drivers/postgres/postgres-sql-serializer.mjs +1 -1
  106. package/esm/drivers/postgres/postgres-sql-serializer.mjs.map +1 -1
  107. package/esm/drivers/postgres/postgres-ttl-purge.mjs +1 -1
  108. package/esm/drivers/postgres/postgres-ttl-purge.mjs.map +1 -1
  109. package/esm/drivers/postgres/postgres-type-converters.mjs +1 -1
  110. package/esm/drivers/postgres/postgres-type-converters.mjs.map +1 -1
  111. package/esm/drivers/postgres/postgres-update-validator.mjs +1 -1
  112. package/esm/drivers/postgres/postgres-update-validator.mjs.map +1 -1
  113. package/esm/drivers/postgres/types.d.mts +1 -1
  114. package/esm/drivers/postgres/types.d.mts.map +1 -1
  115. package/esm/drivers/sql/sql-dialect.contract.d.mts +1 -1
  116. package/esm/drivers/sql/sql-dialect.contract.d.mts.map +1 -1
  117. package/esm/drivers/sql/sql-types.d.mts +1 -1
  118. package/esm/drivers/sql/sql-types.d.mts.map +1 -1
  119. package/esm/errors/missing-data-source.error.d.mts +1 -1
  120. package/esm/errors/missing-data-source.error.d.mts.map +1 -1
  121. package/esm/errors/missing-data-source.error.mjs +1 -1
  122. package/esm/errors/missing-data-source.error.mjs.map +1 -1
  123. package/esm/errors/transaction-rollback.error.d.mts +1 -1
  124. package/esm/errors/transaction-rollback.error.d.mts.map +1 -1
  125. package/esm/errors/transaction-rollback.error.mjs +1 -1
  126. package/esm/errors/transaction-rollback.error.mjs.map +1 -1
  127. package/esm/errors/undefined-where-value.error.d.mts +1 -1
  128. package/esm/errors/undefined-where-value.error.d.mts.map +1 -1
  129. package/esm/errors/undefined-where-value.error.mjs +1 -1
  130. package/esm/errors/undefined-where-value.error.mjs.map +1 -1
  131. package/esm/errors/unsafe-filter.error.d.mts +1 -1
  132. package/esm/errors/unsafe-filter.error.d.mts.map +1 -1
  133. package/esm/errors/unsafe-filter.error.mjs +1 -1
  134. package/esm/errors/unsafe-filter.error.mjs.map +1 -1
  135. package/esm/errors/unsafe-raw-expression.error.d.mts +1 -1
  136. package/esm/errors/unsafe-raw-expression.error.d.mts.map +1 -1
  137. package/esm/errors/unsafe-raw-expression.error.mjs +1 -1
  138. package/esm/errors/unsafe-raw-expression.error.mjs.map +1 -1
  139. package/esm/errors/unsupported-lean-operation.error.d.mts +1 -1
  140. package/esm/errors/unsupported-lean-operation.error.d.mts.map +1 -1
  141. package/esm/errors/unsupported-lean-operation.error.mjs +1 -1
  142. package/esm/errors/unsupported-lean-operation.error.mjs.map +1 -1
  143. package/esm/errors/unsupported-lock-for-update.error.d.mts +1 -1
  144. package/esm/errors/unsupported-lock-for-update.error.d.mts.map +1 -1
  145. package/esm/errors/unsupported-lock-for-update.error.mjs +1 -1
  146. package/esm/errors/unsupported-lock-for-update.error.mjs.map +1 -1
  147. package/esm/errors/unsupported-query-operation.error.d.mts +1 -1
  148. package/esm/errors/unsupported-query-operation.error.d.mts.map +1 -1
  149. package/esm/errors/unsupported-query-operation.error.mjs +1 -1
  150. package/esm/errors/unsupported-query-operation.error.mjs.map +1 -1
  151. package/esm/errors/unsupported-update-operation.error.d.mts +1 -1
  152. package/esm/errors/unsupported-update-operation.error.d.mts.map +1 -1
  153. package/esm/errors/unsupported-update-operation.error.mjs +1 -1
  154. package/esm/errors/unsupported-update-operation.error.mjs.map +1 -1
  155. package/esm/events/model-events.d.mts +1 -1
  156. package/esm/events/model-events.d.mts.map +1 -1
  157. package/esm/events/model-events.mjs +1 -1
  158. package/esm/events/model-events.mjs.map +1 -1
  159. package/esm/expressions/aggregate-expressions.d.mts +1 -1
  160. package/esm/expressions/aggregate-expressions.d.mts.map +1 -1
  161. package/esm/expressions/aggregate-expressions.mjs +1 -1
  162. package/esm/expressions/aggregate-expressions.mjs.map +1 -1
  163. package/esm/expressions/column-expressions.d.mts +1 -1
  164. package/esm/expressions/column-expressions.d.mts.map +1 -1
  165. package/esm/expressions/column-expressions.mjs +1 -1
  166. package/esm/expressions/column-expressions.mjs.map +1 -1
  167. package/esm/migration/column-builder.d.mts +1 -1
  168. package/esm/migration/column-builder.d.mts.map +1 -1
  169. package/esm/migration/column-builder.mjs +1 -1
  170. package/esm/migration/column-builder.mjs.map +1 -1
  171. package/esm/migration/column-helpers.d.mts +1 -1
  172. package/esm/migration/column-helpers.d.mts.map +1 -1
  173. package/esm/migration/column-helpers.mjs +1 -1
  174. package/esm/migration/column-helpers.mjs.map +1 -1
  175. package/esm/migration/foreign-key-builder.d.mts +1 -1
  176. package/esm/migration/foreign-key-builder.d.mts.map +1 -1
  177. package/esm/migration/foreign-key-builder.mjs +1 -1
  178. package/esm/migration/foreign-key-builder.mjs.map +1 -1
  179. package/esm/migration/migration-order.mjs +1 -1
  180. package/esm/migration/migration-order.mjs.map +1 -1
  181. package/esm/migration/migration-runner.d.mts +1 -1
  182. package/esm/migration/migration-runner.d.mts.map +1 -1
  183. package/esm/migration/migration-runner.mjs +1 -1
  184. package/esm/migration/migration-runner.mjs.map +1 -1
  185. package/esm/migration/migration.d.mts +1 -1
  186. package/esm/migration/migration.d.mts.map +1 -1
  187. package/esm/migration/migration.mjs +1 -1
  188. package/esm/migration/migration.mjs.map +1 -1
  189. package/esm/migration/parse-created-at.mjs +1 -1
  190. package/esm/migration/parse-created-at.mjs.map +1 -1
  191. package/esm/migration/sql-grammar.mjs +1 -1
  192. package/esm/migration/sql-grammar.mjs.map +1 -1
  193. package/esm/migration/sql-serializer.d.mts +1 -1
  194. package/esm/migration/sql-serializer.d.mts.map +1 -1
  195. package/esm/migration/sql-serializer.mjs +1 -1
  196. package/esm/migration/sql-serializer.mjs.map +1 -1
  197. package/esm/migration/types.d.mts +1 -1
  198. package/esm/migration/types.d.mts.map +1 -1
  199. package/esm/model/generate-model-id.mjs +1 -1
  200. package/esm/model/generate-model-id.mjs.map +1 -1
  201. package/esm/model/methods/accessor-methods.mjs +1 -1
  202. package/esm/model/methods/accessor-methods.mjs.map +1 -1
  203. package/esm/model/methods/delete-methods.mjs +1 -1
  204. package/esm/model/methods/delete-methods.mjs.map +1 -1
  205. package/esm/model/methods/dirty-methods.mjs +1 -1
  206. package/esm/model/methods/dirty-methods.mjs.map +1 -1
  207. package/esm/model/methods/hydration-methods.mjs +1 -1
  208. package/esm/model/methods/hydration-methods.mjs.map +1 -1
  209. package/esm/model/methods/instance-event-methods.mjs +1 -1
  210. package/esm/model/methods/instance-event-methods.mjs.map +1 -1
  211. package/esm/model/methods/meta-methods.mjs +1 -1
  212. package/esm/model/methods/meta-methods.mjs.map +1 -1
  213. package/esm/model/methods/pivot-methods.mjs +1 -1
  214. package/esm/model/methods/pivot-methods.mjs.map +1 -1
  215. package/esm/model/methods/query-methods.mjs +1 -1
  216. package/esm/model/methods/query-methods.mjs.map +1 -1
  217. package/esm/model/methods/restore-methods.mjs +1 -1
  218. package/esm/model/methods/restore-methods.mjs.map +1 -1
  219. package/esm/model/methods/scope-methods.mjs +1 -1
  220. package/esm/model/methods/scope-methods.mjs.map +1 -1
  221. package/esm/model/methods/serialization-methods.mjs +1 -1
  222. package/esm/model/methods/serialization-methods.mjs.map +1 -1
  223. package/esm/model/methods/static-event-methods.mjs +1 -1
  224. package/esm/model/methods/static-event-methods.mjs.map +1 -1
  225. package/esm/model/methods/write-methods.d.mts +1 -1
  226. package/esm/model/methods/write-methods.d.mts.map +1 -1
  227. package/esm/model/methods/write-methods.mjs +1 -1
  228. package/esm/model/methods/write-methods.mjs.map +1 -1
  229. package/esm/model/model.d.mts +1 -1
  230. package/esm/model/model.d.mts.map +1 -1
  231. package/esm/model/model.mjs +1 -1
  232. package/esm/model/model.mjs.map +1 -1
  233. package/esm/model/model.types.d.mts +1 -1
  234. package/esm/model/model.types.d.mts.map +1 -1
  235. package/esm/model/register-model.d.mts +1 -1
  236. package/esm/model/register-model.d.mts.map +1 -1
  237. package/esm/model/register-model.mjs +1 -1
  238. package/esm/model/register-model.mjs.map +1 -1
  239. package/esm/model/relation-decorators.d.mts +1 -1
  240. package/esm/model/relation-decorators.d.mts.map +1 -1
  241. package/esm/model/relation-decorators.mjs +1 -1
  242. package/esm/model/relation-decorators.mjs.map +1 -1
  243. package/esm/operations/database.d.mts +1 -1
  244. package/esm/operations/database.d.mts.map +1 -1
  245. package/esm/operations/database.mjs +1 -1
  246. package/esm/operations/database.mjs.map +1 -1
  247. package/esm/operations/migrations.d.mts +1 -1
  248. package/esm/operations/migrations.d.mts.map +1 -1
  249. package/esm/operations/migrations.mjs +1 -1
  250. package/esm/operations/migrations.mjs.map +1 -1
  251. package/esm/query-builder/lean-records.mjs +1 -1
  252. package/esm/query-builder/lean-records.mjs.map +1 -1
  253. package/esm/query-builder/query-builder.d.mts +1 -1
  254. package/esm/query-builder/query-builder.d.mts.map +1 -1
  255. package/esm/query-builder/query-builder.mjs +1 -1
  256. package/esm/query-builder/query-builder.mjs.map +1 -1
  257. package/esm/relations/key-conventions.mjs +1 -1
  258. package/esm/relations/key-conventions.mjs.map +1 -1
  259. package/esm/relations/pivot-operations.d.mts +1 -1
  260. package/esm/relations/pivot-operations.d.mts.map +1 -1
  261. package/esm/relations/pivot-operations.mjs +1 -1
  262. package/esm/relations/pivot-operations.mjs.map +1 -1
  263. package/esm/relations/relation-hydrator.d.mts +1 -1
  264. package/esm/relations/relation-hydrator.d.mts.map +1 -1
  265. package/esm/relations/relation-hydrator.mjs +1 -1
  266. package/esm/relations/relation-hydrator.mjs.map +1 -1
  267. package/esm/relations/relation-loader.d.mts +1 -1
  268. package/esm/relations/relation-loader.d.mts.map +1 -1
  269. package/esm/relations/relation-loader.mjs +1 -1
  270. package/esm/relations/relation-loader.mjs.map +1 -1
  271. package/esm/relations/types.d.mts +1 -1
  272. package/esm/relations/types.d.mts.map +1 -1
  273. package/esm/remover/database-remover.d.mts +1 -1
  274. package/esm/remover/database-remover.d.mts.map +1 -1
  275. package/esm/remover/database-remover.mjs +1 -1
  276. package/esm/remover/database-remover.mjs.map +1 -1
  277. package/esm/restorer/database-restorer.d.mts +1 -1
  278. package/esm/restorer/database-restorer.d.mts.map +1 -1
  279. package/esm/restorer/database-restorer.mjs +1 -1
  280. package/esm/restorer/database-restorer.mjs.map +1 -1
  281. package/esm/sql-database-dirty-tracker.d.mts +1 -1
  282. package/esm/sql-database-dirty-tracker.d.mts.map +1 -1
  283. package/esm/sql-database-dirty-tracker.mjs +1 -1
  284. package/esm/sql-database-dirty-tracker.mjs.map +1 -1
  285. package/esm/sync/model-events.mjs +1 -1
  286. package/esm/sync/model-events.mjs.map +1 -1
  287. package/esm/sync/model-sync-operation.d.mts +1 -1
  288. package/esm/sync/model-sync-operation.d.mts.map +1 -1
  289. package/esm/sync/model-sync-operation.mjs +1 -1
  290. package/esm/sync/model-sync-operation.mjs.map +1 -1
  291. package/esm/sync/model-sync.d.mts +1 -1
  292. package/esm/sync/model-sync.d.mts.map +1 -1
  293. package/esm/sync/model-sync.mjs +1 -1
  294. package/esm/sync/model-sync.mjs.map +1 -1
  295. package/esm/sync/sync-context.d.mts +1 -1
  296. package/esm/sync/sync-context.d.mts.map +1 -1
  297. package/esm/sync/sync-context.mjs +1 -1
  298. package/esm/sync/sync-context.mjs.map +1 -1
  299. package/esm/sync/sync-fanout.mjs +1 -1
  300. package/esm/sync/sync-fanout.mjs.map +1 -1
  301. package/esm/sync/sync-manager.d.mts +1 -1
  302. package/esm/sync/sync-manager.d.mts.map +1 -1
  303. package/esm/sync/sync-manager.mjs +1 -1
  304. package/esm/sync/sync-manager.mjs.map +1 -1
  305. package/esm/sync/types.d.mts +1 -1
  306. package/esm/sync/types.d.mts.map +1 -1
  307. package/esm/transactions/after-commit.d.mts +1 -1
  308. package/esm/transactions/after-commit.d.mts.map +1 -1
  309. package/esm/transactions/after-commit.mjs +1 -1
  310. package/esm/transactions/after-commit.mjs.map +1 -1
  311. package/esm/types.d.mts +1 -1
  312. package/esm/types.d.mts.map +1 -1
  313. package/esm/utils/connect-to-database.d.mts +1 -1
  314. package/esm/utils/connect-to-database.d.mts.map +1 -1
  315. package/esm/utils/connect-to-database.mjs +1 -1
  316. package/esm/utils/connect-to-database.mjs.map +1 -1
  317. package/esm/utils/database-writer.utils.d.mts +1 -1
  318. package/esm/utils/database-writer.utils.d.mts.map +1 -1
  319. package/esm/utils/database-writer.utils.mjs +1 -1
  320. package/esm/utils/database-writer.utils.mjs.map +1 -1
  321. package/esm/utils/define-model.d.mts +1 -1
  322. package/esm/utils/define-model.d.mts.map +1 -1
  323. package/esm/utils/define-model.mjs +1 -1
  324. package/esm/utils/define-model.mjs.map +1 -1
  325. package/esm/utils/escape-regex.d.mts +1 -1
  326. package/esm/utils/escape-regex.d.mts.map +1 -1
  327. package/esm/utils/escape-regex.mjs +1 -1
  328. package/esm/utils/escape-regex.mjs.map +1 -1
  329. package/esm/utils/is-valid-date-value.mjs +1 -1
  330. package/esm/utils/is-valid-date-value.mjs.map +1 -1
  331. package/esm/utils/once-connected.d.mts +1 -1
  332. package/esm/utils/once-connected.d.mts.map +1 -1
  333. package/esm/utils/once-connected.mjs +1 -1
  334. package/esm/utils/once-connected.mjs.map +1 -1
  335. package/esm/utils/prune-empty-parents.mjs +1 -1
  336. package/esm/utils/prune-empty-parents.mjs.map +1 -1
  337. package/esm/utils/sanitize-filter.d.mts +1 -1
  338. package/esm/utils/sanitize-filter.d.mts.map +1 -1
  339. package/esm/utils/sanitize-filter.mjs +1 -1
  340. package/esm/utils/sanitize-filter.mjs.map +1 -1
  341. package/esm/validation/database-seal-plugins.mjs +1 -1
  342. package/esm/validation/database-seal-plugins.mjs.map +1 -1
  343. package/esm/validation/database-writer-validation-error.d.mts +1 -1
  344. package/esm/validation/database-writer-validation-error.d.mts.map +1 -1
  345. package/esm/validation/database-writer-validation-error.mjs +1 -1
  346. package/esm/validation/database-writer-validation-error.mjs.map +1 -1
  347. package/esm/validation/mutators/embed-mutator.mjs +1 -1
  348. package/esm/validation/mutators/embed-mutator.mjs.map +1 -1
  349. package/esm/validation/plugins/database-rules-plugin.d.mts +1 -1
  350. package/esm/validation/plugins/database-rules-plugin.d.mts.map +1 -1
  351. package/esm/validation/plugins/database-rules-plugin.mjs +1 -1
  352. package/esm/validation/plugins/database-rules-plugin.mjs.map +1 -1
  353. package/esm/validation/plugins/embed-validator-plugin.d.mts +1 -1
  354. package/esm/validation/plugins/embed-validator-plugin.d.mts.map +1 -1
  355. package/esm/validation/plugins/embed-validator-plugin.mjs +1 -1
  356. package/esm/validation/plugins/embed-validator-plugin.mjs.map +1 -1
  357. package/esm/validation/rules/database-model-rule.mjs +1 -1
  358. package/esm/validation/rules/database-model-rule.mjs.map +1 -1
  359. package/esm/validation/rules/exists-rule.mjs +1 -1
  360. package/esm/validation/rules/exists-rule.mjs.map +1 -1
  361. package/esm/validation/rules/unique-rule.mjs +1 -1
  362. package/esm/validation/rules/unique-rule.mjs.map +1 -1
  363. package/esm/validation/transformers/embed-model-transformer.mjs +1 -1
  364. package/esm/validation/transformers/embed-model-transformer.mjs.map +1 -1
  365. package/esm/validation/types.d.mts +1 -1
  366. package/esm/validation/types.d.mts.map +1 -1
  367. package/esm/validation/validators/embed-validator.d.mts +1 -1
  368. package/esm/validation/validators/embed-validator.d.mts.map +1 -1
  369. package/esm/validation/validators/embed-validator.mjs +1 -1
  370. package/esm/validation/validators/embed-validator.mjs.map +1 -1
  371. package/esm/writer/database-writer.d.mts +1 -1
  372. package/esm/writer/database-writer.d.mts.map +1 -1
  373. package/esm/writer/database-writer.mjs +1 -1
  374. package/esm/writer/database-writer.mjs.map +1 -1
  375. package/llms-full.txt +541 -434
  376. package/package.json +7 -6
  377. package/skills/aggregate-data/SKILL.md +28 -17
  378. package/skills/alter-migration/SKILL.md +325 -233
  379. package/skills/cascade-basics/SKILL.md +19 -19
  380. package/skills/configure-delete-strategy/SKILL.md +11 -11
  381. package/skills/define-model/SKILL.md +19 -17
  382. package/skills/define-relations/SKILL.md +13 -18
  383. package/skills/index.md +3 -0
  384. package/skills/manage-transactions/SKILL.md +18 -12
  385. package/skills/paginate-results/SKILL.md +6 -8
  386. package/skills/perform-atomic-ops/SKILL.md +26 -21
  387. package/skills/query-data/SKILL.md +27 -33
  388. package/skills/run-cascade-cli/SKILL.md +11 -10
  389. package/skills/search-by-vector/SKILL.md +8 -5
  390. package/skills/subscribe-to-model-events/SKILL.md +17 -17
  391. package/skills/track-changes/SKILL.md +9 -9
  392. package/skills/write-migration/SKILL.md +4 -4
package/package.json CHANGED
@@ -13,16 +13,17 @@
13
13
  "@mongez/events": "^2.2.8",
14
14
  "@mongez/reinforcements": "^4.0.2",
15
15
  "@mongez/supportive-is": "^3.0.0",
16
- "@warlock.js/context": "5.29.0",
17
- "@warlock.js/logger": "5.29.0",
18
- "@warlock.js/scheduler": "5.29.0",
19
- "@warlock.js/seal": "5.29.0",
16
+ "@warlock.js/context": "5.31.0",
17
+ "@warlock.js/logger": "5.31.0",
18
+ "@warlock.js/scheduler": "5.31.0",
19
+ "@warlock.js/seal": "5.31.0",
20
20
  "citty": "^0.2.2",
21
21
  "fast-glob": "^3.3.3"
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "https://github.com/warlockjs/cascade"
25
+ "url": "git+https://github.com/warlockjs/framework.git",
26
+ "directory": "packages/cascade"
26
27
  },
27
28
  "peerDependencies": {
28
29
  "mongodb": "^5.7.0 || ^6.0.0 || ^7.0.0",
@@ -52,7 +53,7 @@
52
53
  ],
53
54
  "author": "hassanzohdy",
54
55
  "license": "MIT",
55
- "version": "5.29.0",
56
+ "version": "5.31.0",
56
57
  "main": "./cjs/index.cjs",
57
58
  "module": "./esm/index.mjs",
58
59
  "types": "./esm/index.d.mts",
@@ -10,23 +10,21 @@ Cascade's query builder isn't only for finding records — it crunches numbers t
10
10
  ## Scalar aggregates
11
11
 
12
12
  ```ts
13
- const total = await Order.count(); // count is static on the model
14
- const revenue = await Order.query().sum("total");
15
- const avgTicket = await Order.query().avg("total");
16
- const cheapest = await Order.query().min("total");
17
- const priciest = await Order.query().max("total");
13
+ const total = await Order.count(); // count is static on the model
14
+ const revenue = await Order.query().sum("total");
15
+ const avgTicket = await Order.query().avg("total");
16
+ const cheapest = await Order.query().min("total");
17
+ const priciest = await Order.query().max("total");
18
18
 
19
19
  // Filtered
20
- const monthRevenue = await Order.query()
21
- .whereDateAfter("created_at", startOfMonth)
22
- .sum("total");
20
+ const monthRevenue = await Order.query().whereDateAfter("created_at", startOfMonth).sum("total");
23
21
  ```
24
22
 
25
23
  Each returns a single number (`Promise<number>`). Only `count` is a static shortcut on the model; `sum` / `avg` / `min` / `max` (and the date helpers) are query-builder methods — reach them via `Order.query()` or chain off `Order.where(...)`. Date filters take a single date: `whereDate(field, value)` (exact day, time ignored), `whereDateAfter` / `whereDateBefore` (one-sided), `whereDateBetween(field, [a, b])` (range) — there is no 3-arg `whereDate(field, op, value)`. By Cascade convention the scalar terminators return **`0` on zero rows — not `null`** — so you can use the result directly without a null guard.
26
24
 
27
25
  ## Grouped rollups — two-arg `groupBy(fields, aggregates)`
28
26
 
29
- To compute aggregates *per group*, pass a second argument to `groupBy`: an object mapping output aliases to aggregate expressions. Build the expressions with the `$agg` helpers:
27
+ To compute aggregates _per group_, pass a second argument to `groupBy`: an object mapping output aliases to aggregate expressions. Build the expressions with the `$agg` helpers:
30
28
 
31
29
  ```ts
32
30
  import { $agg } from "@warlock.js/cascade";
@@ -59,8 +57,8 @@ import { $agg, $expr } from "@warlock.js/cascade";
59
57
 
60
58
  const revenue = await OrderItem.query()
61
59
  .groupBy("product_id", {
62
- revenue: $agg.sum($expr.mul("price", "quantity")), // SUM(price * quantity)
63
- net: $agg.sum($expr.mul($expr.sub($expr.lit(1), "discount"), "price")),// SUM((1 - discount) * price)
60
+ revenue: $agg.sum($expr.mul("price", "quantity")), // SUM(price * quantity)
61
+ net: $agg.sum($expr.mul($expr.sub($expr.lit(1), "discount"), "price")), // SUM((1 - discount) * price)
64
62
  })
65
63
  .get();
66
64
  ```
@@ -108,7 +106,7 @@ const monthly = await Order.query()
108
106
 
109
107
  ## `.having(...)` — filter groups by a computed aggregate
110
108
 
111
- `.where()` filters rows *before* grouping (cheap, uses indexes). `.having()` filters *after* aggregation, by the alias you defined:
109
+ `.where()` filters rows _before_ grouping (cheap, uses indexes). `.having()` filters _after_ aggregation, by the alias you defined:
112
110
 
113
111
  ```ts
114
112
  const big = await Order.query()
@@ -137,14 +135,27 @@ The `orderBy` reference matches the alias from the aggregates object.
137
135
  const rows = await Post.query().unwind("tags").where("tags", "news").lean().get();
138
136
 
139
137
  // Keep posts with no tags; record each tag's position
140
- await Post.query().unwind("tags", { preserveNullAndEmptyArrays: true, includeArrayIndex: "position" }).get();
138
+ await Post.query()
139
+ .unwind("tags", { preserveNullAndEmptyArrays: true, includeArrayIndex: "position" })
140
+ .get();
141
141
 
142
142
  // Computed field, existing fields kept
143
- await Post.query().addFields({ score: { $add: ["$likes", "$shares"] } }).orderBy("score", "desc").get();
143
+ await Post.query()
144
+ .addFields({ score: { $add: ["$likes", "$shares"] } })
145
+ .orderBy("score", "desc")
146
+ .get();
144
147
 
145
148
  // Pipeline $lookup
146
- await Post.query().join({ table: "comments", localField: "id", foreignField: "postId",
147
- alias: "approved", pipeline: [{ $match: { approved: true } }] }).lean().get();
149
+ await Post.query()
150
+ .join({
151
+ table: "comments",
152
+ localField: "id",
153
+ foreignField: "postId",
154
+ alias: "approved",
155
+ pipeline: [{ $match: { approved: true } }],
156
+ })
157
+ .lean()
158
+ .get();
148
159
  ```
149
160
 
150
161
  `unwind()` returns several rows for one stored document. Use `.lean()` when you only read them. `addFields` expressions are raw aggregation expressions: write them in code, never from request data. Computed columns in the output also work with `selectRaw({ alias: expr })` (`$project`). There is no `$facet` method yet.
@@ -156,7 +167,7 @@ Raw stages: `joinRaw({ $lookup: { from, let, pipeline, as } })` (or an array of
156
167
  ## Gotchas
157
168
 
158
169
  - **`where` vs `having`.** Row filters go in `.where()` (before grouping, index-friendly); aggregate filters go in `.having()`.
159
- - **Empty sets.** Scalar terminators return `0` on zero rows (above). For *grouped* reports, a group with no rows simply doesn't appear — a report over an empty range returns `[]`, not a row of zeros.
170
+ - **Empty sets.** Scalar terminators return `0` on zero rows (above). For _grouped_ reports, a group with no rows simply doesn't appear — a report over an empty range returns `[]`, not a row of zeros.
160
171
  - **Don't `.all()` then `array.reduce`.** Always push aggregates to the database.
161
172
 
162
173
  ## See also