@warlock.js/cascade 4.0.171 → 4.1.1

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 (1050) hide show
  1. package/README.md +6 -5
  2. package/bin/cascadejs +3 -0
  3. package/esm/cli/commands/migrate-export-sql.mjs +48 -0
  4. package/esm/cli/commands/migrate-export-sql.mjs.map +1 -0
  5. package/esm/cli/commands/migrate-list.mjs +26 -0
  6. package/esm/cli/commands/migrate-list.mjs.map +1 -0
  7. package/esm/cli/commands/migrate-rollback.mjs +50 -0
  8. package/esm/cli/commands/migrate-rollback.mjs.map +1 -0
  9. package/esm/cli/commands/migrate.mjs +65 -0
  10. package/esm/cli/commands/migrate.mjs.map +1 -0
  11. package/esm/cli/connection-from-env.mjs +181 -0
  12. package/esm/cli/connection-from-env.mjs.map +1 -0
  13. package/esm/cli/index.mjs +31 -0
  14. package/esm/cli/index.mjs.map +1 -0
  15. package/esm/cli/load-migrations.mjs +78 -0
  16. package/esm/cli/load-migrations.mjs.map +1 -0
  17. package/esm/cli/printers.mjs +57 -0
  18. package/esm/cli/printers.mjs.map +1 -0
  19. package/esm/cli/setup-logger.mjs +30 -0
  20. package/esm/cli/setup-logger.mjs.map +1 -0
  21. package/esm/cli/with-cli-connection.mjs +39 -0
  22. package/esm/cli/with-cli-connection.mjs.map +1 -0
  23. package/esm/cli.d.mts +1 -0
  24. package/esm/cli.mjs +26 -0
  25. package/esm/cli.mjs.map +1 -0
  26. package/esm/context/database-data-source-context.d.mts +32 -0
  27. package/esm/context/database-data-source-context.d.mts.map +1 -0
  28. package/esm/context/database-data-source-context.mjs +35 -0
  29. package/esm/context/database-data-source-context.mjs.map +1 -0
  30. package/esm/context/database-transaction-context.d.mts +38 -0
  31. package/esm/context/database-transaction-context.d.mts.map +1 -0
  32. package/esm/context/database-transaction-context.mjs +47 -0
  33. package/esm/context/database-transaction-context.mjs.map +1 -0
  34. package/esm/contracts/database-driver.contract.d.mts +443 -0
  35. package/esm/contracts/database-driver.contract.d.mts.map +1 -0
  36. package/esm/contracts/database-id-generator.contract.d.mts +109 -0
  37. package/esm/contracts/database-id-generator.contract.d.mts.map +1 -0
  38. package/esm/contracts/database-remover.contract.d.mts +108 -0
  39. package/esm/contracts/database-remover.contract.d.mts.map +1 -0
  40. package/esm/contracts/database-restorer.contract.d.mts +145 -0
  41. package/esm/contracts/database-restorer.contract.d.mts.map +1 -0
  42. package/esm/contracts/database-writer.contract.d.mts +123 -0
  43. package/esm/contracts/database-writer.contract.d.mts.map +1 -0
  44. package/esm/contracts/driver-blueprint.contract.d.mts +52 -0
  45. package/esm/contracts/driver-blueprint.contract.d.mts.map +1 -0
  46. package/esm/contracts/index.d.mts +9 -0
  47. package/esm/contracts/migration-driver.contract.d.mts +476 -0
  48. package/esm/contracts/migration-driver.contract.d.mts.map +1 -0
  49. package/esm/contracts/query-builder.contract.d.mts +1663 -0
  50. package/esm/contracts/query-builder.contract.d.mts.map +1 -0
  51. package/esm/contracts/sync-adapter.contract.d.mts +49 -0
  52. package/esm/contracts/sync-adapter.contract.d.mts.map +1 -0
  53. package/esm/data-source/data-source-registry.d.mts +111 -0
  54. package/esm/data-source/data-source-registry.d.mts.map +1 -0
  55. package/esm/data-source/data-source-registry.mjs +142 -0
  56. package/esm/data-source/data-source-registry.mjs.map +1 -0
  57. package/esm/data-source/data-source.d.mts +160 -0
  58. package/esm/data-source/data-source.d.mts.map +1 -0
  59. package/esm/data-source/data-source.mjs +87 -0
  60. package/esm/data-source/data-source.mjs.map +1 -0
  61. package/esm/database-dirty-tracker.d.mts +254 -0
  62. package/esm/database-dirty-tracker.d.mts.map +1 -0
  63. package/esm/database-dirty-tracker.mjs +356 -0
  64. package/esm/database-dirty-tracker.mjs.map +1 -0
  65. package/esm/drivers/mongodb/mongodb-blueprint.mjs +54 -0
  66. package/esm/drivers/mongodb/mongodb-blueprint.mjs.map +1 -0
  67. package/esm/drivers/mongodb/mongodb-driver.d.mts +334 -0
  68. package/esm/drivers/mongodb/mongodb-driver.d.mts.map +1 -0
  69. package/esm/drivers/mongodb/mongodb-driver.mjs +716 -0
  70. package/esm/drivers/mongodb/mongodb-driver.mjs.map +1 -0
  71. package/esm/drivers/mongodb/mongodb-id-generator.d.mts +120 -0
  72. package/esm/drivers/mongodb/mongodb-id-generator.d.mts.map +1 -0
  73. package/esm/drivers/mongodb/mongodb-id-generator.mjs +141 -0
  74. package/esm/drivers/mongodb/mongodb-id-generator.mjs.map +1 -0
  75. package/esm/drivers/mongodb/mongodb-migration-driver.d.mts +322 -0
  76. package/esm/drivers/mongodb/mongodb-migration-driver.d.mts.map +1 -0
  77. package/esm/drivers/mongodb/mongodb-migration-driver.mjs +531 -0
  78. package/esm/drivers/mongodb/mongodb-migration-driver.mjs.map +1 -0
  79. package/esm/drivers/mongodb/mongodb-query-builder.d.mts +1117 -0
  80. package/esm/drivers/mongodb/mongodb-query-builder.d.mts.map +1 -0
  81. package/esm/drivers/mongodb/mongodb-query-builder.mjs +1828 -0
  82. package/esm/drivers/mongodb/mongodb-query-builder.mjs.map +1 -0
  83. package/esm/drivers/mongodb/mongodb-query-operations.d.mts +230 -0
  84. package/esm/drivers/mongodb/mongodb-query-operations.d.mts.map +1 -0
  85. package/esm/drivers/mongodb/mongodb-query-operations.mjs +275 -0
  86. package/esm/drivers/mongodb/mongodb-query-operations.mjs.map +1 -0
  87. package/esm/drivers/mongodb/mongodb-query-parser.d.mts +263 -0
  88. package/esm/drivers/mongodb/mongodb-query-parser.d.mts.map +1 -0
  89. package/esm/drivers/mongodb/mongodb-query-parser.mjs +965 -0
  90. package/esm/drivers/mongodb/mongodb-query-parser.mjs.map +1 -0
  91. package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts +78 -0
  92. package/esm/drivers/mongodb/mongodb-sync-adapter.d.mts.map +1 -0
  93. package/esm/drivers/mongodb/mongodb-sync-adapter.mjs +118 -0
  94. package/esm/drivers/mongodb/mongodb-sync-adapter.mjs.map +1 -0
  95. package/esm/drivers/mongodb/types.d.mts +43 -0
  96. package/esm/drivers/mongodb/types.d.mts.map +1 -0
  97. package/esm/drivers/postgres/index.d.mts +8 -0
  98. package/esm/drivers/postgres/index.mjs +9 -0
  99. package/esm/drivers/postgres/postgres-blueprint.d.mts +60 -0
  100. package/esm/drivers/postgres/postgres-blueprint.d.mts.map +1 -0
  101. package/esm/drivers/postgres/postgres-blueprint.mjs +105 -0
  102. package/esm/drivers/postgres/postgres-blueprint.mjs.map +1 -0
  103. package/esm/drivers/postgres/postgres-dialect.d.mts +144 -0
  104. package/esm/drivers/postgres/postgres-dialect.d.mts.map +1 -0
  105. package/esm/drivers/postgres/postgres-dialect.mjs +227 -0
  106. package/esm/drivers/postgres/postgres-dialect.mjs.map +1 -0
  107. package/esm/drivers/postgres/postgres-driver.d.mts +424 -0
  108. package/esm/drivers/postgres/postgres-driver.d.mts.map +1 -0
  109. package/esm/drivers/postgres/postgres-driver.mjs +845 -0
  110. package/esm/drivers/postgres/postgres-driver.mjs.map +1 -0
  111. package/esm/drivers/postgres/postgres-migration-driver.d.mts +393 -0
  112. package/esm/drivers/postgres/postgres-migration-driver.d.mts.map +1 -0
  113. package/esm/drivers/postgres/postgres-migration-driver.mjs +760 -0
  114. package/esm/drivers/postgres/postgres-migration-driver.mjs.map +1 -0
  115. package/esm/drivers/postgres/postgres-query-builder.d.mts +399 -0
  116. package/esm/drivers/postgres/postgres-query-builder.d.mts.map +1 -0
  117. package/esm/drivers/postgres/postgres-query-builder.mjs +1105 -0
  118. package/esm/drivers/postgres/postgres-query-builder.mjs.map +1 -0
  119. package/esm/drivers/postgres/postgres-query-parser.d.mts +351 -0
  120. package/esm/drivers/postgres/postgres-query-parser.d.mts.map +1 -0
  121. package/esm/drivers/postgres/postgres-query-parser.mjs +796 -0
  122. package/esm/drivers/postgres/postgres-query-parser.mjs.map +1 -0
  123. package/esm/drivers/postgres/postgres-sql-serializer.mjs +260 -0
  124. package/esm/drivers/postgres/postgres-sql-serializer.mjs.map +1 -0
  125. package/esm/drivers/postgres/postgres-sync-adapter.d.mts +79 -0
  126. package/esm/drivers/postgres/postgres-sync-adapter.d.mts.map +1 -0
  127. package/esm/drivers/postgres/postgres-sync-adapter.mjs +162 -0
  128. package/esm/drivers/postgres/postgres-sync-adapter.mjs.map +1 -0
  129. package/esm/drivers/postgres/types.d.mts +105 -0
  130. package/esm/drivers/postgres/types.d.mts.map +1 -0
  131. package/esm/drivers/sql/sql-dialect.contract.d.mts +221 -0
  132. package/esm/drivers/sql/sql-dialect.contract.d.mts.map +1 -0
  133. package/esm/drivers/sql/sql-types.d.mts +150 -0
  134. package/esm/drivers/sql/sql-types.d.mts.map +1 -0
  135. package/esm/errors/missing-data-source.error.d.mts +25 -0
  136. package/esm/errors/missing-data-source.error.d.mts.map +1 -0
  137. package/esm/errors/missing-data-source.error.mjs +31 -0
  138. package/esm/errors/missing-data-source.error.mjs.map +1 -0
  139. package/esm/errors/transaction-rollback.error.d.mts +23 -0
  140. package/esm/errors/transaction-rollback.error.d.mts.map +1 -0
  141. package/esm/errors/transaction-rollback.error.mjs +29 -0
  142. package/esm/errors/transaction-rollback.error.mjs.map +1 -0
  143. package/esm/events/model-events.d.mts +234 -0
  144. package/esm/events/model-events.d.mts.map +1 -0
  145. package/esm/events/model-events.mjs +254 -0
  146. package/esm/events/model-events.mjs.map +1 -0
  147. package/esm/expressions/aggregate-expressions.d.mts +224 -0
  148. package/esm/expressions/aggregate-expressions.d.mts.map +1 -0
  149. package/esm/expressions/aggregate-expressions.mjs +232 -0
  150. package/esm/expressions/aggregate-expressions.mjs.map +1 -0
  151. package/esm/index.d.mts +67 -0
  152. package/esm/index.mjs +53 -0
  153. package/esm/migration/column-builder.d.mts +420 -0
  154. package/esm/migration/column-builder.d.mts.map +1 -0
  155. package/esm/migration/column-builder.mjs +532 -0
  156. package/esm/migration/column-builder.mjs.map +1 -0
  157. package/esm/migration/column-helpers.d.mts +280 -0
  158. package/esm/migration/column-helpers.d.mts.map +1 -0
  159. package/esm/migration/column-helpers.mjs +376 -0
  160. package/esm/migration/column-helpers.mjs.map +1 -0
  161. package/esm/migration/foreign-key-builder.d.mts +106 -0
  162. package/esm/migration/foreign-key-builder.d.mts.map +1 -0
  163. package/esm/migration/foreign-key-builder.mjs +126 -0
  164. package/esm/migration/foreign-key-builder.mjs.map +1 -0
  165. package/esm/migration/index.d.mts +6 -0
  166. package/esm/migration/index.mjs +7 -0
  167. package/esm/migration/migration-runner.d.mts +279 -0
  168. package/esm/migration/migration-runner.d.mts.map +1 -0
  169. package/esm/migration/migration-runner.mjs +662 -0
  170. package/esm/migration/migration-runner.mjs.map +1 -0
  171. package/esm/migration/migration.d.mts +2035 -0
  172. package/esm/migration/migration.d.mts.map +1 -0
  173. package/esm/migration/migration.mjs +2083 -0
  174. package/esm/migration/migration.mjs.map +1 -0
  175. package/esm/migration/sql-grammar.mjs +115 -0
  176. package/esm/migration/sql-grammar.mjs.map +1 -0
  177. package/esm/migration/sql-serializer.d.mts +26 -0
  178. package/esm/migration/sql-serializer.d.mts.map +1 -0
  179. package/esm/migration/sql-serializer.mjs +26 -0
  180. package/esm/migration/sql-serializer.mjs.map +1 -0
  181. package/esm/migration/types.d.mts +136 -0
  182. package/esm/migration/types.d.mts.map +1 -0
  183. package/esm/model/methods/accessor-methods.mjs +54 -0
  184. package/esm/model/methods/accessor-methods.mjs.map +1 -0
  185. package/esm/model/methods/delete-methods.mjs +16 -0
  186. package/esm/model/methods/delete-methods.mjs.map +1 -0
  187. package/esm/model/methods/dirty-methods.mjs +20 -0
  188. package/esm/model/methods/dirty-methods.mjs.map +1 -0
  189. package/esm/model/methods/hydration-methods.mjs +51 -0
  190. package/esm/model/methods/hydration-methods.mjs.map +1 -0
  191. package/esm/model/methods/instance-event-methods.mjs +22 -0
  192. package/esm/model/methods/instance-event-methods.mjs.map +1 -0
  193. package/esm/model/methods/meta-methods.mjs +36 -0
  194. package/esm/model/methods/meta-methods.mjs.map +1 -0
  195. package/esm/model/methods/pivot-methods.mjs +48 -0
  196. package/esm/model/methods/pivot-methods.mjs.map +1 -0
  197. package/esm/model/methods/query-methods.mjs +121 -0
  198. package/esm/model/methods/query-methods.mjs.map +1 -0
  199. package/esm/model/methods/restore-methods.mjs +16 -0
  200. package/esm/model/methods/restore-methods.mjs.map +1 -0
  201. package/esm/model/methods/scope-methods.mjs +20 -0
  202. package/esm/model/methods/scope-methods.mjs.map +1 -0
  203. package/esm/model/methods/serialization-methods.mjs +20 -0
  204. package/esm/model/methods/serialization-methods.mjs.map +1 -0
  205. package/esm/model/methods/static-event-methods.mjs +37 -0
  206. package/esm/model/methods/static-event-methods.mjs.map +1 -0
  207. package/esm/model/methods/write-methods.mjs +69 -0
  208. package/esm/model/methods/write-methods.mjs.map +1 -0
  209. package/esm/model/model.d.mts +1778 -0
  210. package/esm/model/model.d.mts.map +1 -0
  211. package/esm/model/model.mjs +1762 -0
  212. package/esm/model/model.mjs.map +1 -0
  213. package/esm/model/model.types.d.mts +47 -0
  214. package/esm/model/model.types.d.mts.map +1 -0
  215. package/esm/model/register-model.d.mts +140 -0
  216. package/esm/model/register-model.d.mts.map +1 -0
  217. package/esm/model/register-model.mjs +175 -0
  218. package/esm/model/register-model.mjs.map +1 -0
  219. package/esm/model/relation-decorators.d.mts +88 -0
  220. package/esm/model/relation-decorators.d.mts.map +1 -0
  221. package/esm/model/relation-decorators.mjs +191 -0
  222. package/esm/model/relation-decorators.mjs.map +1 -0
  223. package/esm/operations/database.d.mts +46 -0
  224. package/esm/operations/database.d.mts.map +1 -0
  225. package/esm/operations/database.mjs +40 -0
  226. package/esm/operations/database.mjs.map +1 -0
  227. package/esm/operations/index.d.mts +2 -0
  228. package/esm/operations/index.mjs +4 -0
  229. package/esm/operations/migrations.d.mts +71 -0
  230. package/esm/operations/migrations.d.mts.map +1 -0
  231. package/esm/operations/migrations.mjs +70 -0
  232. package/esm/operations/migrations.mjs.map +1 -0
  233. package/esm/query-builder/query-builder.d.mts +564 -0
  234. package/esm/query-builder/query-builder.d.mts.map +1 -0
  235. package/esm/query-builder/query-builder.mjs +1097 -0
  236. package/esm/query-builder/query-builder.mjs.map +1 -0
  237. package/esm/relations/index.d.mts +4 -0
  238. package/esm/relations/index.mjs +5 -0
  239. package/esm/relations/key-conventions.mjs +119 -0
  240. package/esm/relations/key-conventions.mjs.map +1 -0
  241. package/esm/relations/pivot-operations.d.mts +155 -0
  242. package/esm/relations/pivot-operations.d.mts.map +1 -0
  243. package/esm/relations/pivot-operations.mjs +232 -0
  244. package/esm/relations/pivot-operations.mjs.map +1 -0
  245. package/esm/relations/relation-hydrator.d.mts +55 -0
  246. package/esm/relations/relation-hydrator.d.mts.map +1 -0
  247. package/esm/relations/relation-hydrator.mjs +52 -0
  248. package/esm/relations/relation-hydrator.mjs.map +1 -0
  249. package/esm/relations/relation-loader.d.mts +190 -0
  250. package/esm/relations/relation-loader.d.mts.map +1 -0
  251. package/esm/relations/relation-loader.mjs +416 -0
  252. package/esm/relations/relation-loader.mjs.map +1 -0
  253. package/esm/relations/types.d.mts +317 -0
  254. package/esm/relations/types.d.mts.map +1 -0
  255. package/esm/remover/database-remover.d.mts +104 -0
  256. package/esm/remover/database-remover.d.mts.map +1 -0
  257. package/esm/remover/database-remover.mjs +174 -0
  258. package/esm/remover/database-remover.mjs.map +1 -0
  259. package/esm/restorer/database-restorer.d.mts +135 -0
  260. package/esm/restorer/database-restorer.d.mts.map +1 -0
  261. package/esm/restorer/database-restorer.mjs +316 -0
  262. package/esm/restorer/database-restorer.mjs.map +1 -0
  263. package/esm/sql-database-dirty-tracker.d.mts +17 -0
  264. package/esm/sql-database-dirty-tracker.d.mts.map +1 -0
  265. package/esm/sql-database-dirty-tracker.mjs +20 -0
  266. package/esm/sql-database-dirty-tracker.mjs.map +1 -0
  267. package/esm/sync/model-events.mjs +46 -0
  268. package/esm/sync/model-events.mjs.map +1 -0
  269. package/esm/sync/model-sync-operation.d.mts +159 -0
  270. package/esm/sync/model-sync-operation.d.mts.map +1 -0
  271. package/esm/sync/model-sync-operation.mjs +257 -0
  272. package/esm/sync/model-sync-operation.mjs.map +1 -0
  273. package/esm/sync/model-sync.d.mts +126 -0
  274. package/esm/sync/model-sync.d.mts.map +1 -0
  275. package/esm/sync/model-sync.mjs +157 -0
  276. package/esm/sync/model-sync.mjs.map +1 -0
  277. package/esm/sync/sync-context.d.mts +69 -0
  278. package/esm/sync/sync-context.d.mts.map +1 -0
  279. package/esm/sync/sync-context.mjs +95 -0
  280. package/esm/sync/sync-context.mjs.map +1 -0
  281. package/esm/sync/sync-manager.d.mts +213 -0
  282. package/esm/sync/sync-manager.d.mts.map +1 -0
  283. package/esm/sync/sync-manager.mjs +597 -0
  284. package/esm/sync/sync-manager.mjs.map +1 -0
  285. package/esm/sync/types.d.mts +215 -0
  286. package/esm/sync/types.d.mts.map +1 -0
  287. package/esm/types.d.mts +423 -0
  288. package/esm/types.d.mts.map +1 -0
  289. package/esm/utils/connect-to-database.d.mts +328 -0
  290. package/esm/utils/connect-to-database.d.mts.map +1 -0
  291. package/esm/utils/connect-to-database.mjs +130 -0
  292. package/esm/utils/connect-to-database.mjs.map +1 -0
  293. package/esm/utils/database-writer.utils.d.mts +18 -0
  294. package/esm/utils/database-writer.utils.d.mts.map +1 -0
  295. package/esm/utils/database-writer.utils.mjs +25 -0
  296. package/esm/utils/database-writer.utils.mjs.map +1 -0
  297. package/esm/utils/define-model.d.mts +185 -0
  298. package/esm/utils/define-model.d.mts.map +1 -0
  299. package/esm/utils/define-model.mjs +105 -0
  300. package/esm/utils/define-model.mjs.map +1 -0
  301. package/esm/utils/is-valid-date-value.mjs +22 -0
  302. package/esm/utils/is-valid-date-value.mjs.map +1 -0
  303. package/esm/utils/once-connected.d.mts +150 -0
  304. package/esm/utils/once-connected.d.mts.map +1 -0
  305. package/esm/utils/once-connected.mjs +203 -0
  306. package/esm/utils/once-connected.mjs.map +1 -0
  307. package/esm/validation/database-seal-plugins.d.mts +1 -0
  308. package/esm/validation/database-seal-plugins.mjs +11 -0
  309. package/esm/validation/database-seal-plugins.mjs.map +1 -0
  310. package/esm/validation/database-writer-validation-error.d.mts +101 -0
  311. package/esm/validation/database-writer-validation-error.d.mts.map +1 -0
  312. package/esm/validation/database-writer-validation-error.mjs +153 -0
  313. package/esm/validation/database-writer-validation-error.mjs.map +1 -0
  314. package/esm/validation/index.d.mts +2 -0
  315. package/esm/validation/index.mjs +4 -0
  316. package/esm/validation/mutators/embed-mutator.mjs +26 -0
  317. package/esm/validation/mutators/embed-mutator.mjs.map +1 -0
  318. package/esm/validation/plugins/database-rules-plugin.d.mts +28 -0
  319. package/esm/validation/plugins/database-rules-plugin.d.mts.map +1 -0
  320. package/esm/validation/plugins/database-rules-plugin.mjs +43 -0
  321. package/esm/validation/plugins/database-rules-plugin.mjs.map +1 -0
  322. package/esm/validation/plugins/embed-validator-plugin.d.mts +17 -0
  323. package/esm/validation/plugins/embed-validator-plugin.d.mts.map +1 -0
  324. package/esm/validation/plugins/embed-validator-plugin.mjs +20 -0
  325. package/esm/validation/plugins/embed-validator-plugin.mjs.map +1 -0
  326. package/esm/validation/rules/database-model-rule.mjs +32 -0
  327. package/esm/validation/rules/database-model-rule.mjs.map +1 -0
  328. package/esm/validation/rules/exists-rule.mjs +29 -0
  329. package/esm/validation/rules/exists-rule.mjs.map +1 -0
  330. package/esm/validation/rules/unique-rule.mjs +43 -0
  331. package/esm/validation/rules/unique-rule.mjs.map +1 -0
  332. package/esm/validation/transformers/embed-model-transformer.mjs +17 -0
  333. package/esm/validation/transformers/embed-model-transformer.mjs.map +1 -0
  334. package/esm/validation/types.d.mts +43 -0
  335. package/esm/validation/types.d.mts.map +1 -0
  336. package/esm/validation/validators/embed-validator.d.mts +25 -0
  337. package/esm/validation/validators/embed-validator.d.mts.map +1 -0
  338. package/esm/validation/validators/embed-validator.mjs +42 -0
  339. package/esm/validation/validators/embed-validator.mjs.map +1 -0
  340. package/esm/writer/database-writer.d.mts +178 -0
  341. package/esm/writer/database-writer.d.mts.map +1 -0
  342. package/esm/writer/database-writer.mjs +317 -0
  343. package/esm/writer/database-writer.mjs.map +1 -0
  344. package/llms-full.txt +2027 -0
  345. package/llms.txt +23 -0
  346. package/package.json +60 -51
  347. package/skills/README.md +65 -0
  348. package/skills/aggregate-data/SKILL.md +102 -0
  349. package/skills/cascade-basics/SKILL.md +93 -0
  350. package/skills/configure-delete-strategy/SKILL.md +126 -0
  351. package/skills/define-model/SKILL.md +170 -0
  352. package/skills/define-relations/SKILL.md +171 -0
  353. package/skills/manage-data-sources/SKILL.md +140 -0
  354. package/skills/manage-transactions/SKILL.md +118 -0
  355. package/skills/paginate-results/SKILL.md +122 -0
  356. package/skills/perform-atomic-ops/SKILL.md +98 -0
  357. package/skills/query-data/SKILL.md +168 -0
  358. package/skills/run-cascade-cli/SKILL.md +125 -0
  359. package/skills/search-by-vector/SKILL.md +127 -0
  360. package/skills/subscribe-to-model-events/SKILL.md +148 -0
  361. package/skills/track-changes/SKILL.md +109 -0
  362. package/skills/write-migration/SKILL.md +144 -0
  363. package/cjs/context/database-data-source-context.d.ts +0 -29
  364. package/cjs/context/database-data-source-context.d.ts.map +0 -1
  365. package/cjs/context/database-data-source-context.js +0 -28
  366. package/cjs/context/database-data-source-context.js.map +0 -1
  367. package/cjs/context/database-transaction-context.d.ts +0 -35
  368. package/cjs/context/database-transaction-context.d.ts.map +0 -1
  369. package/cjs/context/database-transaction-context.js +0 -40
  370. package/cjs/context/database-transaction-context.js.map +0 -1
  371. package/cjs/contracts/database-driver.contract.d.ts +0 -450
  372. package/cjs/contracts/database-driver.contract.d.ts.map +0 -1
  373. package/cjs/contracts/database-id-generator.contract.d.ts +0 -109
  374. package/cjs/contracts/database-id-generator.contract.d.ts.map +0 -1
  375. package/cjs/contracts/database-remover.contract.d.ts +0 -104
  376. package/cjs/contracts/database-remover.contract.d.ts.map +0 -1
  377. package/cjs/contracts/database-restorer.contract.d.ts +0 -143
  378. package/cjs/contracts/database-restorer.contract.d.ts.map +0 -1
  379. package/cjs/contracts/database-writer.contract.d.ts +0 -119
  380. package/cjs/contracts/database-writer.contract.d.ts.map +0 -1
  381. package/cjs/contracts/driver-blueprint.contract.d.ts +0 -49
  382. package/cjs/contracts/driver-blueprint.contract.d.ts.map +0 -1
  383. package/cjs/contracts/index.d.ts +0 -10
  384. package/cjs/contracts/index.d.ts.map +0 -1
  385. package/cjs/contracts/migration-driver.contract.d.ts +0 -522
  386. package/cjs/contracts/migration-driver.contract.d.ts.map +0 -1
  387. package/cjs/contracts/query-builder.contract.d.ts +0 -1609
  388. package/cjs/contracts/query-builder.contract.d.ts.map +0 -1
  389. package/cjs/contracts/sync-adapter.contract.d.ts +0 -58
  390. package/cjs/contracts/sync-adapter.contract.d.ts.map +0 -1
  391. package/cjs/data-source/data-source-registry.d.ts +0 -108
  392. package/cjs/data-source/data-source-registry.d.ts.map +0 -1
  393. package/cjs/data-source/data-source-registry.js +0 -145
  394. package/cjs/data-source/data-source-registry.js.map +0 -1
  395. package/cjs/data-source/data-source.d.ts +0 -147
  396. package/cjs/data-source/data-source.d.ts.map +0 -1
  397. package/cjs/data-source/data-source.js +0 -83
  398. package/cjs/data-source/data-source.js.map +0 -1
  399. package/cjs/database-dirty-tracker.d.ts +0 -252
  400. package/cjs/database-dirty-tracker.d.ts.map +0 -1
  401. package/cjs/database-dirty-tracker.js +0 -386
  402. package/cjs/database-dirty-tracker.js.map +0 -1
  403. package/cjs/drivers/mongodb/mongodb-blueprint.d.ts +0 -30
  404. package/cjs/drivers/mongodb/mongodb-blueprint.d.ts.map +0 -1
  405. package/cjs/drivers/mongodb/mongodb-blueprint.js +0 -51
  406. package/cjs/drivers/mongodb/mongodb-blueprint.js.map +0 -1
  407. package/cjs/drivers/mongodb/mongodb-driver.d.ts +0 -325
  408. package/cjs/drivers/mongodb/mongodb-driver.d.ts.map +0 -1
  409. package/cjs/drivers/mongodb/mongodb-driver.js +0 -845
  410. package/cjs/drivers/mongodb/mongodb-driver.js.map +0 -1
  411. package/cjs/drivers/mongodb/mongodb-id-generator.d.ts +0 -116
  412. package/cjs/drivers/mongodb/mongodb-id-generator.d.ts.map +0 -1
  413. package/cjs/drivers/mongodb/mongodb-id-generator.js +0 -149
  414. package/cjs/drivers/mongodb/mongodb-id-generator.js.map +0 -1
  415. package/cjs/drivers/mongodb/mongodb-migration-driver.d.ts +0 -317
  416. package/cjs/drivers/mongodb/mongodb-migration-driver.d.ts.map +0 -1
  417. package/cjs/drivers/mongodb/mongodb-migration-driver.js +0 -666
  418. package/cjs/drivers/mongodb/mongodb-migration-driver.js.map +0 -1
  419. package/cjs/drivers/mongodb/mongodb-query-builder.d.ts +0 -1122
  420. package/cjs/drivers/mongodb/mongodb-query-builder.d.ts.map +0 -1
  421. package/cjs/drivers/mongodb/mongodb-query-builder.js +0 -1988
  422. package/cjs/drivers/mongodb/mongodb-query-builder.js.map +0 -1
  423. package/cjs/drivers/mongodb/mongodb-query-operations.d.ts +0 -226
  424. package/cjs/drivers/mongodb/mongodb-query-operations.d.ts.map +0 -1
  425. package/cjs/drivers/mongodb/mongodb-query-operations.js +0 -270
  426. package/cjs/drivers/mongodb/mongodb-query-operations.js.map +0 -1
  427. package/cjs/drivers/mongodb/mongodb-query-parser.d.ts +0 -262
  428. package/cjs/drivers/mongodb/mongodb-query-parser.d.ts.map +0 -1
  429. package/cjs/drivers/mongodb/mongodb-query-parser.js +0 -1351
  430. package/cjs/drivers/mongodb/mongodb-query-parser.js.map +0 -1
  431. package/cjs/drivers/mongodb/mongodb-sync-adapter.d.ts +0 -79
  432. package/cjs/drivers/mongodb/mongodb-sync-adapter.d.ts.map +0 -1
  433. package/cjs/drivers/mongodb/mongodb-sync-adapter.js +0 -146
  434. package/cjs/drivers/mongodb/mongodb-sync-adapter.js.map +0 -1
  435. package/cjs/drivers/mongodb/types.d.ts +0 -43
  436. package/cjs/drivers/mongodb/types.d.ts.map +0 -1
  437. package/cjs/drivers/postgres/index.d.ts +0 -16
  438. package/cjs/drivers/postgres/index.d.ts.map +0 -1
  439. package/cjs/drivers/postgres/postgres-blueprint.d.ts +0 -64
  440. package/cjs/drivers/postgres/postgres-blueprint.d.ts.map +0 -1
  441. package/cjs/drivers/postgres/postgres-blueprint.js +0 -121
  442. package/cjs/drivers/postgres/postgres-blueprint.js.map +0 -1
  443. package/cjs/drivers/postgres/postgres-dialect.d.ts +0 -136
  444. package/cjs/drivers/postgres/postgres-dialect.d.ts.map +0 -1
  445. package/cjs/drivers/postgres/postgres-dialect.js +0 -268
  446. package/cjs/drivers/postgres/postgres-dialect.js.map +0 -1
  447. package/cjs/drivers/postgres/postgres-driver.d.ts +0 -432
  448. package/cjs/drivers/postgres/postgres-driver.d.ts.map +0 -1
  449. package/cjs/drivers/postgres/postgres-driver.js +0 -1008
  450. package/cjs/drivers/postgres/postgres-driver.js.map +0 -1
  451. package/cjs/drivers/postgres/postgres-migration-driver.d.ts +0 -397
  452. package/cjs/drivers/postgres/postgres-migration-driver.d.ts.map +0 -1
  453. package/cjs/drivers/postgres/postgres-migration-driver.js +0 -900
  454. package/cjs/drivers/postgres/postgres-migration-driver.js.map +0 -1
  455. package/cjs/drivers/postgres/postgres-query-builder.d.ts +0 -254
  456. package/cjs/drivers/postgres/postgres-query-builder.d.ts.map +0 -1
  457. package/cjs/drivers/postgres/postgres-query-builder.js +0 -933
  458. package/cjs/drivers/postgres/postgres-query-builder.js.map +0 -1
  459. package/cjs/drivers/postgres/postgres-query-parser.d.ts +0 -328
  460. package/cjs/drivers/postgres/postgres-query-parser.d.ts.map +0 -1
  461. package/cjs/drivers/postgres/postgres-query-parser.js +0 -868
  462. package/cjs/drivers/postgres/postgres-query-parser.js.map +0 -1
  463. package/cjs/drivers/postgres/postgres-sql-serializer.d.ts +0 -37
  464. package/cjs/drivers/postgres/postgres-sql-serializer.d.ts.map +0 -1
  465. package/cjs/drivers/postgres/postgres-sql-serializer.js +0 -400
  466. package/cjs/drivers/postgres/postgres-sql-serializer.js.map +0 -1
  467. package/cjs/drivers/postgres/postgres-sync-adapter.d.ts +0 -83
  468. package/cjs/drivers/postgres/postgres-sync-adapter.d.ts.map +0 -1
  469. package/cjs/drivers/postgres/postgres-sync-adapter.js +0 -204
  470. package/cjs/drivers/postgres/postgres-sync-adapter.js.map +0 -1
  471. package/cjs/drivers/postgres/types.d.ts +0 -144
  472. package/cjs/drivers/postgres/types.d.ts.map +0 -1
  473. package/cjs/drivers/sql/index.d.ts +0 -10
  474. package/cjs/drivers/sql/index.d.ts.map +0 -1
  475. package/cjs/drivers/sql/sql-dialect.contract.d.ts +0 -204
  476. package/cjs/drivers/sql/sql-dialect.contract.d.ts.map +0 -1
  477. package/cjs/drivers/sql/sql-types.d.ts +0 -202
  478. package/cjs/drivers/sql/sql-types.d.ts.map +0 -1
  479. package/cjs/errors/missing-data-source.error.d.ts +0 -22
  480. package/cjs/errors/missing-data-source.error.d.ts.map +0 -1
  481. package/cjs/errors/missing-data-source.error.js +0 -29
  482. package/cjs/errors/missing-data-source.error.js.map +0 -1
  483. package/cjs/errors/transaction-rollback.error.d.ts +0 -20
  484. package/cjs/errors/transaction-rollback.error.d.ts.map +0 -1
  485. package/cjs/errors/transaction-rollback.error.js +0 -27
  486. package/cjs/errors/transaction-rollback.error.js.map +0 -1
  487. package/cjs/events/model-events.d.ts +0 -231
  488. package/cjs/events/model-events.d.ts.map +0 -1
  489. package/cjs/events/model-events.js +0 -259
  490. package/cjs/events/model-events.js.map +0 -1
  491. package/cjs/expressions/aggregate-expressions.d.ts +0 -215
  492. package/cjs/expressions/aggregate-expressions.d.ts.map +0 -1
  493. package/cjs/expressions/aggregate-expressions.js +0 -221
  494. package/cjs/expressions/aggregate-expressions.js.map +0 -1
  495. package/cjs/expressions/index.d.ts +0 -2
  496. package/cjs/expressions/index.d.ts.map +0 -1
  497. package/cjs/index.d.ts +0 -45
  498. package/cjs/index.d.ts.map +0 -1
  499. package/cjs/index.js +0 -1
  500. package/cjs/index.js.map +0 -1
  501. package/cjs/migration/column-builder.d.ts +0 -417
  502. package/cjs/migration/column-builder.d.ts.map +0 -1
  503. package/cjs/migration/column-builder.js +0 -586
  504. package/cjs/migration/column-builder.js.map +0 -1
  505. package/cjs/migration/column-helpers.d.ts +0 -275
  506. package/cjs/migration/column-helpers.d.ts.map +0 -1
  507. package/cjs/migration/column-helpers.js +0 -389
  508. package/cjs/migration/column-helpers.js.map +0 -1
  509. package/cjs/migration/foreign-key-builder.d.ts +0 -103
  510. package/cjs/migration/foreign-key-builder.d.ts.map +0 -1
  511. package/cjs/migration/foreign-key-builder.js +0 -121
  512. package/cjs/migration/foreign-key-builder.js.map +0 -1
  513. package/cjs/migration/index.d.ts +0 -7
  514. package/cjs/migration/index.d.ts.map +0 -1
  515. package/cjs/migration/migration-runner.d.ts +0 -278
  516. package/cjs/migration/migration-runner.d.ts.map +0 -1
  517. package/cjs/migration/migration-runner.js +0 -815
  518. package/cjs/migration/migration-runner.js.map +0 -1
  519. package/cjs/migration/migration.d.ts +0 -1988
  520. package/cjs/migration/migration.d.ts.map +0 -1
  521. package/cjs/migration/migration.js +0 -2162
  522. package/cjs/migration/migration.js.map +0 -1
  523. package/cjs/migration/sql-grammar.d.ts +0 -61
  524. package/cjs/migration/sql-grammar.d.ts.map +0 -1
  525. package/cjs/migration/sql-grammar.js +0 -164
  526. package/cjs/migration/sql-grammar.js.map +0 -1
  527. package/cjs/migration/sql-serializer.d.ts +0 -22
  528. package/cjs/migration/sql-serializer.d.ts.map +0 -1
  529. package/cjs/migration/sql-serializer.js +0 -26
  530. package/cjs/migration/sql-serializer.js.map +0 -1
  531. package/cjs/migration/types.d.ts +0 -155
  532. package/cjs/migration/types.d.ts.map +0 -1
  533. package/cjs/model/methods/accessor-methods.d.ts +0 -13
  534. package/cjs/model/methods/accessor-methods.d.ts.map +0 -1
  535. package/cjs/model/methods/accessor-methods.js +0 -51
  536. package/cjs/model/methods/accessor-methods.js.map +0 -1
  537. package/cjs/model/methods/delete-methods.d.ts +0 -10
  538. package/cjs/model/methods/delete-methods.d.ts.map +0 -1
  539. package/cjs/model/methods/delete-methods.js +0 -10
  540. package/cjs/model/methods/delete-methods.js.map +0 -1
  541. package/cjs/model/methods/dirty-methods.d.ts +0 -10
  542. package/cjs/model/methods/dirty-methods.d.ts.map +0 -1
  543. package/cjs/model/methods/dirty-methods.js +0 -15
  544. package/cjs/model/methods/dirty-methods.js.map +0 -1
  545. package/cjs/model/methods/hydration-methods.d.ts +0 -10
  546. package/cjs/model/methods/hydration-methods.d.ts.map +0 -1
  547. package/cjs/model/methods/hydration-methods.js +0 -57
  548. package/cjs/model/methods/hydration-methods.js.map +0 -1
  549. package/cjs/model/methods/instance-event-methods.d.ts +0 -7
  550. package/cjs/model/methods/instance-event-methods.d.ts.map +0 -1
  551. package/cjs/model/methods/instance-event-methods.js +0 -15
  552. package/cjs/model/methods/instance-event-methods.js.map +0 -1
  553. package/cjs/model/methods/meta-methods.d.ts +0 -7
  554. package/cjs/model/methods/meta-methods.d.ts.map +0 -1
  555. package/cjs/model/methods/meta-methods.js +0 -78
  556. package/cjs/model/methods/meta-methods.js.map +0 -1
  557. package/cjs/model/methods/query-methods.d.ts +0 -24
  558. package/cjs/model/methods/query-methods.d.ts.map +0 -1
  559. package/cjs/model/methods/query-methods.js +0 -164
  560. package/cjs/model/methods/query-methods.js.map +0 -1
  561. package/cjs/model/methods/restore-methods.d.ts +0 -10
  562. package/cjs/model/methods/restore-methods.d.ts.map +0 -1
  563. package/cjs/model/methods/restore-methods.js +0 -13
  564. package/cjs/model/methods/restore-methods.js.map +0 -1
  565. package/cjs/model/methods/scope-methods.d.ts +0 -7
  566. package/cjs/model/methods/scope-methods.d.ts.map +0 -1
  567. package/cjs/model/methods/scope-methods.js +0 -15
  568. package/cjs/model/methods/scope-methods.js.map +0 -1
  569. package/cjs/model/methods/serialization-methods.d.ts +0 -3
  570. package/cjs/model/methods/serialization-methods.d.ts.map +0 -1
  571. package/cjs/model/methods/serialization-methods.js +0 -27
  572. package/cjs/model/methods/serialization-methods.js.map +0 -1
  573. package/cjs/model/methods/static-event-methods.d.ts +0 -9
  574. package/cjs/model/methods/static-event-methods.d.ts.map +0 -1
  575. package/cjs/model/methods/static-event-methods.js +0 -29
  576. package/cjs/model/methods/static-event-methods.js.map +0 -1
  577. package/cjs/model/methods/write-methods.d.ts +0 -10
  578. package/cjs/model/methods/write-methods.d.ts.map +0 -1
  579. package/cjs/model/methods/write-methods.js +0 -52
  580. package/cjs/model/methods/write-methods.js.map +0 -1
  581. package/cjs/model/model.d.ts +0 -1647
  582. package/cjs/model/model.d.ts.map +0 -1
  583. package/cjs/model/model.js +0 -1657
  584. package/cjs/model/model.js.map +0 -1
  585. package/cjs/model/model.types.d.ts +0 -44
  586. package/cjs/model/model.types.d.ts.map +0 -1
  587. package/cjs/model/register-model.d.ts +0 -81
  588. package/cjs/model/register-model.d.ts.map +0 -1
  589. package/cjs/model/register-model.js +0 -94
  590. package/cjs/model/register-model.js.map +0 -1
  591. package/cjs/query-builder/query-builder.d.ts +0 -556
  592. package/cjs/query-builder/query-builder.d.ts.map +0 -1
  593. package/cjs/query-builder/query-builder.js +0 -1070
  594. package/cjs/query-builder/query-builder.js.map +0 -1
  595. package/cjs/relations/helpers.d.ts +0 -156
  596. package/cjs/relations/helpers.d.ts.map +0 -1
  597. package/cjs/relations/helpers.js +0 -202
  598. package/cjs/relations/helpers.js.map +0 -1
  599. package/cjs/relations/index.d.ts +0 -35
  600. package/cjs/relations/index.d.ts.map +0 -1
  601. package/cjs/relations/pivot-operations.d.ts +0 -160
  602. package/cjs/relations/pivot-operations.d.ts.map +0 -1
  603. package/cjs/relations/pivot-operations.js +0 -293
  604. package/cjs/relations/pivot-operations.js.map +0 -1
  605. package/cjs/relations/relation-hydrator.d.ts +0 -68
  606. package/cjs/relations/relation-hydrator.d.ts.map +0 -1
  607. package/cjs/relations/relation-hydrator.js +0 -81
  608. package/cjs/relations/relation-hydrator.js.map +0 -1
  609. package/cjs/relations/relation-loader.d.ts +0 -194
  610. package/cjs/relations/relation-loader.d.ts.map +0 -1
  611. package/cjs/relations/relation-loader.js +0 -466
  612. package/cjs/relations/relation-loader.js.map +0 -1
  613. package/cjs/relations/types.d.ts +0 -306
  614. package/cjs/relations/types.d.ts.map +0 -1
  615. package/cjs/remover/database-remover.d.ts +0 -100
  616. package/cjs/remover/database-remover.d.ts.map +0 -1
  617. package/cjs/remover/database-remover.js +0 -214
  618. package/cjs/remover/database-remover.js.map +0 -1
  619. package/cjs/restorer/database-restorer.d.ts +0 -131
  620. package/cjs/restorer/database-restorer.d.ts.map +0 -1
  621. package/cjs/restorer/database-restorer.js +0 -434
  622. package/cjs/restorer/database-restorer.js.map +0 -1
  623. package/cjs/sql-database-dirty-tracker.d.ts +0 -13
  624. package/cjs/sql-database-dirty-tracker.d.ts.map +0 -1
  625. package/cjs/sql-database-dirty-tracker.js +0 -14
  626. package/cjs/sql-database-dirty-tracker.js.map +0 -1
  627. package/cjs/sync/index.d.ts +0 -12
  628. package/cjs/sync/index.d.ts.map +0 -1
  629. package/cjs/sync/model-events.d.ts +0 -62
  630. package/cjs/sync/model-events.d.ts.map +0 -1
  631. package/cjs/sync/model-events.js +0 -49
  632. package/cjs/sync/model-events.js.map +0 -1
  633. package/cjs/sync/model-sync-operation.d.ts +0 -163
  634. package/cjs/sync/model-sync-operation.d.ts.map +0 -1
  635. package/cjs/sync/model-sync-operation.js +0 -292
  636. package/cjs/sync/model-sync-operation.js.map +0 -1
  637. package/cjs/sync/model-sync.d.ts +0 -130
  638. package/cjs/sync/model-sync.d.ts.map +0 -1
  639. package/cjs/sync/model-sync.js +0 -178
  640. package/cjs/sync/model-sync.js.map +0 -1
  641. package/cjs/sync/sync-context.d.ts +0 -70
  642. package/cjs/sync/sync-context.d.ts.map +0 -1
  643. package/cjs/sync/sync-context.js +0 -101
  644. package/cjs/sync/sync-context.js.map +0 -1
  645. package/cjs/sync/sync-manager.d.ts +0 -213
  646. package/cjs/sync/sync-manager.d.ts.map +0 -1
  647. package/cjs/sync/sync-manager.js +0 -689
  648. package/cjs/sync/sync-manager.js.map +0 -1
  649. package/cjs/sync/types.d.ts +0 -289
  650. package/cjs/sync/types.d.ts.map +0 -1
  651. package/cjs/test-migrations/test-enhanced-features.migration.d.ts +0 -15
  652. package/cjs/test-migrations/test-enhanced-features.migration.d.ts.map +0 -1
  653. package/cjs/types.d.ts +0 -371
  654. package/cjs/types.d.ts.map +0 -1
  655. package/cjs/utils/connect-to-database.d.ts +0 -307
  656. package/cjs/utils/connect-to-database.d.ts.map +0 -1
  657. package/cjs/utils/connect-to-database.js +0 -130
  658. package/cjs/utils/connect-to-database.js.map +0 -1
  659. package/cjs/utils/database-writer.utils.d.ts +0 -15
  660. package/cjs/utils/database-writer.utils.d.ts.map +0 -1
  661. package/cjs/utils/database-writer.utils.js +0 -14
  662. package/cjs/utils/database-writer.utils.js.map +0 -1
  663. package/cjs/utils/define-model.js +0 -100
  664. package/cjs/utils/define-model.js.map +0 -1
  665. package/cjs/utils/is-valid-date-value.d.ts +0 -5
  666. package/cjs/utils/is-valid-date-value.d.ts.map +0 -1
  667. package/cjs/utils/is-valid-date-value.js +0 -25
  668. package/cjs/utils/is-valid-date-value.js.map +0 -1
  669. package/cjs/utils/once-connected.d.ts +0 -146
  670. package/cjs/utils/once-connected.d.ts.map +0 -1
  671. package/cjs/utils/once-connected.js +0 -251
  672. package/cjs/utils/once-connected.js.map +0 -1
  673. package/cjs/validation/database-seal-plugins.d.ts +0 -12
  674. package/cjs/validation/database-seal-plugins.d.ts.map +0 -1
  675. package/cjs/validation/database-seal-plugins.js +0 -1
  676. package/cjs/validation/database-seal-plugins.js.map +0 -1
  677. package/cjs/validation/database-writer-validation-error.d.ts +0 -97
  678. package/cjs/validation/database-writer-validation-error.d.ts.map +0 -1
  679. package/cjs/validation/database-writer-validation-error.js +0 -160
  680. package/cjs/validation/database-writer-validation-error.js.map +0 -1
  681. package/cjs/validation/index.d.ts +0 -3
  682. package/cjs/validation/index.d.ts.map +0 -1
  683. package/cjs/validation/mutators/embed-mutator.d.ts +0 -9
  684. package/cjs/validation/mutators/embed-mutator.d.ts.map +0 -1
  685. package/cjs/validation/mutators/embed-mutator.js +0 -33
  686. package/cjs/validation/mutators/embed-mutator.js.map +0 -1
  687. package/cjs/validation/plugins/embed-validator-plugin.d.ts +0 -24
  688. package/cjs/validation/plugins/embed-validator-plugin.d.ts.map +0 -1
  689. package/cjs/validation/plugins/embed-validator-plugin.js +0 -18
  690. package/cjs/validation/plugins/embed-validator-plugin.js.map +0 -1
  691. package/cjs/validation/rules/database-model-rule.d.ts +0 -7
  692. package/cjs/validation/rules/database-model-rule.d.ts.map +0 -1
  693. package/cjs/validation/rules/database-model-rule.js +0 -27
  694. package/cjs/validation/rules/database-model-rule.js.map +0 -1
  695. package/cjs/validation/transformers/embed-model-transformer.d.ts +0 -3
  696. package/cjs/validation/transformers/embed-model-transformer.d.ts.map +0 -1
  697. package/cjs/validation/transformers/embed-model-transformer.js +0 -18
  698. package/cjs/validation/transformers/embed-model-transformer.js.map +0 -1
  699. package/cjs/validation/validators/embed-validator.d.ts +0 -21
  700. package/cjs/validation/validators/embed-validator.d.ts.map +0 -1
  701. package/cjs/validation/validators/embed-validator.js +0 -43
  702. package/cjs/validation/validators/embed-validator.js.map +0 -1
  703. package/cjs/writer/database-writer.d.ts +0 -174
  704. package/cjs/writer/database-writer.d.ts.map +0 -1
  705. package/cjs/writer/database-writer.js +0 -400
  706. package/cjs/writer/database-writer.js.map +0 -1
  707. package/esm/context/database-data-source-context.d.ts +0 -29
  708. package/esm/context/database-data-source-context.d.ts.map +0 -1
  709. package/esm/context/database-data-source-context.js +0 -28
  710. package/esm/context/database-data-source-context.js.map +0 -1
  711. package/esm/context/database-transaction-context.d.ts +0 -35
  712. package/esm/context/database-transaction-context.d.ts.map +0 -1
  713. package/esm/context/database-transaction-context.js +0 -40
  714. package/esm/context/database-transaction-context.js.map +0 -1
  715. package/esm/contracts/database-driver.contract.d.ts +0 -450
  716. package/esm/contracts/database-driver.contract.d.ts.map +0 -1
  717. package/esm/contracts/database-id-generator.contract.d.ts +0 -109
  718. package/esm/contracts/database-id-generator.contract.d.ts.map +0 -1
  719. package/esm/contracts/database-remover.contract.d.ts +0 -104
  720. package/esm/contracts/database-remover.contract.d.ts.map +0 -1
  721. package/esm/contracts/database-restorer.contract.d.ts +0 -143
  722. package/esm/contracts/database-restorer.contract.d.ts.map +0 -1
  723. package/esm/contracts/database-writer.contract.d.ts +0 -119
  724. package/esm/contracts/database-writer.contract.d.ts.map +0 -1
  725. package/esm/contracts/driver-blueprint.contract.d.ts +0 -49
  726. package/esm/contracts/driver-blueprint.contract.d.ts.map +0 -1
  727. package/esm/contracts/index.d.ts +0 -10
  728. package/esm/contracts/index.d.ts.map +0 -1
  729. package/esm/contracts/migration-driver.contract.d.ts +0 -522
  730. package/esm/contracts/migration-driver.contract.d.ts.map +0 -1
  731. package/esm/contracts/query-builder.contract.d.ts +0 -1609
  732. package/esm/contracts/query-builder.contract.d.ts.map +0 -1
  733. package/esm/contracts/sync-adapter.contract.d.ts +0 -58
  734. package/esm/contracts/sync-adapter.contract.d.ts.map +0 -1
  735. package/esm/data-source/data-source-registry.d.ts +0 -108
  736. package/esm/data-source/data-source-registry.d.ts.map +0 -1
  737. package/esm/data-source/data-source-registry.js +0 -145
  738. package/esm/data-source/data-source-registry.js.map +0 -1
  739. package/esm/data-source/data-source.d.ts +0 -147
  740. package/esm/data-source/data-source.d.ts.map +0 -1
  741. package/esm/data-source/data-source.js +0 -83
  742. package/esm/data-source/data-source.js.map +0 -1
  743. package/esm/database-dirty-tracker.d.ts +0 -252
  744. package/esm/database-dirty-tracker.d.ts.map +0 -1
  745. package/esm/database-dirty-tracker.js +0 -386
  746. package/esm/database-dirty-tracker.js.map +0 -1
  747. package/esm/drivers/mongodb/mongodb-blueprint.d.ts +0 -30
  748. package/esm/drivers/mongodb/mongodb-blueprint.d.ts.map +0 -1
  749. package/esm/drivers/mongodb/mongodb-blueprint.js +0 -51
  750. package/esm/drivers/mongodb/mongodb-blueprint.js.map +0 -1
  751. package/esm/drivers/mongodb/mongodb-driver.d.ts +0 -325
  752. package/esm/drivers/mongodb/mongodb-driver.d.ts.map +0 -1
  753. package/esm/drivers/mongodb/mongodb-driver.js +0 -845
  754. package/esm/drivers/mongodb/mongodb-driver.js.map +0 -1
  755. package/esm/drivers/mongodb/mongodb-id-generator.d.ts +0 -116
  756. package/esm/drivers/mongodb/mongodb-id-generator.d.ts.map +0 -1
  757. package/esm/drivers/mongodb/mongodb-id-generator.js +0 -149
  758. package/esm/drivers/mongodb/mongodb-id-generator.js.map +0 -1
  759. package/esm/drivers/mongodb/mongodb-migration-driver.d.ts +0 -317
  760. package/esm/drivers/mongodb/mongodb-migration-driver.d.ts.map +0 -1
  761. package/esm/drivers/mongodb/mongodb-migration-driver.js +0 -666
  762. package/esm/drivers/mongodb/mongodb-migration-driver.js.map +0 -1
  763. package/esm/drivers/mongodb/mongodb-query-builder.d.ts +0 -1122
  764. package/esm/drivers/mongodb/mongodb-query-builder.d.ts.map +0 -1
  765. package/esm/drivers/mongodb/mongodb-query-builder.js +0 -1988
  766. package/esm/drivers/mongodb/mongodb-query-builder.js.map +0 -1
  767. package/esm/drivers/mongodb/mongodb-query-operations.d.ts +0 -226
  768. package/esm/drivers/mongodb/mongodb-query-operations.d.ts.map +0 -1
  769. package/esm/drivers/mongodb/mongodb-query-operations.js +0 -270
  770. package/esm/drivers/mongodb/mongodb-query-operations.js.map +0 -1
  771. package/esm/drivers/mongodb/mongodb-query-parser.d.ts +0 -262
  772. package/esm/drivers/mongodb/mongodb-query-parser.d.ts.map +0 -1
  773. package/esm/drivers/mongodb/mongodb-query-parser.js +0 -1351
  774. package/esm/drivers/mongodb/mongodb-query-parser.js.map +0 -1
  775. package/esm/drivers/mongodb/mongodb-sync-adapter.d.ts +0 -79
  776. package/esm/drivers/mongodb/mongodb-sync-adapter.d.ts.map +0 -1
  777. package/esm/drivers/mongodb/mongodb-sync-adapter.js +0 -146
  778. package/esm/drivers/mongodb/mongodb-sync-adapter.js.map +0 -1
  779. package/esm/drivers/mongodb/types.d.ts +0 -43
  780. package/esm/drivers/mongodb/types.d.ts.map +0 -1
  781. package/esm/drivers/postgres/index.d.ts +0 -16
  782. package/esm/drivers/postgres/index.d.ts.map +0 -1
  783. package/esm/drivers/postgres/postgres-blueprint.d.ts +0 -64
  784. package/esm/drivers/postgres/postgres-blueprint.d.ts.map +0 -1
  785. package/esm/drivers/postgres/postgres-blueprint.js +0 -121
  786. package/esm/drivers/postgres/postgres-blueprint.js.map +0 -1
  787. package/esm/drivers/postgres/postgres-dialect.d.ts +0 -136
  788. package/esm/drivers/postgres/postgres-dialect.d.ts.map +0 -1
  789. package/esm/drivers/postgres/postgres-dialect.js +0 -268
  790. package/esm/drivers/postgres/postgres-dialect.js.map +0 -1
  791. package/esm/drivers/postgres/postgres-driver.d.ts +0 -432
  792. package/esm/drivers/postgres/postgres-driver.d.ts.map +0 -1
  793. package/esm/drivers/postgres/postgres-driver.js +0 -1008
  794. package/esm/drivers/postgres/postgres-driver.js.map +0 -1
  795. package/esm/drivers/postgres/postgres-migration-driver.d.ts +0 -397
  796. package/esm/drivers/postgres/postgres-migration-driver.d.ts.map +0 -1
  797. package/esm/drivers/postgres/postgres-migration-driver.js +0 -900
  798. package/esm/drivers/postgres/postgres-migration-driver.js.map +0 -1
  799. package/esm/drivers/postgres/postgres-query-builder.d.ts +0 -254
  800. package/esm/drivers/postgres/postgres-query-builder.d.ts.map +0 -1
  801. package/esm/drivers/postgres/postgres-query-builder.js +0 -933
  802. package/esm/drivers/postgres/postgres-query-builder.js.map +0 -1
  803. package/esm/drivers/postgres/postgres-query-parser.d.ts +0 -328
  804. package/esm/drivers/postgres/postgres-query-parser.d.ts.map +0 -1
  805. package/esm/drivers/postgres/postgres-query-parser.js +0 -868
  806. package/esm/drivers/postgres/postgres-query-parser.js.map +0 -1
  807. package/esm/drivers/postgres/postgres-sql-serializer.d.ts +0 -37
  808. package/esm/drivers/postgres/postgres-sql-serializer.d.ts.map +0 -1
  809. package/esm/drivers/postgres/postgres-sql-serializer.js +0 -400
  810. package/esm/drivers/postgres/postgres-sql-serializer.js.map +0 -1
  811. package/esm/drivers/postgres/postgres-sync-adapter.d.ts +0 -83
  812. package/esm/drivers/postgres/postgres-sync-adapter.d.ts.map +0 -1
  813. package/esm/drivers/postgres/postgres-sync-adapter.js +0 -204
  814. package/esm/drivers/postgres/postgres-sync-adapter.js.map +0 -1
  815. package/esm/drivers/postgres/types.d.ts +0 -144
  816. package/esm/drivers/postgres/types.d.ts.map +0 -1
  817. package/esm/drivers/sql/index.d.ts +0 -10
  818. package/esm/drivers/sql/index.d.ts.map +0 -1
  819. package/esm/drivers/sql/sql-dialect.contract.d.ts +0 -204
  820. package/esm/drivers/sql/sql-dialect.contract.d.ts.map +0 -1
  821. package/esm/drivers/sql/sql-types.d.ts +0 -202
  822. package/esm/drivers/sql/sql-types.d.ts.map +0 -1
  823. package/esm/errors/missing-data-source.error.d.ts +0 -22
  824. package/esm/errors/missing-data-source.error.d.ts.map +0 -1
  825. package/esm/errors/missing-data-source.error.js +0 -29
  826. package/esm/errors/missing-data-source.error.js.map +0 -1
  827. package/esm/errors/transaction-rollback.error.d.ts +0 -20
  828. package/esm/errors/transaction-rollback.error.d.ts.map +0 -1
  829. package/esm/errors/transaction-rollback.error.js +0 -27
  830. package/esm/errors/transaction-rollback.error.js.map +0 -1
  831. package/esm/events/model-events.d.ts +0 -231
  832. package/esm/events/model-events.d.ts.map +0 -1
  833. package/esm/events/model-events.js +0 -259
  834. package/esm/events/model-events.js.map +0 -1
  835. package/esm/expressions/aggregate-expressions.d.ts +0 -215
  836. package/esm/expressions/aggregate-expressions.d.ts.map +0 -1
  837. package/esm/expressions/aggregate-expressions.js +0 -221
  838. package/esm/expressions/aggregate-expressions.js.map +0 -1
  839. package/esm/expressions/index.d.ts +0 -2
  840. package/esm/expressions/index.d.ts.map +0 -1
  841. package/esm/index.d.ts +0 -45
  842. package/esm/index.d.ts.map +0 -1
  843. package/esm/index.js +0 -1
  844. package/esm/index.js.map +0 -1
  845. package/esm/migration/column-builder.d.ts +0 -417
  846. package/esm/migration/column-builder.d.ts.map +0 -1
  847. package/esm/migration/column-builder.js +0 -586
  848. package/esm/migration/column-builder.js.map +0 -1
  849. package/esm/migration/column-helpers.d.ts +0 -275
  850. package/esm/migration/column-helpers.d.ts.map +0 -1
  851. package/esm/migration/column-helpers.js +0 -389
  852. package/esm/migration/column-helpers.js.map +0 -1
  853. package/esm/migration/foreign-key-builder.d.ts +0 -103
  854. package/esm/migration/foreign-key-builder.d.ts.map +0 -1
  855. package/esm/migration/foreign-key-builder.js +0 -121
  856. package/esm/migration/foreign-key-builder.js.map +0 -1
  857. package/esm/migration/index.d.ts +0 -7
  858. package/esm/migration/index.d.ts.map +0 -1
  859. package/esm/migration/migration-runner.d.ts +0 -278
  860. package/esm/migration/migration-runner.d.ts.map +0 -1
  861. package/esm/migration/migration-runner.js +0 -815
  862. package/esm/migration/migration-runner.js.map +0 -1
  863. package/esm/migration/migration.d.ts +0 -1988
  864. package/esm/migration/migration.d.ts.map +0 -1
  865. package/esm/migration/migration.js +0 -2162
  866. package/esm/migration/migration.js.map +0 -1
  867. package/esm/migration/sql-grammar.d.ts +0 -61
  868. package/esm/migration/sql-grammar.d.ts.map +0 -1
  869. package/esm/migration/sql-grammar.js +0 -164
  870. package/esm/migration/sql-grammar.js.map +0 -1
  871. package/esm/migration/sql-serializer.d.ts +0 -22
  872. package/esm/migration/sql-serializer.d.ts.map +0 -1
  873. package/esm/migration/sql-serializer.js +0 -26
  874. package/esm/migration/sql-serializer.js.map +0 -1
  875. package/esm/migration/types.d.ts +0 -155
  876. package/esm/migration/types.d.ts.map +0 -1
  877. package/esm/model/methods/accessor-methods.d.ts +0 -13
  878. package/esm/model/methods/accessor-methods.d.ts.map +0 -1
  879. package/esm/model/methods/accessor-methods.js +0 -51
  880. package/esm/model/methods/accessor-methods.js.map +0 -1
  881. package/esm/model/methods/delete-methods.d.ts +0 -10
  882. package/esm/model/methods/delete-methods.d.ts.map +0 -1
  883. package/esm/model/methods/delete-methods.js +0 -10
  884. package/esm/model/methods/delete-methods.js.map +0 -1
  885. package/esm/model/methods/dirty-methods.d.ts +0 -10
  886. package/esm/model/methods/dirty-methods.d.ts.map +0 -1
  887. package/esm/model/methods/dirty-methods.js +0 -15
  888. package/esm/model/methods/dirty-methods.js.map +0 -1
  889. package/esm/model/methods/hydration-methods.d.ts +0 -10
  890. package/esm/model/methods/hydration-methods.d.ts.map +0 -1
  891. package/esm/model/methods/hydration-methods.js +0 -57
  892. package/esm/model/methods/hydration-methods.js.map +0 -1
  893. package/esm/model/methods/instance-event-methods.d.ts +0 -7
  894. package/esm/model/methods/instance-event-methods.d.ts.map +0 -1
  895. package/esm/model/methods/instance-event-methods.js +0 -15
  896. package/esm/model/methods/instance-event-methods.js.map +0 -1
  897. package/esm/model/methods/meta-methods.d.ts +0 -7
  898. package/esm/model/methods/meta-methods.d.ts.map +0 -1
  899. package/esm/model/methods/meta-methods.js +0 -78
  900. package/esm/model/methods/meta-methods.js.map +0 -1
  901. package/esm/model/methods/query-methods.d.ts +0 -24
  902. package/esm/model/methods/query-methods.d.ts.map +0 -1
  903. package/esm/model/methods/query-methods.js +0 -164
  904. package/esm/model/methods/query-methods.js.map +0 -1
  905. package/esm/model/methods/restore-methods.d.ts +0 -10
  906. package/esm/model/methods/restore-methods.d.ts.map +0 -1
  907. package/esm/model/methods/restore-methods.js +0 -13
  908. package/esm/model/methods/restore-methods.js.map +0 -1
  909. package/esm/model/methods/scope-methods.d.ts +0 -7
  910. package/esm/model/methods/scope-methods.d.ts.map +0 -1
  911. package/esm/model/methods/scope-methods.js +0 -15
  912. package/esm/model/methods/scope-methods.js.map +0 -1
  913. package/esm/model/methods/serialization-methods.d.ts +0 -3
  914. package/esm/model/methods/serialization-methods.d.ts.map +0 -1
  915. package/esm/model/methods/serialization-methods.js +0 -27
  916. package/esm/model/methods/serialization-methods.js.map +0 -1
  917. package/esm/model/methods/static-event-methods.d.ts +0 -9
  918. package/esm/model/methods/static-event-methods.d.ts.map +0 -1
  919. package/esm/model/methods/static-event-methods.js +0 -29
  920. package/esm/model/methods/static-event-methods.js.map +0 -1
  921. package/esm/model/methods/write-methods.d.ts +0 -10
  922. package/esm/model/methods/write-methods.d.ts.map +0 -1
  923. package/esm/model/methods/write-methods.js +0 -52
  924. package/esm/model/methods/write-methods.js.map +0 -1
  925. package/esm/model/model.d.ts +0 -1647
  926. package/esm/model/model.d.ts.map +0 -1
  927. package/esm/model/model.js +0 -1657
  928. package/esm/model/model.js.map +0 -1
  929. package/esm/model/model.types.d.ts +0 -44
  930. package/esm/model/model.types.d.ts.map +0 -1
  931. package/esm/model/register-model.d.ts +0 -81
  932. package/esm/model/register-model.d.ts.map +0 -1
  933. package/esm/model/register-model.js +0 -94
  934. package/esm/model/register-model.js.map +0 -1
  935. package/esm/query-builder/query-builder.d.ts +0 -556
  936. package/esm/query-builder/query-builder.d.ts.map +0 -1
  937. package/esm/query-builder/query-builder.js +0 -1070
  938. package/esm/query-builder/query-builder.js.map +0 -1
  939. package/esm/relations/helpers.d.ts +0 -156
  940. package/esm/relations/helpers.d.ts.map +0 -1
  941. package/esm/relations/helpers.js +0 -202
  942. package/esm/relations/helpers.js.map +0 -1
  943. package/esm/relations/index.d.ts +0 -35
  944. package/esm/relations/index.d.ts.map +0 -1
  945. package/esm/relations/pivot-operations.d.ts +0 -160
  946. package/esm/relations/pivot-operations.d.ts.map +0 -1
  947. package/esm/relations/pivot-operations.js +0 -293
  948. package/esm/relations/pivot-operations.js.map +0 -1
  949. package/esm/relations/relation-hydrator.d.ts +0 -68
  950. package/esm/relations/relation-hydrator.d.ts.map +0 -1
  951. package/esm/relations/relation-hydrator.js +0 -81
  952. package/esm/relations/relation-hydrator.js.map +0 -1
  953. package/esm/relations/relation-loader.d.ts +0 -194
  954. package/esm/relations/relation-loader.d.ts.map +0 -1
  955. package/esm/relations/relation-loader.js +0 -466
  956. package/esm/relations/relation-loader.js.map +0 -1
  957. package/esm/relations/types.d.ts +0 -306
  958. package/esm/relations/types.d.ts.map +0 -1
  959. package/esm/remover/database-remover.d.ts +0 -100
  960. package/esm/remover/database-remover.d.ts.map +0 -1
  961. package/esm/remover/database-remover.js +0 -214
  962. package/esm/remover/database-remover.js.map +0 -1
  963. package/esm/restorer/database-restorer.d.ts +0 -131
  964. package/esm/restorer/database-restorer.d.ts.map +0 -1
  965. package/esm/restorer/database-restorer.js +0 -434
  966. package/esm/restorer/database-restorer.js.map +0 -1
  967. package/esm/sql-database-dirty-tracker.d.ts +0 -13
  968. package/esm/sql-database-dirty-tracker.d.ts.map +0 -1
  969. package/esm/sql-database-dirty-tracker.js +0 -14
  970. package/esm/sql-database-dirty-tracker.js.map +0 -1
  971. package/esm/sync/index.d.ts +0 -12
  972. package/esm/sync/index.d.ts.map +0 -1
  973. package/esm/sync/model-events.d.ts +0 -62
  974. package/esm/sync/model-events.d.ts.map +0 -1
  975. package/esm/sync/model-events.js +0 -49
  976. package/esm/sync/model-events.js.map +0 -1
  977. package/esm/sync/model-sync-operation.d.ts +0 -163
  978. package/esm/sync/model-sync-operation.d.ts.map +0 -1
  979. package/esm/sync/model-sync-operation.js +0 -292
  980. package/esm/sync/model-sync-operation.js.map +0 -1
  981. package/esm/sync/model-sync.d.ts +0 -130
  982. package/esm/sync/model-sync.d.ts.map +0 -1
  983. package/esm/sync/model-sync.js +0 -178
  984. package/esm/sync/model-sync.js.map +0 -1
  985. package/esm/sync/sync-context.d.ts +0 -70
  986. package/esm/sync/sync-context.d.ts.map +0 -1
  987. package/esm/sync/sync-context.js +0 -101
  988. package/esm/sync/sync-context.js.map +0 -1
  989. package/esm/sync/sync-manager.d.ts +0 -213
  990. package/esm/sync/sync-manager.d.ts.map +0 -1
  991. package/esm/sync/sync-manager.js +0 -689
  992. package/esm/sync/sync-manager.js.map +0 -1
  993. package/esm/sync/types.d.ts +0 -289
  994. package/esm/sync/types.d.ts.map +0 -1
  995. package/esm/test-migrations/test-enhanced-features.migration.d.ts +0 -15
  996. package/esm/test-migrations/test-enhanced-features.migration.d.ts.map +0 -1
  997. package/esm/types.d.ts +0 -371
  998. package/esm/types.d.ts.map +0 -1
  999. package/esm/utils/connect-to-database.d.ts +0 -307
  1000. package/esm/utils/connect-to-database.d.ts.map +0 -1
  1001. package/esm/utils/connect-to-database.js +0 -130
  1002. package/esm/utils/connect-to-database.js.map +0 -1
  1003. package/esm/utils/database-writer.utils.d.ts +0 -15
  1004. package/esm/utils/database-writer.utils.d.ts.map +0 -1
  1005. package/esm/utils/database-writer.utils.js +0 -14
  1006. package/esm/utils/database-writer.utils.js.map +0 -1
  1007. package/esm/utils/define-model.js +0 -100
  1008. package/esm/utils/define-model.js.map +0 -1
  1009. package/esm/utils/is-valid-date-value.d.ts +0 -5
  1010. package/esm/utils/is-valid-date-value.d.ts.map +0 -1
  1011. package/esm/utils/is-valid-date-value.js +0 -25
  1012. package/esm/utils/is-valid-date-value.js.map +0 -1
  1013. package/esm/utils/once-connected.d.ts +0 -146
  1014. package/esm/utils/once-connected.d.ts.map +0 -1
  1015. package/esm/utils/once-connected.js +0 -251
  1016. package/esm/utils/once-connected.js.map +0 -1
  1017. package/esm/validation/database-seal-plugins.d.ts +0 -12
  1018. package/esm/validation/database-seal-plugins.d.ts.map +0 -1
  1019. package/esm/validation/database-seal-plugins.js +0 -1
  1020. package/esm/validation/database-seal-plugins.js.map +0 -1
  1021. package/esm/validation/database-writer-validation-error.d.ts +0 -97
  1022. package/esm/validation/database-writer-validation-error.d.ts.map +0 -1
  1023. package/esm/validation/database-writer-validation-error.js +0 -160
  1024. package/esm/validation/database-writer-validation-error.js.map +0 -1
  1025. package/esm/validation/index.d.ts +0 -3
  1026. package/esm/validation/index.d.ts.map +0 -1
  1027. package/esm/validation/mutators/embed-mutator.d.ts +0 -9
  1028. package/esm/validation/mutators/embed-mutator.d.ts.map +0 -1
  1029. package/esm/validation/mutators/embed-mutator.js +0 -33
  1030. package/esm/validation/mutators/embed-mutator.js.map +0 -1
  1031. package/esm/validation/plugins/embed-validator-plugin.d.ts +0 -24
  1032. package/esm/validation/plugins/embed-validator-plugin.d.ts.map +0 -1
  1033. package/esm/validation/plugins/embed-validator-plugin.js +0 -18
  1034. package/esm/validation/plugins/embed-validator-plugin.js.map +0 -1
  1035. package/esm/validation/rules/database-model-rule.d.ts +0 -7
  1036. package/esm/validation/rules/database-model-rule.d.ts.map +0 -1
  1037. package/esm/validation/rules/database-model-rule.js +0 -27
  1038. package/esm/validation/rules/database-model-rule.js.map +0 -1
  1039. package/esm/validation/transformers/embed-model-transformer.d.ts +0 -3
  1040. package/esm/validation/transformers/embed-model-transformer.d.ts.map +0 -1
  1041. package/esm/validation/transformers/embed-model-transformer.js +0 -18
  1042. package/esm/validation/transformers/embed-model-transformer.js.map +0 -1
  1043. package/esm/validation/validators/embed-validator.d.ts +0 -21
  1044. package/esm/validation/validators/embed-validator.d.ts.map +0 -1
  1045. package/esm/validation/validators/embed-validator.js +0 -43
  1046. package/esm/validation/validators/embed-validator.js.map +0 -1
  1047. package/esm/writer/database-writer.d.ts +0 -174
  1048. package/esm/writer/database-writer.d.ts.map +0 -1
  1049. package/esm/writer/database-writer.js +0 -400
  1050. package/esm/writer/database-writer.js.map +0 -1
@@ -0,0 +1,2035 @@
1
+ import { MigrationDefaults } from "../types.mjs";
2
+ import { TableIndexInformation } from "../contracts/driver-blueprint.contract.mjs";
3
+ import { ColumnDefinition, ForeignKeyDefinition, FullTextIndexOptions, GeoIndexOptions, IndexDefinition, MigrationDriverContract, VectorIndexOptions } from "../contracts/migration-driver.contract.mjs";
4
+ import { ColumnBuilder } from "./column-builder.mjs";
5
+ import { DetachedColumnBuilder } from "./column-helpers.mjs";
6
+ import { ChildModel } from "../model/model.types.mjs";
7
+ import { Model } from "../model/model.mjs";
8
+ import { DatabaseDriver } from "../utils/connect-to-database.mjs";
9
+ import { ForeignKeyBuilder } from "./foreign-key-builder.mjs";
10
+ import { DataSource } from "../data-source/data-source.mjs";
11
+
12
+ //#region ../../@warlock.js/cascade/src/migration/migration.d.ts
13
+ /**
14
+ * Pending operation types supported by migrations.
15
+ */
16
+ type OperationType = "addColumn" | "dropColumn" | "dropColumns" | "renameColumn" | "modifyColumn" | "createIndex" | "dropIndex" | "createUniqueIndex" | "dropUniqueIndex" | "createFullTextIndex" | "dropFullTextIndex" | "createGeoIndex" | "dropGeoIndex" | "createVectorIndex" | "dropVectorIndex" | "createTTLIndex" | "dropTTLIndex" | "addForeignKey" | "dropForeignKey" | "addPrimaryKey" | "dropPrimaryKey" | "addCheck" | "dropCheck" | "createTable" | "createTableIfNotExists" | "dropTable" | "dropTableIfExists" | "renameTable" | "truncateTable" | "createTimestamps" | "rawStatement" | "setSchemaValidation" | "removeSchemaValidation";
17
+ /**
18
+ * Pending operation to be executed when migration runs.
19
+ */
20
+ type PendingOperation = {
21
+ readonly type: OperationType;
22
+ readonly payload: unknown;
23
+ };
24
+ /**
25
+ * Contract for a migration class.
26
+ */
27
+ interface MigrationContract {
28
+ /**
29
+ * Table/collection name for this migration.
30
+ */
31
+ readonly table: string;
32
+ /**
33
+ * Optional data source override.
34
+ */
35
+ readonly dataSource?: string | DataSource;
36
+ /**
37
+ * Whether to wrap migration in a transaction.
38
+ */
39
+ readonly transactional?: boolean;
40
+ /**
41
+ * Define schema changes for the up migration.
42
+ */
43
+ up(): void | Promise<void>;
44
+ /**
45
+ * Define rollback operations for the down migration.
46
+ */
47
+ down(): void | Promise<void>;
48
+ /**
49
+ * Set the migration driver.
50
+ *
51
+ * @param driver - Migration driver instance
52
+ * @internal
53
+ */
54
+ setDriver(driver: MigrationDriverContract): void;
55
+ /**
56
+ * Set migration defaults from the resolved DataSource.
57
+ *
58
+ * @param defaults - Migration defaults (UUID strategy, etc.)
59
+ * @internal
60
+ */
61
+ setMigrationDefaults(defaults?: MigrationDefaults): void;
62
+ /**
63
+ * Get the migration driver.
64
+ *
65
+ * @returns The migration driver instance
66
+ */
67
+ getDriver(): MigrationDriverContract;
68
+ /**
69
+ * Execute all pending operations.
70
+ *
71
+ * @internal
72
+ */
73
+ execute(): Promise<void>;
74
+ /**
75
+ * Add a pending index definition.
76
+ *
77
+ * @param index - Index definition
78
+ * @internal
79
+ */
80
+ addPendingIndex(index: IndexDefinition): void;
81
+ /**
82
+ * Add a foreign key operation.
83
+ *
84
+ * @param fk - Foreign key definition
85
+ * @internal
86
+ */
87
+ addForeignKeyOperation(fk: ForeignKeyDefinition): void;
88
+ /**
89
+ * Create the table/collection.
90
+ */
91
+ createTable(): MigrationContract;
92
+ /**
93
+ * Create table if not exists
94
+ */
95
+ createTableIfNotExists(): MigrationContract;
96
+ /**
97
+ * Drop the table/collection.
98
+ */
99
+ dropTable(): MigrationContract;
100
+ /**
101
+ * Drop the table/collection if it exists.
102
+ */
103
+ dropTableIfExists(): MigrationContract;
104
+ /**
105
+ * Rename the table/collection.
106
+ *
107
+ * @param newName - New table name
108
+ */
109
+ renameTableTo(newName: string): MigrationContract;
110
+ /**
111
+ * Truncate the table — remove all rows without logging or firing triggers.
112
+ */
113
+ truncateTable(): MigrationContract;
114
+ /**
115
+ * Add a string/varchar column.
116
+ */
117
+ string(column: string, length?: number): ColumnBuilder;
118
+ /**
119
+ * Add a fixed-length char column.
120
+ */
121
+ char(column: string, length: number): ColumnBuilder;
122
+ /**
123
+ * Add a text column (unlimited length).
124
+ */
125
+ text(column: string): ColumnBuilder;
126
+ /**
127
+ * Add a medium text column.
128
+ */
129
+ mediumText(column: string): ColumnBuilder;
130
+ /**
131
+ * Add a long text column.
132
+ */
133
+ longText(column: string): ColumnBuilder;
134
+ /**
135
+ * Add an integer column.
136
+ */
137
+ integer(column: string): ColumnBuilder;
138
+ /**
139
+ * Alias for integer().
140
+ */
141
+ int(column: string): ColumnBuilder;
142
+ /**
143
+ * Add a small integer column.
144
+ */
145
+ smallInteger(column: string): ColumnBuilder;
146
+ /**
147
+ * Alias for smallInteger().
148
+ */
149
+ smallInt(column: string): ColumnBuilder;
150
+ /**
151
+ * Add a tiny integer column.
152
+ */
153
+ tinyInteger(column: string): ColumnBuilder;
154
+ /**
155
+ * Alias for tinyInteger().
156
+ */
157
+ tinyInt(column: string): ColumnBuilder;
158
+ /**
159
+ * Add a big integer column.
160
+ */
161
+ bigInteger(column: string): ColumnBuilder;
162
+ /**
163
+ * Alias for bigInteger().
164
+ */
165
+ bigInt(column: string): ColumnBuilder;
166
+ /**
167
+ * Add a float column.
168
+ */
169
+ float(column: string): ColumnBuilder;
170
+ /**
171
+ * Add a double precision column.
172
+ */
173
+ double(column: string): ColumnBuilder;
174
+ /**
175
+ * Add a decimal column with precision and scale.
176
+ */
177
+ decimal(column: string, precision?: number, scale?: number): ColumnBuilder;
178
+ /**
179
+ * Add a boolean column.
180
+ */
181
+ boolean(column: string): ColumnBuilder;
182
+ /**
183
+ * Alias for boolean().
184
+ */
185
+ bool(column: string): ColumnBuilder;
186
+ /**
187
+ * Add a date column (date only, no time).
188
+ */
189
+ date(column: string): ColumnBuilder;
190
+ /**
191
+ * Add a datetime column (date and time).
192
+ */
193
+ dateTime(column: string): ColumnBuilder;
194
+ /**
195
+ * Add a timestamp column.
196
+ */
197
+ timestamp(column: string): ColumnBuilder;
198
+ /**
199
+ * Add a time column (time only, no date).
200
+ */
201
+ time(column: string): ColumnBuilder;
202
+ /**
203
+ * Add a year column.
204
+ */
205
+ year(column: string): ColumnBuilder;
206
+ /**
207
+ * Add a JSON column.
208
+ */
209
+ json(column: string): ColumnBuilder;
210
+ /**
211
+ * Alias for json().
212
+ */
213
+ object(column: string): ColumnBuilder;
214
+ /**
215
+ * Add a binary/blob column.
216
+ */
217
+ binary(column: string): ColumnBuilder;
218
+ /**
219
+ * Alias for binary().
220
+ */
221
+ blob(column: string): ColumnBuilder;
222
+ /**
223
+ * Add a UUID column.
224
+ */
225
+ uuid(column: string): ColumnBuilder;
226
+ /**
227
+ * Add a ULID column.
228
+ */
229
+ ulid(column: string): ColumnBuilder;
230
+ /**
231
+ * Add an IP address column.
232
+ */
233
+ ipAddress(column: string): ColumnBuilder;
234
+ /**
235
+ * Add a MAC address column.
236
+ */
237
+ macAddress(column: string): ColumnBuilder;
238
+ /**
239
+ * Add a geo point column.
240
+ */
241
+ point(column: string): ColumnBuilder;
242
+ /**
243
+ * Add a polygon column.
244
+ */
245
+ polygon(column: string): ColumnBuilder;
246
+ /**
247
+ * Add a line string column.
248
+ */
249
+ lineString(column: string): ColumnBuilder;
250
+ /**
251
+ * Add a generic geometry column.
252
+ */
253
+ geometry(column: string): ColumnBuilder;
254
+ /**
255
+ * Add an enum column with allowed values.
256
+ */
257
+ enum(column: string, values: string[]): ColumnBuilder;
258
+ /**
259
+ * Add a set column (multiple values from a set).
260
+ */
261
+ set(column: string, values: string[]): ColumnBuilder;
262
+ /** INTEGER[] — array of integers. */
263
+ arrayInt(column: string): ColumnBuilder;
264
+ /** BIGINT[] — array of big integers. */
265
+ arrayBigInt(column: string): ColumnBuilder;
266
+ /** REAL[] — array of floats. */
267
+ arrayFloat(column: string): ColumnBuilder;
268
+ /** DECIMAL[] — array of decimals (optional precision/scale). */
269
+ arrayDecimal(column: string, precision?: number, scale?: number): ColumnBuilder;
270
+ /** BOOLEAN[] — array of booleans. */
271
+ arrayBoolean(column: string): ColumnBuilder;
272
+ /** TEXT[] — array of text values. */
273
+ arrayText(column: string): ColumnBuilder;
274
+ /** DATE[] — array of dates. */
275
+ arrayDate(column: string): ColumnBuilder;
276
+ /** TIMESTAMPTZ[] — array of timestamps with time zone. */
277
+ arrayTimestamp(column: string): ColumnBuilder;
278
+ /** UUID[] — array of UUIDs. */
279
+ arrayUuid(column: string): ColumnBuilder;
280
+ /** JSONB[] — array of JSON objects. */
281
+ arrayJson(column: string): ColumnBuilder;
282
+ /**
283
+ * Add an auto-increment primary key column.
284
+ */
285
+ id(name?: string): ColumnBuilder;
286
+ /**
287
+ * Add a big integer auto-increment primary key column.
288
+ */
289
+ bigId(name?: string): ColumnBuilder;
290
+ /**
291
+ * Add a UUID primary key column.
292
+ */
293
+ uuidId(name?: string): ColumnBuilder;
294
+ /**
295
+ * Add a UUID primary key column with automatic generation.
296
+ *
297
+ * PostgreSQL: Uses gen_random_uuid() (built-in since PG 13)
298
+ * MongoDB: Application-level UUID generation
299
+ *
300
+ * @param name - Column name (default: "id")
301
+ * @returns Column builder for chaining modifiers
302
+ *
303
+ * @example
304
+ * ```typescript
305
+ * this.primaryUuid(); // id UUID PRIMARY KEY DEFAULT gen_random_uuid()
306
+ * this.primaryUuid("organization_id"); // Custom column name
307
+ * ```
308
+ */
309
+ primaryUuid(name?: string): ColumnBuilder;
310
+ /**
311
+ * Add createdAt and updatedAt timestamp columns.
312
+ */
313
+ timestamps(): MigrationContract;
314
+ /**
315
+ * Add a deletedAt column for soft deletes.
316
+ */
317
+ softDeletes(column?: string): ColumnBuilder;
318
+ /**
319
+ * Drop a column.
320
+ */
321
+ dropColumn(column: string): MigrationContract;
322
+ /**
323
+ * Drop multiple columns.
324
+ */
325
+ dropColumns(...columns: string[]): MigrationContract;
326
+ /**
327
+ * Rename a column.
328
+ */
329
+ renameColumn(from: string, to: string): MigrationContract;
330
+ /**
331
+ * Create an index on one or more columns.
332
+ *
333
+ * @param columns - Column(s) to index
334
+ * @param name - Optional index name
335
+ * @param options - Optional index options (include, concurrently)
336
+ */
337
+ index(columns: string | string[], name?: string, options?: {
338
+ include?: string[];
339
+ concurrently?: boolean;
340
+ }): MigrationContract;
341
+ /**
342
+ * Drop an index by name or columns.
343
+ */
344
+ dropIndex(nameOrColumns: string | string[]): MigrationContract;
345
+ /**
346
+ * Create a unique constraint/index.
347
+ *
348
+ * @param columns - Column(s) to make unique
349
+ * @param name - Optional constraint name
350
+ * @param options - Optional index options (include, concurrently)
351
+ */
352
+ unique(columns: string | string[], name?: string, options?: {
353
+ include?: string[];
354
+ concurrently?: boolean;
355
+ }): MigrationContract;
356
+ /**
357
+ * Drop a unique constraint/index.
358
+ */
359
+ dropUnique(columns: string | string[]): MigrationContract;
360
+ /**
361
+ * Create an expression-based index.
362
+ *
363
+ * @param expressions - SQL expression(s) to index, e.g., ['lower(email)', 'upper(name)']
364
+ * @param name - Optional index name
365
+ * @param options - Optional index options (concurrently)
366
+ */
367
+ expressionIndex(expressions: string | string[], name?: string, options?: {
368
+ concurrently?: boolean;
369
+ }): MigrationContract;
370
+ /**
371
+ * Create a full-text search index.
372
+ */
373
+ fullText(columns: string | string[], options?: FullTextIndexOptions): MigrationContract;
374
+ /**
375
+ * Drop a full-text search index.
376
+ */
377
+ dropFullText(name: string): MigrationContract;
378
+ /**
379
+ * Create a geo-spatial index.
380
+ */
381
+ geoIndex(column: string, options?: GeoIndexOptions): MigrationContract;
382
+ /**
383
+ * Drop a geo-spatial index.
384
+ */
385
+ dropGeoIndex(column: string): MigrationContract;
386
+ /**
387
+ * Create a vector search index for AI embeddings.
388
+ */
389
+ vectorIndex(column: string, options: VectorIndexOptions): MigrationContract;
390
+ /**
391
+ * Drop a vector search index.
392
+ */
393
+ dropVectorIndex(column: string): MigrationContract;
394
+ /**
395
+ * Create a TTL (time-to-live) index for automatic document expiration.
396
+ */
397
+ ttlIndex(column: string, expireAfterSeconds: number): MigrationContract;
398
+ /**
399
+ * Drop a TTL index.
400
+ */
401
+ dropTTLIndex(column: string): MigrationContract;
402
+ /**
403
+ * Add a composite primary key.
404
+ */
405
+ primaryKey(columns: string[]): MigrationContract;
406
+ /**
407
+ * Drop the primary key constraint.
408
+ */
409
+ dropPrimaryKey(): MigrationContract;
410
+ /**
411
+ * Start building a foreign key constraint.
412
+ */
413
+ foreign(column: string): ForeignKeyBuilder;
414
+ /**
415
+ * Drop a foreign key constraint.
416
+ *
417
+ * When `referencesTable` is provided, the constraint name is auto-computed
418
+ * using the same convention as `addForeignKey`:
419
+ * `fk_{table}_{column}_{referencesTable}`
420
+ *
421
+ * When omitted, `columnOrConstraint` is used as the raw constraint name.
422
+ */
423
+ dropForeign(columnOrConstraint: string, referencesTable?: string): MigrationContract;
424
+ /**
425
+ * Set JSON schema validation rules on the collection.
426
+ */
427
+ schemaValidation(schema: object): MigrationContract;
428
+ /**
429
+ * Remove schema validation rules from the collection.
430
+ */
431
+ dropSchemaValidation(): MigrationContract;
432
+ /**
433
+ * Check if a table exists.
434
+ */
435
+ hasTable(tableName: string): Promise<boolean>;
436
+ /**
437
+ * Check if a column exists in the current table.
438
+ */
439
+ hasColumn(columnName: string): Promise<boolean>;
440
+ /**
441
+ * Get all columns in the current table.
442
+ */
443
+ getColumns(): Promise<ColumnDefinition[]>;
444
+ /**
445
+ * List all tables in the current database/connection.
446
+ */
447
+ listTables(): Promise<string[]>;
448
+ /**
449
+ * Get all indexes on the current table.
450
+ */
451
+ getIndexes(): Promise<TableIndexInformation[]>;
452
+ /**
453
+ * Check if a named index exists on the current table.
454
+ */
455
+ hasIndex(indexName: string): Promise<boolean>;
456
+ /**
457
+ * Queue a raw SQL string for execution within the migration.
458
+ *
459
+ * @param sql - SQL statement to execute
460
+ */
461
+ raw(sql: string): this;
462
+ /**
463
+ * Execute raw operations with direct driver/connection access.
464
+ *
465
+ * @param callback - Callback receiving the native connection
466
+ */
467
+ withConnection<T>(callback: (connection: unknown) => Promise<T>): Promise<T>;
468
+ /**
469
+ * Add a vector column for storing AI embeddings.
470
+ *
471
+ * @param column - Column name
472
+ * @param dimensions - Embedding size (e.g. 1536 for text-embedding-3-small)
473
+ */
474
+ vector(column: string, dimensions: number): ColumnBuilder;
475
+ }
476
+ /**
477
+ * Constructor for the migration class.
478
+ */
479
+ interface MigrationConstructor {
480
+ new (): MigrationContract;
481
+ migrationName?: string;
482
+ createdAt?: string;
483
+ transactional?: boolean;
484
+ order?: number;
485
+ }
486
+ /**
487
+ * Base class for all database migrations.
488
+ *
489
+ * Provides a fluent API for defining schema changes that work across
490
+ * both SQL and NoSQL databases. The migration driver handles translating
491
+ * operations to native database commands.
492
+ *
493
+ * Migrations are executed in order based on their `createdAt` timestamp,
494
+ * which is typically extracted from the filename (e.g., `2024-01-15_create-users`).
495
+ *
496
+ * @example
497
+ * ```typescript
498
+ * // Using Migration.for() to bind to a model
499
+ * export default class extends Migration.for(User) {
500
+ * public up(): void {
501
+ * this.string("email").unique();
502
+ * this.integer("age").nullable();
503
+ * this.geoIndex("location");
504
+ * }
505
+ *
506
+ * public down(): void {
507
+ * this.dropColumn("email");
508
+ * this.dropColumn("age");
509
+ * this.dropGeoIndex("location");
510
+ * }
511
+ * }
512
+ * ```
513
+ *
514
+ * @example
515
+ * ```typescript
516
+ * // Manual table migration (without model binding)
517
+ * export default class CreateUsersTable extends Migration {
518
+ * public readonly table = "users";
519
+ *
520
+ * public up(): void {
521
+ * this.createTable();
522
+ * this.id();
523
+ * this.string("name");
524
+ * this.string("email").unique();
525
+ * this.timestamps();
526
+ * }
527
+ *
528
+ * public down(): void {
529
+ * this.dropTable();
530
+ * }
531
+ * }
532
+ * ```
533
+ */
534
+ declare abstract class Migration implements MigrationContract {
535
+ /**
536
+ * Migration name that will be labeled with
537
+ * If record is enabled in migration, it will be stored as migration name
538
+ * in database
539
+ *
540
+ * @example
541
+ * ```typescript
542
+ * "2024-01-15_create-users";
543
+ * ```
544
+ */
545
+ static migrationName?: string;
546
+ /**
547
+ * Table/collection name for this migration.
548
+ *
549
+ * Must be defined by each migration class (either directly or via `Migration.for()`).
550
+ */
551
+ readonly table: string;
552
+ /**
553
+ * Sort order
554
+ * If not provided, it will be ordered alphabetically
555
+ */
556
+ static readonly order?: number;
557
+ /**
558
+ * Optional data source override.
559
+ *
560
+ * If specified, this migration will use a specific data source
561
+ * instead of the default one. Can be a string name or DataSource instance.
562
+ */
563
+ readonly dataSource?: string | DataSource;
564
+ /**
565
+ * Optional timestamp override.
566
+ *
567
+ * By default, the migration runner extracts this from the filename.
568
+ * Set explicitly to override the execution order.
569
+ *
570
+ * Format: ISO 8601 or any parseable date string.
571
+ */
572
+ static readonly createdAt?: string;
573
+ /**
574
+ * Whether to wrap migration in a transaction.
575
+ *
576
+ * Defaults to `true` for SQL databases that support DDL transactions.
577
+ * Set to `false` for operations that cannot be transactional.
578
+ *
579
+ * Note: MongoDB does not support transactions for most DDL operations.
580
+ */
581
+ readonly transactional?: boolean;
582
+ /**
583
+ * Migration driver instance (injected by the runner).
584
+ */
585
+ protected driver: MigrationDriverContract;
586
+ /**
587
+ * Migration defaults from the resolved DataSource.
588
+ * @internal
589
+ */
590
+ /** @internal — readable by factory-generated subclasses */
591
+ protected _migrationDefaults?: MigrationDefaults;
592
+ /**
593
+ * Queued operations to execute.
594
+ */
595
+ private readonly pendingOperations;
596
+ /**
597
+ * Define schema changes for the up migration.
598
+ *
599
+ * Called when running migrations forward. Add columns, indexes,
600
+ * constraints, etc. in this method.
601
+ */
602
+ abstract up(): void | Promise<void>;
603
+ /**
604
+ * Define rollback operations for the down migration.
605
+ *
606
+ * Called when rolling back migrations. Drop columns, indexes,
607
+ * and undo any changes made in `up()`.
608
+ */
609
+ abstract down(): void | Promise<void>;
610
+ /**
611
+ * Create a migration class bound to a specific model.
612
+ *
613
+ * Automatically inherits the model's table name and data source,
614
+ * reducing boilerplate and ensuring consistency.
615
+ *
616
+ * @param model - Model class to bind
617
+ * @returns Abstract migration class bound to the model
618
+ *
619
+ * @example
620
+ * ```typescript
621
+ * export default class extends Migration.for(User) {
622
+ * public up(): void {
623
+ * this.string("avatar").nullable();
624
+ * }
625
+ *
626
+ * public down(): void {
627
+ * this.dropColumn("avatar");
628
+ * }
629
+ * }
630
+ * ```
631
+ */
632
+ static for<T extends ChildModel<Model>>(model: T): MigrationConstructor;
633
+ /**
634
+ * Create a migration that executes raw SQL statements.
635
+ *
636
+ * Intended for external packages that ship engine-specific DDL — typically a
637
+ * one-shot `CREATE TABLE` bundle whose `up` is the only direction that matters.
638
+ * The `down` direction is optional; when omitted, rollback is a recorded no-op.
639
+ *
640
+ * Raw SQL is engine-locked by definition. This factory is rejected on MongoDB
641
+ * data sources at execute time — use the fluent builder for cross-engine work.
642
+ *
643
+ * @param options - Migration name, SQL statements, and optional overrides
644
+ * @returns Migration constructor ready to register with the runner
645
+ *
646
+ * @example
647
+ * ```typescript
648
+ * export const createAuthTables = Migration.rawSql({
649
+ * name: "create_auth_tables",
650
+ * up: [
651
+ * `CREATE TABLE users (id UUID PRIMARY KEY, email TEXT UNIQUE NOT NULL)`,
652
+ * `CREATE TABLE sessions (id UUID PRIMARY KEY, user_id UUID REFERENCES users(id))`,
653
+ * ],
654
+ * });
655
+ * ```
656
+ */
657
+ static rawSql(options: {
658
+ /**
659
+ * Migration name. Used as the tracking key in the migrations table — must
660
+ * be unique across the application.
661
+ */
662
+ name: string;
663
+ /**
664
+ * SQL statement(s) to execute on the up direction.
665
+ */
666
+ up: string | string[];
667
+ /**
668
+ * Optional SQL statement(s) for rollback. If omitted, `down()` is a no-op
669
+ * and rollback simply removes the tracking record.
670
+ */
671
+ down?: string | string[];
672
+ /**
673
+ * Optional data source override (string name or DataSource instance).
674
+ */
675
+ dataSource?: string | DataSource;
676
+ /**
677
+ * Whether to wrap execution in a transaction. Defaults to the runner's
678
+ * resolved default.
679
+ */
680
+ transactional?: boolean;
681
+ }): MigrationConstructor;
682
+ /**
683
+ * Set the migration driver.
684
+ *
685
+ * Called by the migration runner before executing up/down.
686
+ *
687
+ * @param driver - Migration driver instance
688
+ * @internal
689
+ */
690
+ setDriver(driver: MigrationDriverContract): void;
691
+ /**
692
+ * Set migration defaults from the resolved DataSource.
693
+ *
694
+ * @param defaults - Migration defaults (UUID strategy, etc.)
695
+ * @internal
696
+ */
697
+ setMigrationDefaults(defaults?: MigrationDefaults): void;
698
+ /**
699
+ * Get the migration driver.
700
+ *
701
+ * @returns The migration driver instance
702
+ */
703
+ getDriver(): MigrationDriverContract;
704
+ /**
705
+ * Get database engine (MongoDB, Postgress...etc)
706
+ */
707
+ get databaseEngine(): DatabaseDriver;
708
+ /**
709
+ * Execute all pending operations.
710
+ *
711
+ * @deprecated Use toSQL() instead — migrations now generate SQL rather than
712
+ * executing DDL directly through the driver.
713
+ * @internal
714
+ */
715
+ execute(): Promise<void>;
716
+ /**
717
+ * Serialize all queued pending operations into a flat list of SQL strings.
718
+ *
719
+ * Call this AFTER invoking `up()` or `down()` to extract the SQL for the
720
+ * operations that were queued during that call. The pending queue is cleared
721
+ * after serializing so the instance is safe to reuse.
722
+ *
723
+ * @example
724
+ * ```typescript
725
+ * const migration = new CreateUsersTable();
726
+ * migration.setDriver(driver);
727
+ *
728
+ * // Up SQL
729
+ * await migration.up();
730
+ * const upSQL = migration.toSQL();
731
+ *
732
+ * // Down SQL — reuse the same instance
733
+ * await migration.down();
734
+ * const downSQL = migration.toSQL();
735
+ * ```
736
+ */
737
+ toSQL(): string[];
738
+ /**
739
+ * Execute a single pending operation.
740
+ */
741
+ private executeOperation;
742
+ /**
743
+ * Check if a table exists.
744
+ *
745
+ * Useful for conditional migrations and idempotent operations.
746
+ *
747
+ * @param tableName - Table name to check
748
+ * @returns Promise resolving to true if table exists
749
+ *
750
+ * @example
751
+ * ```typescript
752
+ * public async up() {
753
+ * if (await this.hasTable("users_backup")) {
754
+ * this.dropTable("users_backup");
755
+ * }
756
+ * // ... rest of migration
757
+ * }
758
+ * ```
759
+ */
760
+ hasTable(tableName: string): Promise<boolean>;
761
+ /**
762
+ * Check if a column exists in the current table.
763
+ *
764
+ * @param columnName - Column name to check
765
+ * @returns Promise resolving to true if column exists
766
+ *
767
+ * @example
768
+ * ```typescript
769
+ * public async up() {
770
+ * if (!(await this.hasColumn("email"))) {
771
+ * this.string("email").unique();
772
+ * }
773
+ * }
774
+ * ```
775
+ */
776
+ hasColumn(columnName: string): Promise<boolean>;
777
+ /**
778
+ * Get all columns in the current table.
779
+ *
780
+ * @returns Promise resolving to array of column definitions
781
+ *
782
+ * @example
783
+ * ```typescript
784
+ * const columns = await this.getColumns();
785
+ * if (columns.find(col => col.type === "string" && !col.length)) {
786
+ * // migrate all unbounded strings
787
+ * }
788
+ * ```
789
+ */
790
+ getColumns(): Promise<ColumnDefinition[]>;
791
+ /**
792
+ * List all tables in the current database/connection.
793
+ *
794
+ * @returns Promise resolving to array of table names
795
+ *
796
+ * @example
797
+ * ```typescript
798
+ * const tables = await this.listTables();
799
+ * for (const table of tables) {
800
+ * // process each table
801
+ * }
802
+ * ```
803
+ */
804
+ listTables(): Promise<string[]>;
805
+ /**
806
+ * Get all indexes on the current table.
807
+ */
808
+ getIndexes(): Promise<TableIndexInformation[]>;
809
+ /**
810
+ * Check if a named index exists on the current table.
811
+ */
812
+ hasIndex(indexName: string): Promise<boolean>;
813
+ /**
814
+ * Add a pending index definition.
815
+ *
816
+ * Called by ColumnBuilder when .unique() or .index() is chained.
817
+ * Routes into pendingOperations so indexes execute in definition order
818
+ * alongside columns and constraints.
819
+ *
820
+ * @param index - Index definition
821
+ * @internal
822
+ */
823
+ addPendingIndex(index: IndexDefinition): void;
824
+ /**
825
+ * Add a foreign key operation.
826
+ *
827
+ * Called by ForeignKeyBuilder or ColumnBuilder when .references() is called.
828
+ *
829
+ * @param fk - Foreign key definition
830
+ * @internal
831
+ */
832
+ addForeignKeyOperation(fk: ForeignKeyDefinition): void;
833
+ /**
834
+ * Create the table/collection.
835
+ *
836
+ * For SQL, this creates an empty table.
837
+ * For MongoDB, this creates the collection.
838
+ *
839
+ * @returns This migration for chaining
840
+ */
841
+ createTable(): this;
842
+ /**
843
+ * Create table if not exists
844
+ */
845
+ createTableIfNotExists(): this;
846
+ /**
847
+ * Drop the table/collection.
848
+ *
849
+ * @returns This migration for chaining
850
+ */
851
+ dropTable(): this;
852
+ /**
853
+ * Drop the table/collection if it exists.
854
+ *
855
+ * No error is thrown if the table doesn't exist.
856
+ *
857
+ * @returns This migration for chaining
858
+ */
859
+ dropTableIfExists(): this;
860
+ /**
861
+ * Rename the table/collection.
862
+ *
863
+ * @param newName - New table name
864
+ * @returns This migration for chaining
865
+ */
866
+ renameTableTo(newName: string): this;
867
+ /**
868
+ * Truncate the table — remove all rows without logging or firing triggers.
869
+ *
870
+ * Faster than DELETE with no WHERE clause. Resets auto-increment counters
871
+ * on most databases.
872
+ *
873
+ * @returns This migration for chaining
874
+ */
875
+ truncateTable(): this;
876
+ /**
877
+ * Add a string/varchar column.
878
+ *
879
+ * @param column - Column name
880
+ * @param length - Max length (default: 255)
881
+ * @returns Column builder for chaining modifiers
882
+ *
883
+ * @example
884
+ * ```typescript
885
+ * this.string("name"); // VARCHAR(255)
886
+ * this.string("code", 10); // VARCHAR(10)
887
+ * ```
888
+ */
889
+ string(column: string, length?: number): ColumnBuilder;
890
+ /**
891
+ * Add a fixed-length char column.
892
+ *
893
+ * @param column - Column name
894
+ * @param length - Exact length
895
+ * @returns Column builder for chaining modifiers
896
+ */
897
+ char(column: string, length: number): ColumnBuilder;
898
+ /**
899
+ * Add a text column (unlimited length).
900
+ *
901
+ * @param column - Column name
902
+ * @returns Column builder for chaining modifiers
903
+ */
904
+ text(column: string): ColumnBuilder;
905
+ /**
906
+ * Add a medium text column.
907
+ *
908
+ * @param column - Column name
909
+ * @returns Column builder for chaining modifiers
910
+ */
911
+ mediumText(column: string): ColumnBuilder;
912
+ /**
913
+ * Add a long text column.
914
+ *
915
+ * @param column - Column name
916
+ * @returns Column builder for chaining modifiers
917
+ */
918
+ longText(column: string): ColumnBuilder;
919
+ /**
920
+ * Add an integer column.
921
+ *
922
+ * @param column - Column name
923
+ * @returns Column builder for chaining modifiers
924
+ */
925
+ integer(column: string): ColumnBuilder;
926
+ /**
927
+ * Alias for integer().
928
+ */
929
+ int(column: string): ColumnBuilder;
930
+ /**
931
+ * Add a small integer column.
932
+ *
933
+ * @param column - Column name
934
+ * @returns Column builder for chaining modifiers
935
+ */
936
+ smallInteger(column: string): ColumnBuilder;
937
+ /**
938
+ * Alias for smallInteger().
939
+ */
940
+ smallInt(column: string): ColumnBuilder;
941
+ /**
942
+ * Add a tiny integer column.
943
+ *
944
+ * @param column - Column name
945
+ * @returns Column builder for chaining modifiers
946
+ */
947
+ tinyInteger(column: string): ColumnBuilder;
948
+ /**
949
+ * Alias for tinyInteger().
950
+ */
951
+ tinyInt(column: string): ColumnBuilder;
952
+ /**
953
+ * Add a big integer column.
954
+ *
955
+ * @param column - Column name
956
+ * @returns Column builder for chaining modifiers
957
+ */
958
+ bigInteger(column: string): ColumnBuilder;
959
+ /**
960
+ * Alias for bigInteger().
961
+ */
962
+ bigInt(column: string): ColumnBuilder;
963
+ /**
964
+ * Add a float column.
965
+ *
966
+ * @param column - Column name
967
+ * @returns Column builder for chaining modifiers
968
+ */
969
+ float(column: string): ColumnBuilder;
970
+ /**
971
+ * Add a double precision column.
972
+ *
973
+ * @param column - Column name
974
+ * @returns Column builder for chaining modifiers
975
+ */
976
+ double(column: string): ColumnBuilder;
977
+ /**
978
+ * Add a decimal column with precision and scale.
979
+ *
980
+ * @param column - Column name
981
+ * @param precision - Total digits (default: 8)
982
+ * @param scale - Decimal places (default: 2)
983
+ * @returns Column builder for chaining modifiers
984
+ *
985
+ * @example
986
+ * ```typescript
987
+ * this.decimal("price", 10, 2); // DECIMAL(10,2) - up to 99999999.99
988
+ * ```
989
+ */
990
+ decimal(column: string, precision?: number, scale?: number): ColumnBuilder;
991
+ /**
992
+ * Add a boolean column.
993
+ *
994
+ * @param column - Column name
995
+ * @returns Column builder for chaining modifiers
996
+ */
997
+ boolean(column: string): ColumnBuilder;
998
+ /**
999
+ * Alias for boolean().
1000
+ */
1001
+ bool(column: string): ColumnBuilder;
1002
+ /**
1003
+ * Add a date column (date only, no time).
1004
+ *
1005
+ * @param column - Column name
1006
+ * @returns Column builder for chaining modifiers
1007
+ */
1008
+ date(column: string): ColumnBuilder;
1009
+ /**
1010
+ * Add a datetime column (date and time).
1011
+ *
1012
+ * @param column - Column name
1013
+ * @returns Column builder for chaining modifiers
1014
+ */
1015
+ dateTime(column: string): ColumnBuilder;
1016
+ /**
1017
+ * Add a timestamp column.
1018
+ *
1019
+ * @param column - Column name
1020
+ * @returns Column builder for chaining modifiers
1021
+ */
1022
+ timestamp(column: string): ColumnBuilder;
1023
+ /**
1024
+ * Add a time column (time only, no date).
1025
+ *
1026
+ * @param column - Column name
1027
+ * @returns Column builder for chaining modifiers
1028
+ */
1029
+ time(column: string): ColumnBuilder;
1030
+ /**
1031
+ * Add a year column.
1032
+ *
1033
+ * @param column - Column name
1034
+ * @returns Column builder for chaining modifiers
1035
+ */
1036
+ year(column: string): ColumnBuilder;
1037
+ /**
1038
+ * Add a JSON column.
1039
+ *
1040
+ * @param column - Column name
1041
+ * @returns Column builder for chaining modifiers
1042
+ */
1043
+ json(column: string): ColumnBuilder;
1044
+ /**
1045
+ * Alias for json().
1046
+ */
1047
+ object(column: string): ColumnBuilder;
1048
+ /**
1049
+ * Add a binary/blob column.
1050
+ *
1051
+ * @param column - Column name
1052
+ * @returns Column builder for chaining modifiers
1053
+ */
1054
+ binary(column: string): ColumnBuilder;
1055
+ /**
1056
+ * Alias for binary().
1057
+ */
1058
+ blob(column: string): ColumnBuilder;
1059
+ /**
1060
+ * Add a UUID column.
1061
+ *
1062
+ * @param column - Column name
1063
+ * @returns Column builder for chaining modifiers
1064
+ */
1065
+ uuid(column: string): ColumnBuilder;
1066
+ /**
1067
+ * Add a ULID column.
1068
+ *
1069
+ * @param column - Column name
1070
+ * @returns Column builder for chaining modifiers
1071
+ */
1072
+ ulid(column: string): ColumnBuilder;
1073
+ /**
1074
+ * Add an IP address column.
1075
+ *
1076
+ * @param column - Column name
1077
+ * @returns Column builder for chaining modifiers
1078
+ */
1079
+ ipAddress(column: string): ColumnBuilder;
1080
+ /**
1081
+ * Add a MAC address column.
1082
+ *
1083
+ * @param column - Column name
1084
+ * @returns Column builder for chaining modifiers
1085
+ */
1086
+ macAddress(column: string): ColumnBuilder;
1087
+ /**
1088
+ * Add a geo point column.
1089
+ *
1090
+ * @param column - Column name
1091
+ * @returns Column builder for chaining modifiers
1092
+ */
1093
+ point(column: string): ColumnBuilder;
1094
+ /**
1095
+ * Add a polygon column.
1096
+ *
1097
+ * @param column - Column name
1098
+ * @returns Column builder for chaining modifiers
1099
+ */
1100
+ polygon(column: string): ColumnBuilder;
1101
+ /**
1102
+ * Add a line string column.
1103
+ *
1104
+ * @param column - Column name
1105
+ * @returns Column builder for chaining modifiers
1106
+ */
1107
+ lineString(column: string): ColumnBuilder;
1108
+ /**
1109
+ * Add a generic geometry column.
1110
+ *
1111
+ * @param column - Column name
1112
+ * @returns Column builder for chaining modifiers
1113
+ */
1114
+ geometry(column: string): ColumnBuilder;
1115
+ /**
1116
+ * Add a vector column for AI embeddings.
1117
+ *
1118
+ * Used for storing and searching ML embeddings (e.g., OpenAI, Cohere).
1119
+ *
1120
+ * @param column - Column name
1121
+ * @param dimensions - Vector dimensions (e.g., 1536 for OpenAI ada-002)
1122
+ * @returns Column builder for chaining modifiers
1123
+ *
1124
+ * @example
1125
+ * ```typescript
1126
+ * this.vector("embedding", 1536); // OpenAI ada-002
1127
+ * this.vector("embedding", 384); // Sentence Transformers
1128
+ * ```
1129
+ */
1130
+ vector(column: string, dimensions: number): ColumnBuilder;
1131
+ /**
1132
+ * Add an enum column with allowed values.
1133
+ *
1134
+ * @param column - Column name
1135
+ * @param values - Allowed enum values
1136
+ * @returns Column builder for chaining modifiers
1137
+ *
1138
+ * @example
1139
+ * ```typescript
1140
+ * this.enum("status", ["pending", "active", "archived"]);
1141
+ * ```
1142
+ */
1143
+ enum(column: string, values: string[]): ColumnBuilder;
1144
+ /**
1145
+ * Add a set column (multiple values from a set).
1146
+ *
1147
+ * @param column - Column name
1148
+ * @param values - Allowed set values
1149
+ * @returns Column builder for chaining modifiers
1150
+ */
1151
+ set(column: string, values: string[]): ColumnBuilder;
1152
+ /**
1153
+ * Add an INTEGER[] column (array of integers).
1154
+ *
1155
+ * @example
1156
+ * ```typescript
1157
+ * this.arrayInt("scores"); // INTEGER[]
1158
+ * ```
1159
+ */
1160
+ arrayInt(column: string): ColumnBuilder;
1161
+ /**
1162
+ * Add a BIGINT[] column (array of big integers).
1163
+ *
1164
+ * @example
1165
+ * ```typescript
1166
+ * this.arrayBigInt("ids"); // BIGINT[]
1167
+ * ```
1168
+ */
1169
+ arrayBigInt(column: string): ColumnBuilder;
1170
+ /**
1171
+ * Add a REAL[] column (array of floats).
1172
+ *
1173
+ * @example
1174
+ * ```typescript
1175
+ * this.arrayFloat("weights"); // REAL[]
1176
+ * ```
1177
+ */
1178
+ arrayFloat(column: string): ColumnBuilder;
1179
+ /**
1180
+ * Add a DECIMAL[] column (array of decimals).
1181
+ *
1182
+ * @param precision - Total digits
1183
+ * @param scale - Digits after decimal point
1184
+ *
1185
+ * @example
1186
+ * ```typescript
1187
+ * this.arrayDecimal("prices", 10, 2); // DECIMAL(10,2)[]
1188
+ * this.arrayDecimal("amounts"); // DECIMAL[]
1189
+ * ```
1190
+ */
1191
+ arrayDecimal(column: string, precision?: number, scale?: number): ColumnBuilder;
1192
+ /**
1193
+ * Add a BOOLEAN[] column (array of booleans).
1194
+ *
1195
+ * @example
1196
+ * ```typescript
1197
+ * this.arrayBoolean("flags"); // BOOLEAN[]
1198
+ * ```
1199
+ */
1200
+ arrayBoolean(column: string): ColumnBuilder;
1201
+ /**
1202
+ * Add a TEXT[] column (array of text values).
1203
+ *
1204
+ * @example
1205
+ * ```typescript
1206
+ * this.arrayText("tags"); // TEXT[]
1207
+ * ```
1208
+ */
1209
+ arrayText(column: string): ColumnBuilder;
1210
+ /**
1211
+ * Add a DATE[] column (array of dates).
1212
+ *
1213
+ * @example
1214
+ * ```typescript
1215
+ * this.arrayDate("holidays"); // DATE[]
1216
+ * ```
1217
+ */
1218
+ arrayDate(column: string): ColumnBuilder;
1219
+ /**
1220
+ * Add a TIMESTAMPTZ[] column (array of timestamps with time zone).
1221
+ *
1222
+ * @example
1223
+ * ```typescript
1224
+ * this.arrayTimestamp("events"); // TIMESTAMPTZ[]
1225
+ * ```
1226
+ */
1227
+ arrayTimestamp(column: string): ColumnBuilder;
1228
+ /**
1229
+ * Add a UUID[] column (array of UUIDs).
1230
+ *
1231
+ * @example
1232
+ * ```typescript
1233
+ * this.arrayUuid("relatedIds"); // UUID[]
1234
+ * ```
1235
+ */
1236
+ arrayUuid(column: string): ColumnBuilder;
1237
+ /**
1238
+ * Add a JSONB[] column — array of JSON objects.
1239
+ *
1240
+ * @example
1241
+ * ```typescript
1242
+ * this.arrayJson("metadata"); // JSONB[]
1243
+ * ```
1244
+ */
1245
+ arrayJson(column: string): ColumnBuilder;
1246
+ /**
1247
+ * Add an auto-increment primary key column.
1248
+ *
1249
+ * Creates an unsigned integer with primary key and auto-increment.
1250
+ *
1251
+ * @param name - Column name (default: "id")
1252
+ * @returns Column builder for chaining modifiers
1253
+ *
1254
+ * @example
1255
+ * ```typescript
1256
+ * this.id(); // Creates "id" column
1257
+ * this.id("userId"); // Creates "userId" column
1258
+ * ```
1259
+ */
1260
+ id(name?: string): ColumnBuilder;
1261
+ /**
1262
+ * Add a big integer auto-increment primary key column.
1263
+ *
1264
+ * @param name - Column name (default: "id")
1265
+ * @returns Column builder for chaining modifiers
1266
+ */
1267
+ bigId(name?: string): ColumnBuilder;
1268
+ /**
1269
+ * Add a UUID primary key column.
1270
+ *
1271
+ * @param name - Column name (default: "id")
1272
+ * @returns Column builder for chaining modifiers
1273
+ */
1274
+ uuidId(name?: string): ColumnBuilder;
1275
+ /**
1276
+ * Add a UUID primary key column with automatic generation.
1277
+ *
1278
+ * Delegates UUID expression to the migration driver, which resolves
1279
+ * the default based on `migrationDefaults` from the DataSource config.
1280
+ *
1281
+ * Resolution order:
1282
+ * 1. `migrationDefaults.uuidExpression` (raw escape hatch)
1283
+ * 2. `migrationDefaults.uuidStrategy` (mapped per driver)
1284
+ * 3. Driver default (PostgreSQL: `gen_random_uuid()`, MongoDB: undefined)
1285
+ *
1286
+ * @param name - Column name (default: "id")
1287
+ * @returns Column builder for chaining modifiers
1288
+ *
1289
+ * @example
1290
+ * ```typescript
1291
+ * this.primaryUuid(); // id UUID PRIMARY KEY DEFAULT gen_random_uuid()
1292
+ * this.primaryUuid("organization_id"); // Custom column name
1293
+ * ```
1294
+ */
1295
+ primaryUuid(name?: string): ColumnBuilder;
1296
+ /**
1297
+ * Add createdAt and updatedAt timestamp columns.
1298
+ *
1299
+ * Behavior varies by database driver:
1300
+ * - PostgreSQL: Creates TIMESTAMPTZ columns with NOW() defaults
1301
+ * - MongoDB: No-op (timestamps handled at application level)
1302
+ *
1303
+ * @returns This migration for chaining
1304
+ *
1305
+ * @example
1306
+ * ```typescript
1307
+ * this.timestamps(); // Driver-specific implementation
1308
+ * ```
1309
+ */
1310
+ timestamps(): this;
1311
+ /**
1312
+ * Add a deletedAt column for soft deletes.
1313
+ *
1314
+ * @param column - Column name (default: "deletedAt")
1315
+ * @returns Column builder for chaining modifiers
1316
+ */
1317
+ softDeletes(column?: string): ColumnBuilder;
1318
+ /**
1319
+ * Drop a column.
1320
+ *
1321
+ * @param column - Column name to drop
1322
+ * @returns This migration for chaining
1323
+ */
1324
+ dropColumn(column: string): this;
1325
+ /**
1326
+ * Drop multiple columns.
1327
+ *
1328
+ * @param columns - Column names to drop
1329
+ * @returns This migration for chaining
1330
+ */
1331
+ dropColumns(...columns: string[]): this;
1332
+ /**
1333
+ * Rename a column.
1334
+ *
1335
+ * @param from - Current column name
1336
+ * @param to - New column name
1337
+ * @returns This migration for chaining
1338
+ */
1339
+ renameColumn(from: string, to: string): this;
1340
+ /**
1341
+ * Create an index on one or more columns.
1342
+ *
1343
+ * @param columns - Column(s) to index
1344
+ * @param name - Optional index name
1345
+ * @param options - Optional index options (include, concurrently)
1346
+ * @returns This migration for chaining
1347
+ *
1348
+ * @example
1349
+ * ```typescript
1350
+ * this.index("email");
1351
+ * this.index(["firstName", "lastName"], "name_idx");
1352
+ * this.index("userId", "idx_user", { include: ["name", "email"] });
1353
+ * this.index("email", "idx_email", { concurrently: true });
1354
+ * ```
1355
+ */
1356
+ index(columns: string | string[], name?: string, options?: {
1357
+ include?: string[];
1358
+ concurrently?: boolean;
1359
+ }): this;
1360
+ /**
1361
+ * Drop an index by name or columns.
1362
+ *
1363
+ * @param nameOrColumns - Index name (string) or columns array
1364
+ * @returns This migration for chaining
1365
+ *
1366
+ * @example
1367
+ * ```typescript
1368
+ * this.dropIndex("email_idx"); // Drop by name
1369
+ * this.dropIndex(["firstName", "lastName"]); // Drop by columns
1370
+ * ```
1371
+ */
1372
+ dropIndex(nameOrColumns: string | string[]): this;
1373
+ /**
1374
+ * Create a unique constraint/index.
1375
+ *
1376
+ * @param columns - Column(s) to make unique
1377
+ * @param name - Optional constraint name
1378
+ * @param options - Optional index options (include, concurrently)
1379
+ * @returns This migration for chaining
1380
+ *
1381
+ * @example
1382
+ * ```typescript
1383
+ * this.unique("email");
1384
+ * this.unique(["userId", "roleId"], "unique_user_role");
1385
+ * this.unique("email", "unique_email", { include: ["name"] });
1386
+ * ```
1387
+ */
1388
+ unique(columns: string | string[], name?: string, options?: {
1389
+ include?: string[];
1390
+ concurrently?: boolean;
1391
+ }): this;
1392
+ /**
1393
+ * Drop a unique constraint/index.
1394
+ *
1395
+ * @param columns - Columns in the unique constraint
1396
+ * @returns This migration for chaining
1397
+ */
1398
+ dropUnique(columns: string | string[]): this;
1399
+ /**
1400
+ * Create an expression-based index.
1401
+ *
1402
+ * Allows indexing on SQL expressions rather than plain columns.
1403
+ * Useful for case-insensitive searches, computed values, etc.
1404
+ *
1405
+ * **Note**: PostgreSQL-specific feature. MongoDB will silently ignore this.
1406
+ *
1407
+ * @param expressions - SQL expression(s) to index
1408
+ * @param name - Optional index name
1409
+ * @param options - Optional index options (concurrently)
1410
+ * @returns This migration for chaining
1411
+ *
1412
+ * @example
1413
+ * ```typescript
1414
+ * // Case-insensitive email index
1415
+ * this.expressionIndex(['lower(email)'], 'idx_email_lower');
1416
+ *
1417
+ * // Multiple expressions
1418
+ * this.expressionIndex(['lower(firstName)', 'lower(lastName)'], 'idx_name_lower');
1419
+ *
1420
+ * // With concurrent creation (requires transactional = false)
1421
+ * this.expressionIndex(['lower(email)'], 'idx_email_lower', { concurrently: true });
1422
+ * ```
1423
+ */
1424
+ expressionIndex(expressions: string | string[], name?: string, options?: {
1425
+ concurrently?: boolean;
1426
+ }): this;
1427
+ /**
1428
+ * Create a full-text search index.
1429
+ *
1430
+ * @param columns - Column(s) to index
1431
+ * @param options - Full-text options
1432
+ * @returns This migration for chaining
1433
+ */
1434
+ fullText(columns: string | string[], options?: FullTextIndexOptions): this;
1435
+ /**
1436
+ * Drop a full-text search index.
1437
+ *
1438
+ * @param name - Index name
1439
+ * @returns This migration for chaining
1440
+ */
1441
+ dropFullText(name: string): this;
1442
+ /**
1443
+ * Create a geo-spatial index.
1444
+ *
1445
+ * @param column - Geo column
1446
+ * @param options - Geo index options
1447
+ * @returns This migration for chaining
1448
+ *
1449
+ * @example
1450
+ * ```typescript
1451
+ * this.geoIndex("location"); // 2dsphere index
1452
+ * this.geoIndex("coordinates", { type: "2d" }); // 2d index
1453
+ * ```
1454
+ */
1455
+ geoIndex(column: string, options?: GeoIndexOptions): this;
1456
+ /**
1457
+ * Drop a geo-spatial index.
1458
+ *
1459
+ * @param column - Geo column
1460
+ * @returns This migration for chaining
1461
+ */
1462
+ dropGeoIndex(column: string): this;
1463
+ /**
1464
+ * Create a vector search index for AI embeddings.
1465
+ *
1466
+ * @param column - Vector column
1467
+ * @param options - Vector index options
1468
+ * @returns This migration for chaining
1469
+ *
1470
+ * @example
1471
+ * ```typescript
1472
+ * this.vectorIndex("embedding", {
1473
+ * dimensions: 1536,
1474
+ * similarity: "cosine",
1475
+ * });
1476
+ * ```
1477
+ */
1478
+ vectorIndex(column: string, options: VectorIndexOptions): this;
1479
+ /**
1480
+ * Drop a vector search index.
1481
+ *
1482
+ * @param column - Vector column
1483
+ * @returns This migration for chaining
1484
+ */
1485
+ dropVectorIndex(column: string): this;
1486
+ /**
1487
+ * Create a TTL (time-to-live) index for automatic document expiration.
1488
+ *
1489
+ * Primarily for MongoDB. Documents are automatically deleted after the
1490
+ * specified time has passed since the date in the column.
1491
+ *
1492
+ * @param column - Date column to check for expiration
1493
+ * @param expireAfterSeconds - Seconds after which documents expire
1494
+ * @returns This migration for chaining
1495
+ *
1496
+ * @example
1497
+ * ```typescript
1498
+ * // Delete sessions 24 hours after createdAt
1499
+ * this.ttlIndex("createdAt", 86400);
1500
+ * ```
1501
+ */
1502
+ ttlIndex(column: string, expireAfterSeconds: number): this;
1503
+ /**
1504
+ * Drop a TTL index.
1505
+ *
1506
+ * @param column - Column with TTL
1507
+ * @returns This migration for chaining
1508
+ */
1509
+ dropTTLIndex(column: string): this;
1510
+ /**
1511
+ * Add a composite primary key.
1512
+ *
1513
+ * @param columns - Columns to include in the primary key
1514
+ * @returns This migration for chaining
1515
+ */
1516
+ primaryKey(columns: string[]): this;
1517
+ /**
1518
+ * Drop the primary key constraint.
1519
+ *
1520
+ * @returns This migration for chaining
1521
+ */
1522
+ dropPrimaryKey(): this;
1523
+ /**
1524
+ * Add a CHECK constraint to the table.
1525
+ *
1526
+ * SQL-only feature. PostgreSQL, MySQL 8.0+, SQLite support this.
1527
+ * Validates that rows satisfy the given SQL expression.
1528
+ *
1529
+ * @param name - Constraint name
1530
+ * @param expression - SQL CHECK expression
1531
+ * @returns This migration for chaining
1532
+ *
1533
+ * @example
1534
+ * ```typescript
1535
+ * this.check("age_positive", "age >= 0");
1536
+ * this.check("valid_email", "email LIKE '%@%'");
1537
+ * this.check("price_range", "price BETWEEN 0 AND 1000000");
1538
+ * ```
1539
+ */
1540
+ check(name: string, expression: string): this;
1541
+ /**
1542
+ * Drop a CHECK constraint by name.
1543
+ *
1544
+ * @param name - Constraint name
1545
+ * @returns This migration for chaining
1546
+ *
1547
+ * @example
1548
+ * ```typescript
1549
+ * this.dropCheck("age_positive");
1550
+ * ```
1551
+ */
1552
+ dropCheck(name: string): this;
1553
+ /**
1554
+ * Start building a foreign key constraint on an existing column.
1555
+ *
1556
+ * Use this when adding a foreign key to a column that was defined in a
1557
+ * previous migration. For new columns, prefer the inline form:
1558
+ * `this.integer("user_id").references("users").onDelete("cascade")`
1559
+ *
1560
+ * SQL-only feature; NoSQL drivers ignore foreign keys.
1561
+ *
1562
+ * @param column - Local column that references another table
1563
+ * @returns Foreign key builder for chaining
1564
+ *
1565
+ * @example
1566
+ * ```typescript
1567
+ * this.foreign("user_id")
1568
+ * .references("users", "id")
1569
+ * .onDelete("cascade");
1570
+ * ```
1571
+ */
1572
+ foreign(column: string): ForeignKeyBuilder;
1573
+ /**
1574
+ * Drop a foreign key constraint.
1575
+ *
1576
+ * Two calling forms:
1577
+ *
1578
+ * 1. Auto-compute the name (matches what `addForeignKey` generates):
1579
+ * ```typescript
1580
+ * this.dropForeign("unit_id", Unit.table);
1581
+ * // → drops: fk_{table}_unit_id_units
1582
+ * ```
1583
+ *
1584
+ * 2. Raw constraint name (use when the name was set explicitly):
1585
+ * ```typescript
1586
+ * this.dropForeign("my_custom_fk_name");
1587
+ * ```
1588
+ *
1589
+ * @param columnOrConstraint - Column name (auto mode) or raw constraint name (raw mode)
1590
+ * @param referencesTable - Referenced table name; triggers auto-name computation when provided
1591
+ * @returns This migration for chaining
1592
+ */
1593
+ dropForeign(columnOrConstraint: string, referencesTable?: string): this;
1594
+ /**
1595
+ * Set JSON schema validation rules on the collection.
1596
+ *
1597
+ * MongoDB-only feature. SQL databases ignore this.
1598
+ *
1599
+ * @param schema - JSON Schema object
1600
+ * @returns This migration for chaining
1601
+ *
1602
+ * @example
1603
+ * ```typescript
1604
+ * this.schemaValidation({
1605
+ * bsonType: "object",
1606
+ * required: ["name", "email"],
1607
+ * properties: {
1608
+ * name: { bsonType: "string" },
1609
+ * email: { bsonType: "string" },
1610
+ * },
1611
+ * });
1612
+ * ```
1613
+ */
1614
+ schemaValidation(schema: object): this;
1615
+ /**
1616
+ * Remove schema validation rules from the collection.
1617
+ *
1618
+ * @returns This migration for chaining
1619
+ */
1620
+ dropSchemaValidation(): this;
1621
+ /**
1622
+ * Execute raw operations with direct driver/connection access.
1623
+ *
1624
+ * Use this when you need to bypass the migration API entirely and
1625
+ * interact with the native database driver directly.
1626
+ *
1627
+ * @param callback - Callback receiving the native connection
1628
+ * @returns Result from callback
1629
+ *
1630
+ * @example
1631
+ * ```typescript
1632
+ * await this.withConnection(async (db) => {
1633
+ * await db.collection("users").updateMany({}, { $set: { active: true } });
1634
+ * });
1635
+ * ```
1636
+ */
1637
+ withConnection<T>(callback: (connection: unknown) => Promise<T>): Promise<T>;
1638
+ /**
1639
+ * Queue a raw SQL string for execution within the migration.
1640
+ *
1641
+ * The statement is queued and executed in order with other migration
1642
+ * operations, within the transaction context if the migration is transactional.
1643
+ *
1644
+ * Use `withConnection()` instead if you need direct driver access.
1645
+ *
1646
+ * Works with PostgreSQL, MySQL, etc. For MongoDB, uses $eval command.
1647
+ *
1648
+ * @param sql - SQL statement to execute
1649
+ * @returns This migration for chaining
1650
+ *
1651
+ * @example
1652
+ * ```typescript
1653
+ * // Enable PostgreSQL extension
1654
+ * this.raw('CREATE EXTENSION IF NOT EXISTS "uuid-ossp"');
1655
+ *
1656
+ * // Create custom type
1657
+ * this.raw('CREATE TYPE mood AS ENUM (\'happy\', \'sad\', \'neutral\')');
1658
+ * ```
1659
+ */
1660
+ raw(sql: string): this;
1661
+ /**
1662
+ * Create a declarative initial-table migration.
1663
+ * Implemented and assigned below the class body.
1664
+ */
1665
+ static create: (model: ChildModel<Model<any>>, columns: ColumnMap, options?: MigrationCreateOptions) => MigrationConstructor;
1666
+ /**
1667
+ * Create a declarative alteration migration.
1668
+ * Implemented and assigned below the class body.
1669
+ */
1670
+ static alter: (model: ChildModel<Model<any>>, schema: AlterSchema, options?: MigrationAlterOptions) => MigrationConstructor;
1671
+ }
1672
+ declare function migrate(model: ChildModel<Model<any>>, options?: {
1673
+ createdAt?: string;
1674
+ name?: string;
1675
+ up?: (this: MigrationContract) => void | Promise<void>;
1676
+ down?: (this: MigrationContract) => void | Promise<void>;
1677
+ transactional?: boolean;
1678
+ }): MigrationConstructor;
1679
+ /**
1680
+ * A single composite index entry for `Migration.create()` options.
1681
+ *
1682
+ * @example
1683
+ * ```typescript
1684
+ * // Simple — columns only, name and type auto-resolved
1685
+ * { columns: ["organization_id", "content_type"] }
1686
+ *
1687
+ * // Named
1688
+ * { columns: ["organization_id", "content_type"], name: "idx_org_content" }
1689
+ *
1690
+ * // Typed (PostgreSQL)
1691
+ * { columns: ["embedding"], using: "ivfflat" }
1692
+ * ```
1693
+ */
1694
+ type IndexEntry = {
1695
+ /** Column(s) to include in the index. */columns: string | string[]; /** Optional explicit index name. Auto-generated when omitted. */
1696
+ name?: string;
1697
+ /**
1698
+ * Index access method (PostgreSQL).
1699
+ * Defaults to `"btree"` when omitted.
1700
+ */
1701
+ using?: "btree" | "hash" | "gin" | "gist" | "brin" | "ivfflat" | "hnsw" | (string & {}); /** Extra columns to include in a covering index (PostgreSQL `INCLUDE`). */
1702
+ include?: string[]; /** Build the index without locking the table (PostgreSQL). */
1703
+ concurrently?: boolean;
1704
+ };
1705
+ /**
1706
+ * A single composite unique constraint entry for `Migration.create()` options.
1707
+ *
1708
+ * @example
1709
+ * ```typescript
1710
+ * // Simple
1711
+ * { columns: ["organization_id", "email"] }
1712
+ *
1713
+ * // Named — useful when you need to reference it in a future ALTER
1714
+ * { columns: ["org_id", "content_id", "lang"], name: "uq_summary_idempotency" }
1715
+ * ```
1716
+ */
1717
+ type UniqueEntry = {
1718
+ /** Column(s) that must be unique together. */columns: string | string[]; /** Optional explicit constraint name. Auto-generated when omitted. */
1719
+ name?: string; /** Extra columns to include (PostgreSQL covering unique index). */
1720
+ include?: string[]; /** Build the constraint without locking the table (PostgreSQL). */
1721
+ concurrently?: boolean;
1722
+ };
1723
+ /**
1724
+ * Options accepted by `Migration.create()`.
1725
+ */
1726
+ type MigrationCreateOptions = {
1727
+ /**
1728
+ * Sort order override.
1729
+ * @default 0
1730
+ */
1731
+ order?: number;
1732
+ /**
1733
+ * ISO timestamp override for migration ordering.
1734
+ * Normally extracted from the filename by the runner.
1735
+ */
1736
+ createdAt?: string;
1737
+ /**
1738
+ * Override the primary key type for this migration only.
1739
+ *
1740
+ * - `"uuid"` — UUID primary key (uses `primaryUuid()`)
1741
+ * - `"int"` — Auto-increment integer (uses `id()`)
1742
+ * - `"bigInt"` — Big auto-increment integer (uses `bigId()`)
1743
+ * - `false` — Skip primary key generation entirely
1744
+ *
1745
+ * When omitted, falls back to `migrationDefaults.primaryKey` from the
1746
+ * DataSource config, then to `"int"` as the framework default.
1747
+ */
1748
+ primaryKey?: "uuid" | "int" | "bigInt" | false;
1749
+ /**
1750
+ * Whether to add `timestamps()` (created_at / updated_at).
1751
+ * @default true
1752
+ */
1753
+ timestamps?: boolean;
1754
+ /**
1755
+ * Whether to wrap this migration in a transaction.
1756
+ * Falls back to DataSource / driver defaults when omitted.
1757
+ */
1758
+ transactional?: boolean;
1759
+ /**
1760
+ * Composite indexes to create on the table.
1761
+ *
1762
+ * Use this for multi-column indexes. Single-column indexes should be
1763
+ * defined at the column level via `.index()`.
1764
+ *
1765
+ * @example
1766
+ * ```typescript
1767
+ * index: [
1768
+ * { columns: ["organization_id", "content_type", "content_id"] },
1769
+ * { columns: ["organization_id", "status"], name: "idx_org_status" },
1770
+ * ]
1771
+ * ```
1772
+ */
1773
+ index?: IndexEntry[];
1774
+ /**
1775
+ * Composite unique constraints to create on the table.
1776
+ *
1777
+ * Use this for multi-column uniqueness. Single-column unique constraints
1778
+ * should be defined at the column level via `.unique()`.
1779
+ *
1780
+ * @example
1781
+ * ```typescript
1782
+ * unique: [
1783
+ * {
1784
+ * columns: ["organization_id", "content_id", "content_language"],
1785
+ * name: "uq_summary_idempotency",
1786
+ * },
1787
+ * ]
1788
+ * ```
1789
+ */
1790
+ unique?: UniqueEntry[];
1791
+ /**
1792
+ * Custom logic to execute after the declarative definitions.
1793
+ * Useful for data seeding or raw SQL following table creation.
1794
+ */
1795
+ up?: (this: Migration) => void | Promise<void>;
1796
+ /**
1797
+ * Raw SQL queries to run before the custom `up` logic.
1798
+ * Useful for triggering statements or custom constraints.
1799
+ */
1800
+ raw?: string | string[];
1801
+ /**
1802
+ * Custom rollback logic to execute before the default `dropTableIfExists`.
1803
+ */
1804
+ down?: (this: Migration) => void | Promise<void>;
1805
+ };
1806
+ /**
1807
+ * Column map accepted by `Migration.create()` and `Migration.alter()`.
1808
+ *
1809
+ * Keys become the column names; values are `DetachedColumnBuilder` instances
1810
+ * produced by the standalone column helpers (`uuid()`, `text()`, etc.).
1811
+ */
1812
+ type ColumnMap = Record<string, DetachedColumnBuilder>;
1813
+ /**
1814
+ * Options accepted by `Migration.alter()`.
1815
+ */
1816
+ type MigrationAlterOptions = {
1817
+ /** Sort order override. */order?: number; /** ISO timestamp override. */
1818
+ createdAt?: string; /** Whether to wrap in a transaction. */
1819
+ transactional?: boolean;
1820
+ /**
1821
+ * Custom logic to execute after the declarative definitions.
1822
+ */
1823
+ up?: (this: Migration) => void | Promise<void>;
1824
+ /**
1825
+ * Custom rollback logic to execute on rollback.
1826
+ * Unlike `create()`, `alter()` does not auto-infer rollbacks.
1827
+ */
1828
+ down?: (this: Migration) => void | Promise<void>;
1829
+ };
1830
+ /**
1831
+ * Schema map passed to `Migration.alter()`.
1832
+ *
1833
+ * Groups all table-level DDL operations by intent.
1834
+ * Any key can be omitted when not needed.
1835
+ *
1836
+ * @example
1837
+ * ```typescript
1838
+ * export default Migration.alter(User, {
1839
+ * // Column operations
1840
+ * add: { phone: text().nullable() },
1841
+ * drop: ["legacy_column"],
1842
+ * rename: { old_name: "new_name" },
1843
+ * modify: { email: string(320).notNullable() },
1844
+ *
1845
+ * // Index / constraint operations
1846
+ * addIndex: [{ columns: ["first_name", "last_name"] }],
1847
+ * addUnique: [{ columns: ["email"] }],
1848
+ * addForeign: [{ column: "team_id", references: Team }],
1849
+ * dropIndexes: ["old_idx_name"],
1850
+ * dropUnique: [["email"]],
1851
+ * });
1852
+ * ```
1853
+ */
1854
+ type AlterSchema = {
1855
+ /** Columns to add. Keys become column names. */add?: ColumnMap; /** Column names to drop. */
1856
+ drop?: string[]; /** Rename map: `{ oldName: newName }`. */
1857
+ rename?: Record<string, string>; /** Columns to modify. Keys become column names. */
1858
+ modify?: ColumnMap;
1859
+ /**
1860
+ * Regular indexes to add.
1861
+ *
1862
+ * @example
1863
+ * ```typescript
1864
+ * addIndex: [
1865
+ * { columns: "email" },
1866
+ * { columns: ["first_name", "last_name"], name: "idx_full_name" },
1867
+ * { columns: "email", options: { concurrently: true } },
1868
+ * ]
1869
+ * ```
1870
+ */
1871
+ addIndex?: Array<{
1872
+ columns: string | string[];
1873
+ name?: string;
1874
+ options?: {
1875
+ include?: string[];
1876
+ concurrently?: boolean;
1877
+ };
1878
+ }>;
1879
+ /**
1880
+ * Indexes to drop (by name or columns array).
1881
+ *
1882
+ * @example
1883
+ * ```typescript
1884
+ * dropIndex: ["idx_old_name", ["first_name", "last_name"]]
1885
+ * ```
1886
+ */
1887
+ dropIndex?: Array<string | string[]>;
1888
+ /**
1889
+ * Unique constraints / indexes to add.
1890
+ *
1891
+ * @example
1892
+ * ```typescript
1893
+ * addUnique: [{ columns: "email" }]
1894
+ * ```
1895
+ */
1896
+ addUnique?: Array<{
1897
+ columns: string | string[];
1898
+ name?: string;
1899
+ options?: {
1900
+ include?: string[];
1901
+ concurrently?: boolean;
1902
+ };
1903
+ }>;
1904
+ /**
1905
+ * Unique constraints to drop (by columns array).
1906
+ *
1907
+ * @example
1908
+ * ```typescript
1909
+ * dropUnique: [["email"], ["phone"]]
1910
+ * ```
1911
+ */
1912
+ dropUnique?: Array<string | string[]>;
1913
+ /**
1914
+ * Expression-based indexes to add (PostgreSQL-specific).
1915
+ *
1916
+ * @example
1917
+ * ```typescript
1918
+ * addExpressionIndex: [
1919
+ * { expressions: "lower(email)", name: "idx_email_lower" },
1920
+ * ]
1921
+ * ```
1922
+ */
1923
+ addExpressionIndex?: Array<{
1924
+ expressions: string | string[];
1925
+ name?: string;
1926
+ options?: {
1927
+ concurrently?: boolean;
1928
+ };
1929
+ }>;
1930
+ /**
1931
+ * Full-text search indexes to add.
1932
+ *
1933
+ * @example
1934
+ * ```typescript
1935
+ * addFullText: [{ columns: ["title", "body"] }]
1936
+ * ```
1937
+ */
1938
+ addFullText?: Array<{
1939
+ columns: string | string[];
1940
+ options?: FullTextIndexOptions;
1941
+ }>; /** Full-text indexes to drop (by name). */
1942
+ dropFullText?: string[];
1943
+ /**
1944
+ * Geo-spatial indexes to add.
1945
+ *
1946
+ * @example
1947
+ * ```typescript
1948
+ * addGeoIndex: [{ column: "location" }]
1949
+ * ```
1950
+ */
1951
+ addGeoIndex?: Array<{
1952
+ column: string;
1953
+ options?: GeoIndexOptions;
1954
+ }>; /** Geo indexes to drop (by column name). */
1955
+ dropGeoIndex?: string[];
1956
+ /**
1957
+ * Vector search indexes to add.
1958
+ *
1959
+ * @example
1960
+ * ```typescript
1961
+ * addVectorIndex: [{ column: "embedding", options: { dimensions: 1536, similarity: "cosine" } }]
1962
+ * ```
1963
+ */
1964
+ addVectorIndex?: Array<{
1965
+ column: string;
1966
+ options: VectorIndexOptions;
1967
+ }>; /** Vector indexes to drop (by column name). */
1968
+ dropVectorIndex?: string[];
1969
+ /**
1970
+ * TTL indexes to add (MongoDB-primary).
1971
+ *
1972
+ * @example
1973
+ * ```typescript
1974
+ * addTTLIndex: [{ column: "created_at", expireAfterSeconds: 86400 }]
1975
+ * ```
1976
+ */
1977
+ addTTLIndex?: Array<{
1978
+ column: string;
1979
+ expireAfterSeconds: number;
1980
+ }>; /** TTL indexes to drop (by column name). */
1981
+ dropTTLIndex?: string[];
1982
+ /**
1983
+ * Foreign keys to add to existing columns.
1984
+ *
1985
+ * Accepts a Model class or a raw table-name string for `references`.
1986
+ *
1987
+ * @example
1988
+ * ```typescript
1989
+ * addForeign: [
1990
+ * { column: "team_id", references: Team, onDelete: "cascade" },
1991
+ * { column: "owner_id", references: "users", on: "id", onDelete: "setNull" },
1992
+ * ]
1993
+ * ```
1994
+ */
1995
+ addForeign?: Array<{
1996
+ column: string;
1997
+ references: string | {
1998
+ table: string;
1999
+ };
2000
+ on?: string;
2001
+ onDelete?: "cascade" | "restrict" | "setNull" | "noAction";
2002
+ onUpdate?: "cascade" | "restrict" | "setNull" | "noAction";
2003
+ }>;
2004
+ /**
2005
+ * Foreign keys to drop.
2006
+ *
2007
+ * Two forms:
2008
+ * - `{ columnOrConstraint: "team_id", referencesTable: "teams" }` → auto-name resolution
2009
+ * - `{ columnOrConstraint: "fk_my_custom_name" }` → raw constraint name
2010
+ */
2011
+ dropForeign?: Array<{
2012
+ columnOrConstraint: string;
2013
+ referencesTable?: string;
2014
+ }>;
2015
+ /**
2016
+ * CHECK constraints to add.
2017
+ *
2018
+ * @example
2019
+ * ```typescript
2020
+ * addCheck: [{ name: "age_positive", expression: "age >= 0" }]
2021
+ * ```
2022
+ */
2023
+ addCheck?: Array<{
2024
+ name: string;
2025
+ expression: string;
2026
+ }>; /** CHECK constraints to drop (by name). */
2027
+ dropCheck?: string[];
2028
+ /**
2029
+ * Raw SQL queries to execute as part of this alter operation.
2030
+ */
2031
+ raw?: string | string[];
2032
+ };
2033
+ //#endregion
2034
+ export { AlterSchema, ColumnMap, IndexEntry, Migration, MigrationAlterOptions, MigrationConstructor, MigrationContract, MigrationCreateOptions, OperationType, PendingOperation, UniqueEntry, migrate };
2035
+ //# sourceMappingURL=migration.d.mts.map