appos 0.3.5-0 → 0.3.6-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/dist/bin/main.mjs +2 -2
  2. package/dist/exports/api/adapter-C2mMJKvG.mjs +1504 -0
  3. package/dist/exports/api/{auth-schema.mjs → auth-schema-CON4yFFY.mjs} +2 -3
  4. package/dist/exports/api/bun-sqlite-dialect-CPpPZa23.mjs +155 -0
  5. package/dist/exports/{cli/_virtual/rolldown_runtime.mjs → api/chunk-CyXqrcp_.mjs} +14 -1
  6. package/dist/exports/api/conditions-DjBAWfiK.mjs +116 -0
  7. package/dist/exports/api/dialect-CUUD24Ge.mjs +72 -0
  8. package/dist/exports/api/env-CwT3zhez.mjs +1 -0
  9. package/dist/exports/api/esm-_hkVMulx.mjs +15816 -0
  10. package/dist/exports/api/event-BHFSE6hY.mjs +20983 -0
  11. package/dist/exports/api/extract-blob-metadata-BMgUEPcW.mjs +4 -0
  12. package/dist/exports/api/extract-blob-metadata-_9RUEwoU.mjs +9818 -0
  13. package/dist/exports/api/generate-image-variant-DOIzj1wJ.mjs +4 -0
  14. package/dist/exports/api/generate-image-variant-DxOPoGAk.mjs +118 -0
  15. package/dist/exports/api/generate-preview-CvTFuq58.mjs +160 -0
  16. package/dist/exports/api/generate-preview-Dk3coswZ.mjs +4 -0
  17. package/dist/exports/api/index.d.mts +7347 -20
  18. package/dist/exports/api/index.mjs +146856 -18
  19. package/dist/exports/api/kysely-adapter-CmP2TbkS.mjs +296 -0
  20. package/dist/exports/api/memory-adapter-BzhRhLFK.mjs +212 -0
  21. package/dist/exports/api/node-sqlite-dialect-Bl5suBxl.mjs +155 -0
  22. package/dist/exports/api/orm-CMqufD21.mjs +153690 -0
  23. package/dist/exports/api/orm-DXqYuKvB.d.mts +11 -0
  24. package/dist/exports/api/orm.d.mts +2 -11
  25. package/dist/exports/api/orm.mjs +4 -42
  26. package/dist/exports/api/pdf-YxB2Hm1p.mjs +25822 -0
  27. package/dist/exports/api/purge-attachment-Cf6KH2Jv.mjs +34 -0
  28. package/dist/exports/api/purge-attachment-DIuil7ps.mjs +4 -0
  29. package/dist/exports/{cli/api/workflows/purge-audit-logs.mjs → api/purge-audit-logs-z6j_Pu47.mjs} +3 -3
  30. package/dist/exports/{cli/api/workflows/purge-unattached-blobs.mjs → api/purge-unattached-blobs-B0TfY5Hk.mjs} +1 -1
  31. package/dist/exports/api/react-BYhV5bYt.mjs +1131 -0
  32. package/dist/exports/api/server.node-DyVrQ6cz.mjs +19298 -0
  33. package/dist/exports/api/table-6bTIEqON.mjs +2636 -0
  34. package/dist/exports/api/{workflows/track-db-changes.mjs → track-db-changes-BysaV6nN.mjs} +14 -14
  35. package/dist/exports/api/{workflow.mjs → workflow-BuSWHcX-.mjs} +121 -10
  36. package/dist/exports/api/workflows/auth-schema-BFve3hgZ.mjs +2813 -0
  37. package/dist/exports/api/{_virtual/rolldown_runtime.mjs → workflows/chunk-B36mNPO4.mjs} +5 -1
  38. package/dist/exports/api/workflows/extract-blob-metadata-BcWKvY2K.mjs +9818 -0
  39. package/dist/exports/api/workflows/{generate-image-variant.mjs → generate-image-variant-BAFvL_zV.mjs} +20 -20
  40. package/dist/exports/{cli/api/workflows/generate-preview.mjs → api/workflows/generate-preview-BjlIVYYp.mjs} +6 -6
  41. package/dist/exports/api/workflows/index.d.mts +2011 -1
  42. package/dist/exports/api/workflows/index.mjs +2 -1
  43. package/dist/exports/api/workflows/pdf-DUB8zyIc.mjs +25822 -0
  44. package/dist/exports/{cli/api/workflows/purge-attachment.mjs → api/workflows/purge-attachment-k_sdxTPY.mjs} +3 -3
  45. package/dist/exports/api/workflows/{purge-audit-logs.mjs → purge-audit-logs-zCyWj4Mw.mjs} +12 -3
  46. package/dist/exports/api/workflows/{purge-unattached-blobs.mjs → purge-unattached-blobs-CdsuFAeW.mjs} +1 -1
  47. package/dist/exports/api/workflows/track-db-changes-CiKaI9gT.mjs +20943 -0
  48. package/dist/exports/api/workflows/track-db-changes-DEWQYryO.mjs +4 -0
  49. package/dist/exports/{cli/api/workflow.mjs → api/workflows/workflow-BjM2xCa6.mjs} +23 -3
  50. package/dist/exports/api/workflows/zod-Br0enFWK.mjs +12333 -0
  51. package/dist/exports/api/zod-CdrJdBtV.mjs +12571 -0
  52. package/dist/exports/cli/auth-schema-CNuOqPi-.mjs +2813 -0
  53. package/dist/exports/{api/workflows/_virtual/rolldown_runtime.mjs → cli/chunk-B36mNPO4.mjs} +5 -1
  54. package/dist/exports/cli/extract-blob-metadata-CV1Ke90d.mjs +9818 -0
  55. package/dist/exports/cli/{api/workflows/generate-image-variant.mjs → generate-image-variant-CM1BrVvZ.mjs} +20 -20
  56. package/dist/exports/{api/workflows/generate-preview.mjs → cli/generate-preview-DdHQ3ukz.mjs} +6 -6
  57. package/dist/exports/cli/index.d.mts +2142 -2
  58. package/dist/exports/cli/index.mjs +41 -1
  59. package/dist/exports/cli/pdf-CLUPEIdT.mjs +25822 -0
  60. package/dist/exports/{api/workflows/purge-attachment.mjs → cli/purge-attachment-Dc_J74dG.mjs} +3 -3
  61. package/dist/exports/cli/purge-audit-logs-DFhWh-Bx.mjs +56 -0
  62. package/dist/exports/cli/purge-unattached-blobs-C1MRlM_2.mjs +46 -0
  63. package/dist/exports/cli/track-db-changes-CfneOF2_.mjs +20943 -0
  64. package/dist/exports/{api/workflows/api/workflow.mjs → cli/workflow-DSbbXBMt.mjs} +23 -3
  65. package/dist/exports/cli/zod-7q0_Mtnn.mjs +12333 -0
  66. package/dist/exports/devtools/BaseTanStackRouterDevtoolsPanel-BBz1qLry-DUwdvyLv.js +2090 -0
  67. package/dist/exports/devtools/EIDV623S-B7f6114d.js +2497 -0
  68. package/dist/exports/devtools/FloatingTanStackRouterDevtools-DymJEvfG-BHuQHiRR.js +237 -0
  69. package/dist/exports/devtools/MIMHJGAX-Cb3wf11F.js +10903 -0
  70. package/dist/exports/devtools/Q7LWSL4U-BoEO3rNq.js +37 -0
  71. package/dist/exports/devtools/VLTTJS3N-CIyRc84e.js +44 -0
  72. package/dist/exports/devtools/index.js +1724 -3
  73. package/dist/exports/devtools/utils-YRTCpRgb.js +1670 -0
  74. package/dist/exports/tests/api.d.mts +7354 -5
  75. package/dist/exports/tests/api.mjs +79 -1
  76. package/dist/exports/tests/auth-schema-DUCJw-_2.mjs +1 -0
  77. package/dist/exports/tests/chunk-Cii4FAhs.mjs +1 -0
  78. package/dist/exports/tests/conditions-B0ffVJ5E.mjs +1 -0
  79. package/dist/exports/tests/constants-DHjjg05J.mjs +1 -0
  80. package/dist/exports/tests/dist-D6vgKv3t.mjs +7 -0
  81. package/dist/exports/tests/dist-EfrRkq5c.mjs +296 -0
  82. package/dist/exports/tests/extract-blob-metadata-Dv343Vcn.mjs +169 -0
  83. package/dist/exports/tests/generate-image-variant-cQc8q0kh.mjs +1 -0
  84. package/dist/exports/tests/generate-preview-HaTMd2hS.mjs +1 -0
  85. package/dist/exports/tests/magic-string.es-D6VRmdiF.mjs +14 -0
  86. package/dist/exports/tests/mock-BvkO5nlm.mjs +1 -0
  87. package/dist/exports/tests/mock.mjs +1 -1
  88. package/dist/exports/tests/pdf-BDsS3vjF.mjs +13 -0
  89. package/dist/exports/tests/purge-attachment-D4uOzHRi.mjs +1 -0
  90. package/dist/exports/tests/purge-audit-logs-DiPcc09d.mjs +1 -0
  91. package/dist/exports/tests/purge-unattached-blobs-CqW6tlIC.mjs +1 -0
  92. package/dist/exports/tests/react.mjs +6 -1
  93. package/dist/exports/tests/setup.d.mts +1 -1
  94. package/dist/exports/tests/setup.mjs +34 -1
  95. package/dist/exports/tests/table-CbU04119.mjs +1 -0
  96. package/dist/exports/tests/track-db-changes-Bd4W-P1q.mjs +1 -0
  97. package/dist/exports/tests/vi.2VT5v0um-Cme1b0Dl.mjs +348 -0
  98. package/dist/exports/tests/{api/workflow.mjs → workflow-DwZxTqdH.mjs} +1 -1
  99. package/dist/exports/tests/zod-DcpxsMPz.mjs +23 -0
  100. package/dist/exports/vendors/date.js +13236 -1
  101. package/dist/exports/vendors/toolkit.js +2206 -1
  102. package/dist/exports/vendors/zod.js +12344 -1
  103. package/dist/exports/vite/api-DGRU_RdM.mjs +27 -0
  104. package/dist/exports/vite/build-CxJAu2Bn.mjs +1 -0
  105. package/dist/exports/vite/build2-BMK0OFVt.mjs +16 -0
  106. package/dist/exports/vite/chunk-CxnlK1Zi.mjs +1 -0
  107. package/dist/exports/vite/chunk-PtveFMYu.mjs +1 -0
  108. package/dist/exports/vite/dist-Bxp8DqWh.mjs +114 -0
  109. package/dist/exports/vite/dist-CX51FKbX.mjs +1 -0
  110. package/dist/exports/vite/dist-DcyNr-KR.mjs +1 -0
  111. package/dist/exports/vite/dist-j3-Khlzt.mjs +1 -0
  112. package/dist/exports/vite/experimental-index-3KsfmUbz.mjs +1 -0
  113. package/dist/exports/vite/false-BNJbUKYT.mjs +1 -0
  114. package/dist/exports/vite/false-BvrPEDU6.mjs +1 -0
  115. package/dist/exports/vite/index.d.mts +1 -1
  116. package/dist/exports/vite/index.mjs +26 -1
  117. package/dist/exports/vite/internal-C5cVwRiK.mjs +1 -0
  118. package/dist/exports/vite/jiti-BjSPrFvg.mjs +9 -0
  119. package/dist/exports/vite/lexer-DQCqS3nf-C6xCDOEQ.mjs +3 -0
  120. package/dist/exports/vite/lib-CMv7Sfwa.mjs +1 -0
  121. package/dist/exports/vite/lib-D9TnS-7w.mjs +1 -0
  122. package/dist/exports/vite/lib-DuBRr9dH.mjs +382 -0
  123. package/dist/exports/vite/node-DI8AnY_i.mjs +437 -0
  124. package/dist/exports/vite/postcss-BtmDpj-c.mjs +32 -0
  125. package/dist/exports/vite/postcss-import-Bk_ZCd6c.mjs +5 -0
  126. package/dist/exports/vite/rolldown-build-CNW2eye_-CJNfyXdF.mjs +13 -0
  127. package/dist/exports/vitest/api-CPv6lnxG.mjs +27 -0
  128. package/dist/exports/vitest/build2-28i3OiJ3.mjs +16 -0
  129. package/dist/exports/vitest/chunk-_e2jlDPK.mjs +1 -0
  130. package/dist/exports/vitest/chunk-jwDkFoXW.mjs +1 -0
  131. package/dist/exports/vitest/config.mjs +77 -1
  132. package/dist/exports/vitest/dist-L-OpshPJ.mjs +114 -0
  133. package/dist/exports/vitest/index.mjs +348 -1
  134. package/dist/exports/vitest/jiti-eNGOyHIo.mjs +9 -0
  135. package/dist/exports/vitest/lexer-DQCqS3nf-TWLyIqlY.mjs +3 -0
  136. package/dist/exports/vitest/lib-C3G64csm.mjs +1 -0
  137. package/dist/exports/vitest/magic-string.es-CxM5Ubyl.mjs +14 -0
  138. package/dist/exports/vitest/module-runner-DsF4L04D.mjs +1 -0
  139. package/dist/exports/vitest/postcss-BxLp_Too.mjs +32 -0
  140. package/dist/exports/vitest/postcss-import-5pKj3f5q.mjs +5 -0
  141. package/dist/exports/web/browser-ponyfill-DxTJMXNq.js +443 -0
  142. package/dist/exports/web/chunk-DksrlJLg.js +49 -0
  143. package/dist/exports/web/index.d.ts +2546 -2
  144. package/dist/exports/web/index.js +9295 -6
  145. package/dist/exports/web/plugin-DqTFWG7p.js +250 -0
  146. package/package.json +1 -1
  147. package/dist/exports/api/app-context.d.mts +0 -115
  148. package/dist/exports/api/app-context.mjs +0 -24
  149. package/dist/exports/api/auth-schema.d.mts +0 -4248
  150. package/dist/exports/api/auth.d.mts +0 -402
  151. package/dist/exports/api/auth.mjs +0 -188
  152. package/dist/exports/api/cache.d.mts +0 -44
  153. package/dist/exports/api/cache.mjs +0 -28
  154. package/dist/exports/api/config.d.mts +0 -28
  155. package/dist/exports/api/config.mjs +0 -72
  156. package/dist/exports/api/constants.mjs +0 -92
  157. package/dist/exports/api/container.d.mts +0 -210
  158. package/dist/exports/api/container.mjs +0 -49
  159. package/dist/exports/api/database.d.mts +0 -101
  160. package/dist/exports/api/database.mjs +0 -219
  161. package/dist/exports/api/event.d.mts +0 -235
  162. package/dist/exports/api/event.mjs +0 -236
  163. package/dist/exports/api/i18n.d.mts +0 -34
  164. package/dist/exports/api/i18n.mjs +0 -45
  165. package/dist/exports/api/instrumentation.d.mts +0 -7
  166. package/dist/exports/api/instrumentation.mjs +0 -40
  167. package/dist/exports/api/logger.d.mts +0 -21
  168. package/dist/exports/api/logger.mjs +0 -26
  169. package/dist/exports/api/mailer.d.mts +0 -70
  170. package/dist/exports/api/mailer.mjs +0 -37
  171. package/dist/exports/api/middleware/request-logger.d.mts +0 -24
  172. package/dist/exports/api/middleware.d.mts +0 -39
  173. package/dist/exports/api/middleware.mjs +0 -73
  174. package/dist/exports/api/openapi.d.mts +0 -271
  175. package/dist/exports/api/openapi.mjs +0 -507
  176. package/dist/exports/api/otel.d.mts +0 -40
  177. package/dist/exports/api/otel.mjs +0 -56
  178. package/dist/exports/api/redis.d.mts +0 -34
  179. package/dist/exports/api/redis.mjs +0 -41
  180. package/dist/exports/api/storage-schema.d.mts +0 -707
  181. package/dist/exports/api/storage-schema.mjs +0 -72
  182. package/dist/exports/api/storage.d.mts +0 -506
  183. package/dist/exports/api/storage.mjs +0 -833
  184. package/dist/exports/api/web/auth.mjs +0 -17
  185. package/dist/exports/api/workflow.d.mts +0 -250
  186. package/dist/exports/api/workflows/api/auth-schema.mjs +0 -373
  187. package/dist/exports/api/workflows/api/auth.d.mts +0 -379
  188. package/dist/exports/api/workflows/api/cache.d.mts +0 -44
  189. package/dist/exports/api/workflows/api/config.d.mts +0 -18
  190. package/dist/exports/api/workflows/api/container.d.mts +0 -167
  191. package/dist/exports/api/workflows/api/database.d.mts +0 -47
  192. package/dist/exports/api/workflows/api/event.d.mts +0 -68
  193. package/dist/exports/api/workflows/api/event.mjs +0 -126
  194. package/dist/exports/api/workflows/api/logger.d.mts +0 -21
  195. package/dist/exports/api/workflows/api/mailer.d.mts +0 -70
  196. package/dist/exports/api/workflows/api/orm.d.mts +0 -13
  197. package/dist/exports/api/workflows/api/redis.mjs +0 -3
  198. package/dist/exports/api/workflows/api/storage-schema.d.mts +0 -699
  199. package/dist/exports/api/workflows/api/storage.d.mts +0 -396
  200. package/dist/exports/api/workflows/api/workflow.d.mts +0 -24
  201. package/dist/exports/api/workflows/constants.mjs +0 -23
  202. package/dist/exports/api/workflows/extract-blob-metadata.mjs +0 -132
  203. package/dist/exports/api/workflows/generate-image-variant.d.mts +0 -63
  204. package/dist/exports/api/workflows/track-db-changes.d.mts +0 -72
  205. package/dist/exports/cli/api/auth-schema.mjs +0 -373
  206. package/dist/exports/cli/api/auth.d.mts +0 -379
  207. package/dist/exports/cli/api/cache.d.mts +0 -44
  208. package/dist/exports/cli/api/config.d.mts +0 -18
  209. package/dist/exports/cli/api/container.d.mts +0 -167
  210. package/dist/exports/cli/api/database.d.mts +0 -47
  211. package/dist/exports/cli/api/event.d.mts +0 -68
  212. package/dist/exports/cli/api/event.mjs +0 -126
  213. package/dist/exports/cli/api/logger.d.mts +0 -21
  214. package/dist/exports/cli/api/mailer.d.mts +0 -70
  215. package/dist/exports/cli/api/orm.d.mts +0 -13
  216. package/dist/exports/cli/api/redis.mjs +0 -3
  217. package/dist/exports/cli/api/storage-schema.d.mts +0 -699
  218. package/dist/exports/cli/api/storage.d.mts +0 -396
  219. package/dist/exports/cli/api/workflow.d.mts +0 -2
  220. package/dist/exports/cli/api/workflows/extract-blob-metadata.mjs +0 -132
  221. package/dist/exports/cli/api/workflows/generate-image-variant.d.mts +0 -63
  222. package/dist/exports/cli/api/workflows/track-db-changes.mjs +0 -110
  223. package/dist/exports/cli/command.d.mts +0 -56
  224. package/dist/exports/cli/command.mjs +0 -43
  225. package/dist/exports/cli/constants.mjs +0 -23
  226. package/dist/exports/cli/context.d.mts +0 -170
  227. package/dist/exports/tests/_virtual/rolldown_runtime.mjs +0 -1
  228. package/dist/exports/tests/api/app-context.d.mts +0 -115
  229. package/dist/exports/tests/api/app-context.mjs +0 -1
  230. package/dist/exports/tests/api/auth-schema.d.mts +0 -4248
  231. package/dist/exports/tests/api/auth-schema.mjs +0 -1
  232. package/dist/exports/tests/api/auth.d.mts +0 -402
  233. package/dist/exports/tests/api/cache.d.mts +0 -44
  234. package/dist/exports/tests/api/config.d.mts +0 -28
  235. package/dist/exports/tests/api/container.d.mts +0 -210
  236. package/dist/exports/tests/api/database.d.mts +0 -101
  237. package/dist/exports/tests/api/database.mjs +0 -1
  238. package/dist/exports/tests/api/event.d.mts +0 -235
  239. package/dist/exports/tests/api/event.mjs +0 -1
  240. package/dist/exports/tests/api/i18n.d.mts +0 -34
  241. package/dist/exports/tests/api/index.d.mts +0 -26
  242. package/dist/exports/tests/api/logger.d.mts +0 -21
  243. package/dist/exports/tests/api/mailer.d.mts +0 -70
  244. package/dist/exports/tests/api/middleware/error-handler.mjs +0 -1
  245. package/dist/exports/tests/api/middleware/health.mjs +0 -1
  246. package/dist/exports/tests/api/middleware/i18n.mjs +0 -1
  247. package/dist/exports/tests/api/middleware/request-logger.d.mts +0 -24
  248. package/dist/exports/tests/api/middleware/request-logger.mjs +0 -1
  249. package/dist/exports/tests/api/middleware/shutdown.mjs +0 -1
  250. package/dist/exports/tests/api/middleware/timeout.mjs +0 -1
  251. package/dist/exports/tests/api/middleware.d.mts +0 -39
  252. package/dist/exports/tests/api/middleware.mjs +0 -1
  253. package/dist/exports/tests/api/openapi.d.mts +0 -271
  254. package/dist/exports/tests/api/openapi.mjs +0 -1
  255. package/dist/exports/tests/api/orm.d.mts +0 -13
  256. package/dist/exports/tests/api/otel.d.mts +0 -40
  257. package/dist/exports/tests/api/redis.d.mts +0 -34
  258. package/dist/exports/tests/api/redis.mjs +0 -1
  259. package/dist/exports/tests/api/server.mjs +0 -1
  260. package/dist/exports/tests/api/storage-schema.d.mts +0 -707
  261. package/dist/exports/tests/api/storage.d.mts +0 -506
  262. package/dist/exports/tests/api/workflow.d.mts +0 -250
  263. package/dist/exports/tests/api/workflows/extract-blob-metadata.mjs +0 -1
  264. package/dist/exports/tests/api/workflows/generate-image-variant.d.mts +0 -63
  265. package/dist/exports/tests/api/workflows/generate-image-variant.mjs +0 -1
  266. package/dist/exports/tests/api/workflows/generate-preview.mjs +0 -1
  267. package/dist/exports/tests/api/workflows/purge-attachment.mjs +0 -1
  268. package/dist/exports/tests/api/workflows/purge-audit-logs.mjs +0 -1
  269. package/dist/exports/tests/api/workflows/purge-unattached-blobs.mjs +0 -1
  270. package/dist/exports/tests/api/workflows/track-db-changes.mjs +0 -1
  271. package/dist/exports/tests/constants.mjs +0 -1
  272. package/dist/exports/tests/instrumentation.d.mts +0 -7
  273. package/dist/exports/tests/instrumentation.mjs +0 -1
  274. package/dist/exports/web/api/auth.d.ts +0 -125
  275. package/dist/exports/web/api/database.d.ts +0 -4
  276. package/dist/exports/web/api/logger.d.ts +0 -1
  277. package/dist/exports/web/auth.d.ts +0 -2388
  278. package/dist/exports/web/auth.js +0 -75
  279. package/dist/exports/web/i18n.d.ts +0 -42
  280. package/dist/exports/web/i18n.js +0 -45
  281. /package/dist/exports/tests/{api/middleware/youch-handler.mjs → youch-handler-Ch5yf6im.mjs} +0 -0
@@ -0,0 +1,2636 @@
1
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/column-common.js
2
+ const OriginalColumn = Symbol.for("drizzle:OriginalColumn");
3
+
4
+ //#endregion
5
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/entity.js
6
+ const entityKind = Symbol.for("drizzle:entityKind");
7
+ const hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
8
+ function is(value, type) {
9
+ if (!value || typeof value !== "object") return false;
10
+ if (value instanceof type) return true;
11
+ if (!Object.prototype.hasOwnProperty.call(type, entityKind)) throw new Error(`Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);
12
+ let cls = Object.getPrototypeOf(value).constructor;
13
+ if (cls) while (cls) {
14
+ if (entityKind in cls && cls[entityKind] === type[entityKind]) return true;
15
+ cls = Object.getPrototypeOf(cls);
16
+ }
17
+ return false;
18
+ }
19
+
20
+ //#endregion
21
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/column.js
22
+ var Column = class {
23
+ static [entityKind] = "Column";
24
+ name;
25
+ keyAsName;
26
+ primary;
27
+ notNull;
28
+ default;
29
+ defaultFn;
30
+ onUpdateFn;
31
+ hasDefault;
32
+ isUnique;
33
+ uniqueName;
34
+ uniqueType;
35
+ dataType;
36
+ columnType;
37
+ enumValues = void 0;
38
+ generated = void 0;
39
+ generatedIdentity = void 0;
40
+ length;
41
+ isLengthExact;
42
+ isAlias;
43
+ /** @internal */
44
+ config;
45
+ /** @internal */
46
+ table;
47
+ /** @internal */
48
+ onInit() {}
49
+ constructor(table, config) {
50
+ this.config = config;
51
+ this.onInit();
52
+ this.table = table;
53
+ this.name = config.name;
54
+ this.isAlias = false;
55
+ this.keyAsName = config.keyAsName;
56
+ this.notNull = config.notNull;
57
+ this.default = config.default;
58
+ this.defaultFn = config.defaultFn;
59
+ this.onUpdateFn = config.onUpdateFn;
60
+ this.hasDefault = config.hasDefault;
61
+ this.primary = config.primaryKey;
62
+ this.isUnique = config.isUnique;
63
+ this.uniqueName = config.uniqueName;
64
+ this.uniqueType = config.uniqueType;
65
+ this.dataType = config.dataType;
66
+ this.columnType = config.columnType;
67
+ this.generated = config.generated;
68
+ this.generatedIdentity = config.generatedIdentity;
69
+ this.length = config["length"];
70
+ this.isLengthExact = config["isLengthExact"];
71
+ }
72
+ mapFromDriverValue(value) {
73
+ return value;
74
+ }
75
+ mapToDriverValue(value) {
76
+ return value;
77
+ }
78
+ shouldDisableInsert() {
79
+ return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
80
+ }
81
+ /** @internal */
82
+ [OriginalColumn]() {
83
+ return this;
84
+ }
85
+ };
86
+ function getColumnTable(column) {
87
+ return column.table;
88
+ }
89
+
90
+ //#endregion
91
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/column-builder.js
92
+ function extractExtendedColumnType(column) {
93
+ const [type, constraint] = column.dataType.split(" ");
94
+ return {
95
+ type,
96
+ constraint
97
+ };
98
+ }
99
+ var ColumnBuilder = class {
100
+ static [entityKind] = "ColumnBuilder";
101
+ /** @internal */
102
+ config;
103
+ constructor(name$1, dataType, columnType) {
104
+ this.config = {
105
+ name: name$1,
106
+ keyAsName: name$1 === "",
107
+ notNull: false,
108
+ default: void 0,
109
+ hasDefault: false,
110
+ primaryKey: false,
111
+ isUnique: false,
112
+ uniqueName: void 0,
113
+ uniqueType: void 0,
114
+ dataType,
115
+ columnType,
116
+ generated: void 0
117
+ };
118
+ }
119
+ /**
120
+ * Changes the data type of the column. Commonly used with `json` columns. Also, useful for branded types.
121
+ *
122
+ * @example
123
+ * ```ts
124
+ * const users = pgTable('users', {
125
+ * id: integer('id').$type<UserId>().primaryKey(),
126
+ * details: json('details').$type<UserDetails>().notNull(),
127
+ * });
128
+ * ```
129
+ */
130
+ $type() {
131
+ return this;
132
+ }
133
+ /**
134
+ * Adds a `not null` clause to the column definition.
135
+ *
136
+ * Affects the `select` model of the table - columns *without* `not null` will be nullable on select.
137
+ */
138
+ notNull() {
139
+ this.config.notNull = true;
140
+ return this;
141
+ }
142
+ /**
143
+ * Adds a `default <value>` clause to the column definition.
144
+ *
145
+ * Affects the `insert` model of the table - columns *with* `default` are optional on insert.
146
+ *
147
+ * If you need to set a dynamic default value, use {@link $defaultFn} instead.
148
+ */
149
+ default(value) {
150
+ this.config.default = value;
151
+ this.config.hasDefault = true;
152
+ return this;
153
+ }
154
+ /**
155
+ * Adds a dynamic default value to the column.
156
+ * The function will be called when the row is inserted, and the returned value will be used as the column value.
157
+ *
158
+ * **Note:** This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`.
159
+ */
160
+ $defaultFn(fn) {
161
+ this.config.defaultFn = fn;
162
+ this.config.hasDefault = true;
163
+ return this;
164
+ }
165
+ /**
166
+ * Alias for {@link $defaultFn}.
167
+ */
168
+ $default = this.$defaultFn;
169
+ /**
170
+ * Adds a dynamic update value to the column.
171
+ * The function will be called when the row is updated, and the returned value will be used as the column value if none is provided.
172
+ * If no `default` (or `$defaultFn`) value is provided, the function will be called when the row is inserted as well, and the returned value will be used as the column value.
173
+ *
174
+ * **Note:** This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`.
175
+ */
176
+ $onUpdateFn(fn) {
177
+ this.config.onUpdateFn = fn;
178
+ this.config.hasDefault = true;
179
+ return this;
180
+ }
181
+ /**
182
+ * Alias for {@link $onUpdateFn}.
183
+ */
184
+ $onUpdate = this.$onUpdateFn;
185
+ /**
186
+ * Adds a `primary key` clause to the column definition. This implicitly makes the column `not null`.
187
+ *
188
+ * In SQLite, `integer primary key` implicitly makes the column auto-incrementing.
189
+ */
190
+ primaryKey() {
191
+ this.config.primaryKey = true;
192
+ this.config.notNull = true;
193
+ return this;
194
+ }
195
+ /** @internal Sets the name of the column to the key within the table definition if a name was not given. */
196
+ setName(name$1) {
197
+ if (this.config.name !== "") return;
198
+ this.config.name = name$1;
199
+ }
200
+ };
201
+
202
+ //#endregion
203
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/table.utils.js
204
+ const TableName = Symbol.for("drizzle:Name");
205
+
206
+ //#endregion
207
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/foreign-keys.js
208
+ var ForeignKeyBuilder = class {
209
+ static [entityKind] = "PgForeignKeyBuilder";
210
+ /** @internal */
211
+ reference;
212
+ /** @internal */
213
+ _onUpdate = "no action";
214
+ /** @internal */
215
+ _onDelete = "no action";
216
+ constructor(config, actions) {
217
+ this.reference = () => {
218
+ const { name: name$1, columns, foreignColumns } = config();
219
+ return {
220
+ name: name$1,
221
+ columns,
222
+ foreignTable: foreignColumns[0].table,
223
+ foreignColumns
224
+ };
225
+ };
226
+ if (actions) {
227
+ this._onUpdate = actions.onUpdate;
228
+ this._onDelete = actions.onDelete;
229
+ }
230
+ }
231
+ onUpdate(action) {
232
+ this._onUpdate = action === void 0 ? "no action" : action;
233
+ return this;
234
+ }
235
+ onDelete(action) {
236
+ this._onDelete = action === void 0 ? "no action" : action;
237
+ return this;
238
+ }
239
+ /** @internal */
240
+ build(table) {
241
+ return new ForeignKey(table, this);
242
+ }
243
+ };
244
+ var ForeignKey = class {
245
+ constructor(table, builder) {
246
+ this.table = table;
247
+ this.reference = builder.reference;
248
+ this.onUpdate = builder._onUpdate;
249
+ this.onDelete = builder._onDelete;
250
+ }
251
+ static [entityKind] = "PgForeignKey";
252
+ reference;
253
+ onUpdate;
254
+ onDelete;
255
+ name;
256
+ getName() {
257
+ const { name: name$1, columns, foreignColumns } = this.reference();
258
+ const columnNames = columns.map((column) => column.name);
259
+ const foreignColumnNames = foreignColumns.map((column) => column.name);
260
+ const chunks = [
261
+ this.table[TableName],
262
+ ...columnNames,
263
+ foreignColumns[0].table[TableName],
264
+ ...foreignColumnNames
265
+ ];
266
+ return name$1 ?? `${chunks.join("_")}_fk`;
267
+ }
268
+ isNameExplicit() {
269
+ return !!this.reference().name;
270
+ }
271
+ };
272
+
273
+ //#endregion
274
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/tracing-utils.js
275
+ function iife(fn, ...args) {
276
+ return fn(...args);
277
+ }
278
+
279
+ //#endregion
280
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/utils/array.js
281
+ function parsePgArrayValue(arrayString, startFrom, inQuotes) {
282
+ for (let i = startFrom; i < arrayString.length; i++) {
283
+ const char$1 = arrayString[i];
284
+ if (char$1 === "\\") {
285
+ i++;
286
+ continue;
287
+ }
288
+ if (char$1 === "\"") return [arrayString.slice(startFrom, i).replace(/\\/g, ""), i + 1];
289
+ if (inQuotes) continue;
290
+ if (char$1 === "," || char$1 === "}") return [arrayString.slice(startFrom, i).replace(/\\/g, ""), i];
291
+ }
292
+ return [arrayString.slice(startFrom).replace(/\\/g, ""), arrayString.length];
293
+ }
294
+ function parsePgNestedArray(arrayString, startFrom = 0) {
295
+ const result = [];
296
+ let i = startFrom;
297
+ let lastCharIsComma = false;
298
+ while (i < arrayString.length) {
299
+ const char$1 = arrayString[i];
300
+ if (char$1 === ",") {
301
+ if (lastCharIsComma || i === startFrom) result.push("");
302
+ lastCharIsComma = true;
303
+ i++;
304
+ continue;
305
+ }
306
+ lastCharIsComma = false;
307
+ if (char$1 === "\\") {
308
+ i += 2;
309
+ continue;
310
+ }
311
+ if (char$1 === "\"") {
312
+ const [value2, startFrom2] = parsePgArrayValue(arrayString, i + 1, true);
313
+ result.push(value2);
314
+ i = startFrom2;
315
+ continue;
316
+ }
317
+ if (char$1 === "}") return [result, i + 1];
318
+ if (char$1 === "{") {
319
+ const [value2, startFrom2] = parsePgNestedArray(arrayString, i + 1);
320
+ result.push(value2);
321
+ i = startFrom2;
322
+ continue;
323
+ }
324
+ const [value, newStartFrom] = parsePgArrayValue(arrayString, i, false);
325
+ result.push(value);
326
+ i = newStartFrom;
327
+ }
328
+ return [result, i];
329
+ }
330
+ function parsePgArray(arrayString) {
331
+ const [result] = parsePgNestedArray(arrayString, 1);
332
+ return result;
333
+ }
334
+ function makePgArray(array) {
335
+ return `{${array.map((item) => {
336
+ if (Array.isArray(item)) return makePgArray(item);
337
+ if (typeof item === "string") return `"${item.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
338
+ return `${item}`;
339
+ }).join(",")}}`;
340
+ }
341
+
342
+ //#endregion
343
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/common.js
344
+ var PgColumnBuilder = class extends ColumnBuilder {
345
+ foreignKeyConfigs = [];
346
+ static [entityKind] = "PgColumnBuilder";
347
+ array(length) {
348
+ return new PgArrayBuilder(this.config.name, this, length);
349
+ }
350
+ references(ref, config = {}) {
351
+ this.foreignKeyConfigs.push({
352
+ ref,
353
+ config
354
+ });
355
+ return this;
356
+ }
357
+ unique(name$1, config) {
358
+ this.config.isUnique = true;
359
+ this.config.uniqueName = name$1;
360
+ this.config.uniqueType = config?.nulls;
361
+ return this;
362
+ }
363
+ generatedAlwaysAs(as) {
364
+ this.config.generated = {
365
+ as,
366
+ type: "always",
367
+ mode: "stored"
368
+ };
369
+ return this;
370
+ }
371
+ /** @internal */
372
+ buildForeignKeys(column, table) {
373
+ return this.foreignKeyConfigs.map(({ ref, config }) => {
374
+ return iife((ref2, config2) => {
375
+ const builder = new ForeignKeyBuilder(() => {
376
+ const foreignColumn = ref2();
377
+ return {
378
+ name: config2.name,
379
+ columns: [column],
380
+ foreignColumns: [foreignColumn]
381
+ };
382
+ });
383
+ if (config2.onUpdate) builder.onUpdate(config2.onUpdate);
384
+ if (config2.onDelete) builder.onDelete(config2.onDelete);
385
+ return builder.build(table);
386
+ }, ref, config);
387
+ });
388
+ }
389
+ /** @internal */
390
+ buildExtraConfigColumn(table) {
391
+ return new ExtraConfigColumn(table, this.config);
392
+ }
393
+ };
394
+ var PgColumn = class extends Column {
395
+ static [entityKind] = "PgColumn";
396
+ /** @internal */
397
+ table;
398
+ constructor(table, config) {
399
+ super(table, config);
400
+ this.table = table;
401
+ }
402
+ };
403
+ var ExtraConfigColumn = class extends PgColumn {
404
+ static [entityKind] = "ExtraConfigColumn";
405
+ getSQLType() {
406
+ return this.getSQLType();
407
+ }
408
+ indexConfig = {
409
+ order: this.config.order ?? "asc",
410
+ nulls: this.config.nulls ?? "last",
411
+ opClass: this.config.opClass
412
+ };
413
+ defaultConfig = {
414
+ order: "asc",
415
+ nulls: "last",
416
+ opClass: void 0
417
+ };
418
+ asc() {
419
+ this.indexConfig.order = "asc";
420
+ return this;
421
+ }
422
+ desc() {
423
+ this.indexConfig.order = "desc";
424
+ return this;
425
+ }
426
+ nullsFirst() {
427
+ this.indexConfig.nulls = "first";
428
+ return this;
429
+ }
430
+ nullsLast() {
431
+ this.indexConfig.nulls = "last";
432
+ return this;
433
+ }
434
+ /**
435
+ * ### PostgreSQL documentation quote
436
+ *
437
+ * > An operator class with optional parameters can be specified for each column of an index.
438
+ * The operator class identifies the operators to be used by the index for that column.
439
+ * For example, a B-tree index on four-byte integers would use the int4_ops class;
440
+ * this operator class includes comparison functions for four-byte integers.
441
+ * In practice the default operator class for the column's data type is usually sufficient.
442
+ * The main point of having operator classes is that for some data types, there could be more than one meaningful ordering.
443
+ * For example, we might want to sort a complex-number data type either by absolute value or by real part.
444
+ * We could do this by defining two operator classes for the data type and then selecting the proper class when creating an index.
445
+ * More information about operator classes check:
446
+ *
447
+ * ### Useful links
448
+ * https://www.postgresql.org/docs/current/sql-createindex.html
449
+ *
450
+ * https://www.postgresql.org/docs/current/indexes-opclass.html
451
+ *
452
+ * https://www.postgresql.org/docs/current/xindex.html
453
+ *
454
+ * ### Additional types
455
+ * If you have the `pg_vector` extension installed in your database, you can use the
456
+ * `vector_l2_ops`, `vector_ip_ops`, `vector_cosine_ops`, `vector_l1_ops`, `bit_hamming_ops`, `bit_jaccard_ops`, `halfvec_l2_ops`, `sparsevec_l2_ops` options, which are predefined types.
457
+ *
458
+ * **You can always specify any string you want in the operator class, in case Drizzle doesn't have it natively in its types**
459
+ *
460
+ * @param opClass
461
+ * @returns
462
+ */
463
+ op(opClass) {
464
+ this.indexConfig.opClass = opClass;
465
+ return this;
466
+ }
467
+ };
468
+ var IndexedColumn = class {
469
+ static [entityKind] = "IndexedColumn";
470
+ constructor(name$1, keyAsName, type, indexConfig) {
471
+ this.name = name$1;
472
+ this.keyAsName = keyAsName;
473
+ this.type = type;
474
+ this.indexConfig = indexConfig;
475
+ }
476
+ name;
477
+ keyAsName;
478
+ type;
479
+ indexConfig;
480
+ };
481
+ var PgArrayBuilder = class extends PgColumnBuilder {
482
+ static [entityKind] = "PgArrayBuilder";
483
+ constructor(name$1, baseBuilder, length) {
484
+ super(name$1, "array basecolumn", "PgArray");
485
+ this.config.baseBuilder = baseBuilder;
486
+ this.config.length = length;
487
+ }
488
+ /** @internal */
489
+ build(table) {
490
+ const baseColumn = this.config.baseBuilder.build(table);
491
+ return new PgArray(table, this.config, baseColumn);
492
+ }
493
+ };
494
+ var PgArray = class PgArray extends PgColumn {
495
+ constructor(table, config, baseColumn, range) {
496
+ super(table, config);
497
+ this.baseColumn = baseColumn;
498
+ this.range = range;
499
+ }
500
+ static [entityKind] = "PgArray";
501
+ getSQLType() {
502
+ return `${this.baseColumn.getSQLType()}[${typeof this.length === "number" ? this.length : ""}]`;
503
+ }
504
+ mapFromDriverValue(value) {
505
+ if (typeof value === "string") value = parsePgArray(value);
506
+ return value.map((v) => this.baseColumn.mapFromDriverValue(v));
507
+ }
508
+ mapFromJsonValue(value) {
509
+ if (typeof value === "string") value = parsePgArray(value);
510
+ const base = this.baseColumn;
511
+ return "mapFromJsonValue" in base ? value.map((v) => base.mapFromJsonValue(v)) : value.map((v) => base.mapFromDriverValue(v));
512
+ }
513
+ mapToDriverValue(value, isNestedArray = false) {
514
+ const a = value.map((v) => v === null ? null : is(this.baseColumn, PgArray) ? this.baseColumn.mapToDriverValue(v, true) : this.baseColumn.mapToDriverValue(v));
515
+ if (isNestedArray) return a;
516
+ return makePgArray(a);
517
+ }
518
+ };
519
+
520
+ //#endregion
521
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/enum.js
522
+ var PgEnumObjectColumnBuilder = class extends PgColumnBuilder {
523
+ static [entityKind] = "PgEnumObjectColumnBuilder";
524
+ constructor(name$1, enumInstance) {
525
+ super(name$1, "string enum", "PgEnumObjectColumn");
526
+ this.config.enum = enumInstance;
527
+ }
528
+ /** @internal */
529
+ build(table) {
530
+ return new PgEnumObjectColumn(table, this.config);
531
+ }
532
+ };
533
+ var PgEnumObjectColumn = class extends PgColumn {
534
+ static [entityKind] = "PgEnumObjectColumn";
535
+ enum;
536
+ enumValues = this.config.enum.enumValues;
537
+ constructor(table, config) {
538
+ super(table, config);
539
+ this.enum = config.enum;
540
+ }
541
+ getSQLType() {
542
+ return this.enum.enumName;
543
+ }
544
+ };
545
+ const isPgEnumSym = Symbol.for("drizzle:isPgEnum");
546
+ function isPgEnum(obj) {
547
+ return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
548
+ }
549
+ var PgEnumColumnBuilder = class extends PgColumnBuilder {
550
+ static [entityKind] = "PgEnumColumnBuilder";
551
+ constructor(name$1, enumInstance) {
552
+ super(name$1, "string enum", "PgEnumColumn");
553
+ this.config.enum = enumInstance;
554
+ }
555
+ /** @internal */
556
+ build(table) {
557
+ return new PgEnumColumn(table, this.config);
558
+ }
559
+ };
560
+ var PgEnumColumn = class extends PgColumn {
561
+ static [entityKind] = "PgEnumColumn";
562
+ enum = this.config.enum;
563
+ enumValues = this.config.enum.enumValues;
564
+ constructor(table, config) {
565
+ super(table, config);
566
+ this.enum = config.enum;
567
+ }
568
+ getSQLType() {
569
+ return this.enum.enumName;
570
+ }
571
+ };
572
+ function pgEnum(enumName, input) {
573
+ return Array.isArray(input) ? pgEnumWithSchema(enumName, [...input], void 0) : pgEnumObjectWithSchema(enumName, input, void 0);
574
+ }
575
+ function pgEnumWithSchema(enumName, values, schema) {
576
+ const enumInstance = Object.assign((name$1) => new PgEnumColumnBuilder(name$1 ?? "", enumInstance), {
577
+ enumName,
578
+ enumValues: values,
579
+ schema,
580
+ [isPgEnumSym]: true
581
+ });
582
+ return enumInstance;
583
+ }
584
+ function pgEnumObjectWithSchema(enumName, values, schema) {
585
+ const enumInstance = Object.assign((name$1) => new PgEnumObjectColumnBuilder(name$1 ?? "", enumInstance), {
586
+ enumName,
587
+ enumValues: Object.values(values),
588
+ schema,
589
+ [isPgEnumSym]: true
590
+ });
591
+ return enumInstance;
592
+ }
593
+
594
+ //#endregion
595
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/subquery.js
596
+ var Subquery = class {
597
+ static [entityKind] = "Subquery";
598
+ constructor(sql$1, fields, alias, isWith = false, usedTables = []) {
599
+ this._ = {
600
+ brand: "Subquery",
601
+ sql: sql$1,
602
+ selectedFields: fields,
603
+ alias,
604
+ isWith,
605
+ usedTables
606
+ };
607
+ }
608
+ };
609
+ var WithSubquery = class extends Subquery {
610
+ static [entityKind] = "WithSubquery";
611
+ };
612
+
613
+ //#endregion
614
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/tracing.js
615
+ const tracer = { startActiveSpan(name$1, fn) {
616
+ return fn();
617
+ } };
618
+
619
+ //#endregion
620
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/view-common.js
621
+ const ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
622
+
623
+ //#endregion
624
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/table.js
625
+ const TableSchema = Symbol.for("drizzle:Schema");
626
+ const TableColumns = Symbol.for("drizzle:Columns");
627
+ const ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
628
+ const OriginalName = Symbol.for("drizzle:OriginalName");
629
+ const BaseName = Symbol.for("drizzle:BaseName");
630
+ const IsAlias = Symbol.for("drizzle:IsAlias");
631
+ const ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
632
+ const IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
633
+ var Table = class {
634
+ static [entityKind] = "Table";
635
+ /** @internal */
636
+ static Symbol = {
637
+ Name: TableName,
638
+ Schema: TableSchema,
639
+ OriginalName,
640
+ Columns: TableColumns,
641
+ ExtraConfigColumns,
642
+ BaseName,
643
+ IsAlias,
644
+ ExtraConfigBuilder
645
+ };
646
+ /**
647
+ * @internal
648
+ * Can be changed if the table is aliased.
649
+ */
650
+ [TableName];
651
+ /**
652
+ * @internal
653
+ * Used to store the original name of the table, before any aliasing.
654
+ */
655
+ [OriginalName];
656
+ /** @internal */
657
+ [TableSchema];
658
+ /** @internal */
659
+ [TableColumns];
660
+ /** @internal */
661
+ [ExtraConfigColumns];
662
+ /**
663
+ * @internal
664
+ * Used to store the table name before the transformation via the `tableCreator` functions.
665
+ */
666
+ [BaseName];
667
+ /** @internal */
668
+ [IsAlias] = false;
669
+ /** @internal */
670
+ [IsDrizzleTable] = true;
671
+ /** @internal */
672
+ [ExtraConfigBuilder] = void 0;
673
+ constructor(name$1, schema, baseName) {
674
+ this[TableName] = this[OriginalName] = name$1;
675
+ this[TableSchema] = schema;
676
+ this[BaseName] = baseName;
677
+ }
678
+ };
679
+ function isTable(table) {
680
+ return typeof table === "object" && table !== null && IsDrizzleTable in table;
681
+ }
682
+ function getTableName(table) {
683
+ return table[TableName];
684
+ }
685
+ function getTableUniqueName(table) {
686
+ return `${table[TableSchema] ?? "public"}.${table[TableName]}`;
687
+ }
688
+
689
+ //#endregion
690
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/sql/sql.js
691
+ var FakePrimitiveParam = class {
692
+ static [entityKind] = "FakePrimitiveParam";
693
+ };
694
+ function isSQLWrapper(value) {
695
+ return value !== null && value !== void 0 && typeof value.getSQL === "function";
696
+ }
697
+ function mergeQueries(queries) {
698
+ const result = {
699
+ sql: "",
700
+ params: []
701
+ };
702
+ for (const query of queries) {
703
+ result.sql += query.sql;
704
+ result.params.push(...query.params);
705
+ if (query.typings?.length) {
706
+ if (!result.typings) result.typings = [];
707
+ result.typings.push(...query.typings);
708
+ }
709
+ }
710
+ return result;
711
+ }
712
+ var StringChunk = class {
713
+ static [entityKind] = "StringChunk";
714
+ value;
715
+ constructor(value) {
716
+ this.value = Array.isArray(value) ? value : [value];
717
+ }
718
+ getSQL() {
719
+ return new SQL([this]);
720
+ }
721
+ };
722
+ var SQL = class SQL {
723
+ constructor(queryChunks) {
724
+ this.queryChunks = queryChunks;
725
+ for (const chunk of queryChunks) if (is(chunk, Table)) {
726
+ const schemaName = chunk[Table.Symbol.Schema];
727
+ this.usedTables.push(schemaName === void 0 ? chunk[Table.Symbol.Name] : schemaName + "." + chunk[Table.Symbol.Name]);
728
+ }
729
+ }
730
+ static [entityKind] = "SQL";
731
+ /** @internal */
732
+ decoder = noopDecoder;
733
+ shouldInlineParams = false;
734
+ /** @internal */
735
+ usedTables = [];
736
+ append(query) {
737
+ this.queryChunks.push(...query.queryChunks);
738
+ return this;
739
+ }
740
+ toQuery(config) {
741
+ return tracer.startActiveSpan("drizzle.buildSQL", (span) => {
742
+ const query = this.buildQueryFromSourceParams(this.queryChunks, config);
743
+ span?.setAttributes({
744
+ "drizzle.query.text": query.sql,
745
+ "drizzle.query.params": JSON.stringify(query.params)
746
+ });
747
+ return query;
748
+ });
749
+ }
750
+ buildQueryFromSourceParams(chunks, _config) {
751
+ const config = Object.assign({}, _config, {
752
+ inlineParams: _config.inlineParams || this.shouldInlineParams,
753
+ paramStartIndex: _config.paramStartIndex || { value: 0 }
754
+ });
755
+ const { casing, escapeName, escapeParam, prepareTyping, inlineParams, paramStartIndex, invokeSource } = config;
756
+ return mergeQueries(chunks.map((chunk) => {
757
+ if (is(chunk, StringChunk)) return {
758
+ sql: chunk.value.join(""),
759
+ params: []
760
+ };
761
+ if (is(chunk, Name)) return {
762
+ sql: escapeName(chunk.value),
763
+ params: []
764
+ };
765
+ if (chunk === void 0) return {
766
+ sql: "",
767
+ params: []
768
+ };
769
+ if (Array.isArray(chunk)) {
770
+ const result = [new StringChunk("(")];
771
+ for (const [i, p] of chunk.entries()) {
772
+ result.push(p);
773
+ if (i < chunk.length - 1) result.push(new StringChunk(", "));
774
+ }
775
+ result.push(new StringChunk(")"));
776
+ return this.buildQueryFromSourceParams(result, config);
777
+ }
778
+ if (is(chunk, SQL)) return this.buildQueryFromSourceParams(chunk.queryChunks, {
779
+ ...config,
780
+ inlineParams: inlineParams || chunk.shouldInlineParams
781
+ });
782
+ if (is(chunk, Table)) {
783
+ const schemaName = chunk[Table.Symbol.Schema];
784
+ const tableName = chunk[Table.Symbol.Name];
785
+ if (invokeSource === "mssql-view-with-schemabinding") return {
786
+ sql: (schemaName === void 0 ? escapeName("dbo") : escapeName(schemaName)) + "." + escapeName(tableName),
787
+ params: []
788
+ };
789
+ return {
790
+ sql: schemaName === void 0 || chunk[IsAlias] ? escapeName(tableName) : escapeName(schemaName) + "." + escapeName(tableName),
791
+ params: []
792
+ };
793
+ }
794
+ if (is(chunk, Column)) {
795
+ const columnName = casing.getColumnCasing(chunk);
796
+ if (_config.invokeSource === "indexes") return {
797
+ sql: escapeName(columnName),
798
+ params: []
799
+ };
800
+ const schemaName = invokeSource === "mssql-check" ? void 0 : chunk.table[Table.Symbol.Schema];
801
+ return {
802
+ sql: chunk.isAlias ? escapeName(chunk.name) : chunk.table[IsAlias] || schemaName === void 0 ? escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName) : escapeName(schemaName) + "." + escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName),
803
+ params: []
804
+ };
805
+ }
806
+ if (is(chunk, View)) {
807
+ const schemaName = chunk[ViewBaseConfig].schema;
808
+ const viewName = chunk[ViewBaseConfig].name;
809
+ return {
810
+ sql: schemaName === void 0 || chunk[ViewBaseConfig].isAlias ? escapeName(viewName) : escapeName(schemaName) + "." + escapeName(viewName),
811
+ params: []
812
+ };
813
+ }
814
+ if (is(chunk, Param)) {
815
+ if (is(chunk.value, Placeholder)) return {
816
+ sql: escapeParam(paramStartIndex.value++, chunk),
817
+ params: [chunk],
818
+ typings: ["none"]
819
+ };
820
+ const mappedValue = chunk.value === null ? null : chunk.encoder.mapToDriverValue(chunk.value);
821
+ if (is(mappedValue, SQL)) return this.buildQueryFromSourceParams([mappedValue], config);
822
+ if (inlineParams) return {
823
+ sql: this.mapInlineParam(mappedValue, config),
824
+ params: []
825
+ };
826
+ let typings = ["none"];
827
+ if (prepareTyping) typings = [prepareTyping(chunk.encoder)];
828
+ return {
829
+ sql: escapeParam(paramStartIndex.value++, mappedValue),
830
+ params: [mappedValue],
831
+ typings
832
+ };
833
+ }
834
+ if (is(chunk, Placeholder)) return {
835
+ sql: escapeParam(paramStartIndex.value++, chunk),
836
+ params: [chunk],
837
+ typings: ["none"]
838
+ };
839
+ if (is(chunk, SQL.Aliased) && chunk.fieldAlias !== void 0) return {
840
+ sql: escapeName(chunk.fieldAlias),
841
+ params: []
842
+ };
843
+ if (is(chunk, Subquery)) {
844
+ if (chunk._.isWith) return {
845
+ sql: escapeName(chunk._.alias),
846
+ params: []
847
+ };
848
+ return this.buildQueryFromSourceParams([
849
+ new StringChunk("("),
850
+ chunk._.sql,
851
+ new StringChunk(") "),
852
+ new Name(chunk._.alias)
853
+ ], config);
854
+ }
855
+ if (isPgEnum(chunk)) {
856
+ if (chunk.schema) return {
857
+ sql: escapeName(chunk.schema) + "." + escapeName(chunk.enumName),
858
+ params: []
859
+ };
860
+ return {
861
+ sql: escapeName(chunk.enumName),
862
+ params: []
863
+ };
864
+ }
865
+ if (isSQLWrapper(chunk)) {
866
+ if (chunk.shouldOmitSQLParens?.()) return this.buildQueryFromSourceParams([chunk.getSQL()], config);
867
+ return this.buildQueryFromSourceParams([
868
+ new StringChunk("("),
869
+ chunk.getSQL(),
870
+ new StringChunk(")")
871
+ ], config);
872
+ }
873
+ if (inlineParams) return {
874
+ sql: this.mapInlineParam(chunk, config),
875
+ params: []
876
+ };
877
+ return {
878
+ sql: escapeParam(paramStartIndex.value++, chunk),
879
+ params: [chunk],
880
+ typings: ["none"]
881
+ };
882
+ }));
883
+ }
884
+ mapInlineParam(chunk, { escapeString }) {
885
+ if (chunk === null) return "null";
886
+ if (typeof chunk === "number" || typeof chunk === "boolean" || typeof chunk === "bigint") return chunk.toString();
887
+ if (typeof chunk === "string") return escapeString(chunk);
888
+ if (typeof chunk === "object") {
889
+ const mappedValueAsString = chunk.toString();
890
+ if (mappedValueAsString === "[object Object]") return escapeString(JSON.stringify(chunk));
891
+ return escapeString(mappedValueAsString);
892
+ }
893
+ throw new Error("Unexpected param value: " + chunk);
894
+ }
895
+ getSQL() {
896
+ return this;
897
+ }
898
+ as(alias) {
899
+ if (alias === void 0) return this;
900
+ return new SQL.Aliased(this, alias);
901
+ }
902
+ mapWith(decoder) {
903
+ this.decoder = typeof decoder === "function" ? { mapFromDriverValue: decoder } : decoder;
904
+ return this;
905
+ }
906
+ inlineParams() {
907
+ this.shouldInlineParams = true;
908
+ return this;
909
+ }
910
+ /**
911
+ * This method is used to conditionally include a part of the query.
912
+ *
913
+ * @param condition - Condition to check
914
+ * @returns itself if the condition is `true`, otherwise `undefined`
915
+ */
916
+ if(condition) {
917
+ return condition ? this : void 0;
918
+ }
919
+ };
920
+ var Name = class {
921
+ constructor(value) {
922
+ this.value = value;
923
+ }
924
+ static [entityKind] = "Name";
925
+ brand;
926
+ getSQL() {
927
+ return new SQL([this]);
928
+ }
929
+ };
930
+ function name(value) {
931
+ return new Name(value);
932
+ }
933
+ function isDriverValueEncoder(value) {
934
+ return typeof value === "object" && value !== null && "mapToDriverValue" in value && typeof value.mapToDriverValue === "function";
935
+ }
936
+ const noopDecoder = { mapFromDriverValue: (value) => value };
937
+ const noopEncoder = { mapToDriverValue: (value) => value };
938
+ const noopMapper = {
939
+ ...noopDecoder,
940
+ ...noopEncoder
941
+ };
942
+ var Param = class {
943
+ /**
944
+ * @param value - Parameter value
945
+ * @param encoder - Encoder to convert the value to a driver parameter
946
+ */
947
+ constructor(value, encoder = noopEncoder) {
948
+ this.value = value;
949
+ this.encoder = encoder;
950
+ }
951
+ static [entityKind] = "Param";
952
+ brand;
953
+ getSQL() {
954
+ return new SQL([this]);
955
+ }
956
+ };
957
+ function param(value, encoder) {
958
+ return new Param(value, encoder);
959
+ }
960
+ function sql(strings, ...params) {
961
+ const queryChunks = [];
962
+ if (params.length > 0 || strings.length > 0 && strings[0] !== "") queryChunks.push(new StringChunk(strings[0]));
963
+ for (const [paramIndex, param2] of params.entries()) queryChunks.push(param2, new StringChunk(strings[paramIndex + 1]));
964
+ return new SQL(queryChunks);
965
+ }
966
+ ((sql2) => {
967
+ function empty() {
968
+ return new SQL([]);
969
+ }
970
+ sql2.empty = empty;
971
+ function fromList(list) {
972
+ return new SQL(list);
973
+ }
974
+ sql2.fromList = fromList;
975
+ function raw(str) {
976
+ return new SQL([new StringChunk(str)]);
977
+ }
978
+ sql2.raw = raw;
979
+ function join(chunks, separator) {
980
+ const result = [];
981
+ for (const [i, chunk] of chunks.entries()) {
982
+ if (i > 0 && separator !== void 0) result.push(separator);
983
+ result.push(chunk);
984
+ }
985
+ return new SQL(result);
986
+ }
987
+ sql2.join = join;
988
+ function identifier(value) {
989
+ return new Name(value);
990
+ }
991
+ sql2.identifier = identifier;
992
+ function placeholder2(name2) {
993
+ return new Placeholder(name2);
994
+ }
995
+ sql2.placeholder = placeholder2;
996
+ function param2(value, encoder) {
997
+ return new Param(value, encoder);
998
+ }
999
+ sql2.param = param2;
1000
+ })(sql || (sql = {}));
1001
+ ((SQL2) => {
1002
+ class Aliased {
1003
+ constructor(sql2, fieldAlias) {
1004
+ this.sql = sql2;
1005
+ this.fieldAlias = fieldAlias;
1006
+ }
1007
+ static [entityKind] = "SQL.Aliased";
1008
+ /** @internal */
1009
+ isSelectionField = false;
1010
+ getSQL() {
1011
+ return this.sql;
1012
+ }
1013
+ /** @internal */
1014
+ clone() {
1015
+ return new Aliased(this.sql, this.fieldAlias);
1016
+ }
1017
+ }
1018
+ SQL2.Aliased = Aliased;
1019
+ })(SQL || (SQL = {}));
1020
+ var Placeholder = class {
1021
+ constructor(name2) {
1022
+ this.name = name2;
1023
+ }
1024
+ static [entityKind] = "Placeholder";
1025
+ getSQL() {
1026
+ return new SQL([this]);
1027
+ }
1028
+ };
1029
+ function placeholder(name2) {
1030
+ return new Placeholder(name2);
1031
+ }
1032
+ function fillPlaceholders(params, values) {
1033
+ return params.map((p) => {
1034
+ if (is(p, Placeholder)) {
1035
+ if (!(p.name in values)) throw new Error(`No value for placeholder "${p.name}" was provided`);
1036
+ return values[p.name];
1037
+ }
1038
+ if (is(p, Param) && is(p.value, Placeholder)) {
1039
+ if (!(p.value.name in values)) throw new Error(`No value for placeholder "${p.value.name}" was provided`);
1040
+ return p.encoder.mapToDriverValue(values[p.value.name]);
1041
+ }
1042
+ return p;
1043
+ });
1044
+ }
1045
+ const IsDrizzleView = Symbol.for("drizzle:IsDrizzleView");
1046
+ var View = class {
1047
+ static [entityKind] = "View";
1048
+ /** @internal */
1049
+ [ViewBaseConfig];
1050
+ /** @internal */
1051
+ [IsDrizzleView] = true;
1052
+ /** @internal */
1053
+ get [TableName]() {
1054
+ return this[ViewBaseConfig].name;
1055
+ }
1056
+ /** @internal */
1057
+ get [TableSchema]() {
1058
+ return this[ViewBaseConfig].schema;
1059
+ }
1060
+ /** @internal */
1061
+ get [IsAlias]() {
1062
+ return this[ViewBaseConfig].isAlias;
1063
+ }
1064
+ /** @internal */
1065
+ get [OriginalName]() {
1066
+ return this[ViewBaseConfig].originalName;
1067
+ }
1068
+ /** @internal */
1069
+ get [TableColumns]() {
1070
+ return this[ViewBaseConfig].selectedFields;
1071
+ }
1072
+ constructor({ name: name2, schema, selectedFields, query }) {
1073
+ this[ViewBaseConfig] = {
1074
+ name: name2,
1075
+ originalName: name2,
1076
+ schema,
1077
+ selectedFields,
1078
+ query,
1079
+ isExisting: !query,
1080
+ isAlias: false
1081
+ };
1082
+ }
1083
+ };
1084
+ function isView(view) {
1085
+ return typeof view === "object" && view !== null && IsDrizzleView in view;
1086
+ }
1087
+ function getViewName(view) {
1088
+ return view[ViewBaseConfig].name;
1089
+ }
1090
+ Column.prototype.getSQL = function() {
1091
+ return new SQL([this]);
1092
+ };
1093
+ Subquery.prototype.getSQL = function() {
1094
+ return new SQL([this]);
1095
+ };
1096
+
1097
+ //#endregion
1098
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/utils.js
1099
+ function mapResultRow(columns, row, joinsNotNullableMap) {
1100
+ const nullifyMap = {};
1101
+ const result = columns.reduce((result2, { path, field }, columnIndex) => {
1102
+ let decoder;
1103
+ if (is(field, Column)) decoder = field;
1104
+ else if (is(field, SQL)) decoder = field.decoder;
1105
+ else if (is(field, Subquery)) decoder = field._.sql.decoder;
1106
+ else decoder = field.sql.decoder;
1107
+ let node = result2;
1108
+ for (const [pathChunkIndex, pathChunk] of path.entries()) if (pathChunkIndex < path.length - 1) {
1109
+ if (!(pathChunk in node)) node[pathChunk] = {};
1110
+ node = node[pathChunk];
1111
+ } else {
1112
+ const rawValue = row[columnIndex];
1113
+ const value = node[pathChunk] = rawValue === null ? null : decoder.mapFromDriverValue(rawValue);
1114
+ if (joinsNotNullableMap && is(field, Column) && path.length === 2) {
1115
+ const objectName = path[0];
1116
+ if (!(objectName in nullifyMap)) nullifyMap[objectName] = value === null ? getTableName(field.table) : false;
1117
+ else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== getTableName(field.table)) nullifyMap[objectName] = false;
1118
+ }
1119
+ }
1120
+ return result2;
1121
+ }, {});
1122
+ if (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) {
1123
+ for (const [objectName, tableName] of Object.entries(nullifyMap)) if (typeof tableName === "string" && !joinsNotNullableMap[tableName]) result[objectName] = null;
1124
+ }
1125
+ return result;
1126
+ }
1127
+ function orderSelectedFields(fields, pathPrefix) {
1128
+ return Object.entries(fields).reduce((result, [name$1, field]) => {
1129
+ if (typeof name$1 !== "string") return result;
1130
+ const newPath = pathPrefix ? [...pathPrefix, name$1] : [name$1];
1131
+ if (is(field, Column) || is(field, SQL) || is(field, SQL.Aliased) || is(field, Subquery)) result.push({
1132
+ path: newPath,
1133
+ field
1134
+ });
1135
+ else if (is(field, Table)) result.push(...orderSelectedFields(field[Table.Symbol.Columns], newPath));
1136
+ else result.push(...orderSelectedFields(field, newPath));
1137
+ return result;
1138
+ }, []);
1139
+ }
1140
+ function haveSameKeys(left, right) {
1141
+ const leftKeys = Object.keys(left);
1142
+ const rightKeys = Object.keys(right);
1143
+ if (leftKeys.length !== rightKeys.length) return false;
1144
+ for (const [index, key] of leftKeys.entries()) if (key !== rightKeys[index]) return false;
1145
+ return true;
1146
+ }
1147
+ function mapUpdateSet(table, values) {
1148
+ const entries = Object.entries(values).filter(([, value]) => value !== void 0).map(([key, value]) => {
1149
+ if (is(value, SQL) || is(value, Column)) return [key, value];
1150
+ else return [key, new Param(value, table[Table.Symbol.Columns][key])];
1151
+ });
1152
+ if (entries.length === 0) throw new Error("No values to set");
1153
+ return Object.fromEntries(entries);
1154
+ }
1155
+ function applyMixins(baseClass, extendedClasses) {
1156
+ for (const extendedClass of extendedClasses) for (const name$1 of Object.getOwnPropertyNames(extendedClass.prototype)) {
1157
+ if (name$1 === "constructor") continue;
1158
+ Object.defineProperty(baseClass.prototype, name$1, Object.getOwnPropertyDescriptor(extendedClass.prototype, name$1) || /* @__PURE__ */ Object.create(null));
1159
+ }
1160
+ }
1161
+ function getTableColumns(table) {
1162
+ return table[Table.Symbol.Columns];
1163
+ }
1164
+ function getViewSelectedFields(view) {
1165
+ return view[ViewBaseConfig].selectedFields;
1166
+ }
1167
+ function getColumns(table) {
1168
+ return is(table, Table) ? table[Table.Symbol.Columns] : is(table, View) ? table[ViewBaseConfig].selectedFields : table._.selectedFields;
1169
+ }
1170
+ function getTableLikeName(table) {
1171
+ return is(table, Subquery) ? table._.alias : is(table, View) ? table[ViewBaseConfig].name : is(table, SQL) ? void 0 : table[Table.Symbol.IsAlias] ? table[Table.Symbol.Name] : table[Table.Symbol.BaseName];
1172
+ }
1173
+ function getColumnNameAndConfig(a, b) {
1174
+ return {
1175
+ name: typeof a === "string" && a.length > 0 ? a : "",
1176
+ config: typeof a === "object" ? a : b
1177
+ };
1178
+ }
1179
+ function isConfig(data) {
1180
+ if (typeof data !== "object" || data === null) return false;
1181
+ if (data.constructor.name !== "Object") return false;
1182
+ if ("logger" in data) {
1183
+ const type = typeof data["logger"];
1184
+ if (type !== "boolean" && (type !== "object" || typeof data["logger"]["logQuery"] !== "function") && type !== "undefined") return false;
1185
+ return true;
1186
+ }
1187
+ if ("schema" in data) {
1188
+ const type = typeof data["schema"];
1189
+ if (type !== "object" && type !== "undefined") return false;
1190
+ return true;
1191
+ }
1192
+ if ("relations" in data) {
1193
+ const type = typeof data["relations"];
1194
+ if (type !== "object" && type !== "undefined") return false;
1195
+ return true;
1196
+ }
1197
+ if ("casing" in data) {
1198
+ const type = typeof data["casing"];
1199
+ if (type !== "string" && type !== "undefined") return false;
1200
+ return true;
1201
+ }
1202
+ if ("mode" in data) {
1203
+ if (data["mode"] !== "default" || data["mode"] !== "planetscale" || data["mode"] !== void 0) return false;
1204
+ return true;
1205
+ }
1206
+ if ("connection" in data) {
1207
+ const type = typeof data["connection"];
1208
+ if (type !== "string" && type !== "object" && type !== "undefined") return false;
1209
+ return true;
1210
+ }
1211
+ if ("client" in data) {
1212
+ const type = typeof data["client"];
1213
+ if (type !== "object" && type !== "function" && type !== "undefined") return false;
1214
+ return true;
1215
+ }
1216
+ if (Object.keys(data).length === 0) return true;
1217
+ return false;
1218
+ }
1219
+ const textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder();
1220
+
1221
+ //#endregion
1222
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/int.common.js
1223
+ var PgIntColumnBaseBuilder = class extends PgColumnBuilder {
1224
+ static [entityKind] = "PgIntColumnBaseBuilder";
1225
+ generatedAlwaysAsIdentity(sequence) {
1226
+ if (sequence) {
1227
+ const { name: name$1, ...options } = sequence;
1228
+ this.config.generatedIdentity = {
1229
+ type: "always",
1230
+ sequenceName: name$1,
1231
+ sequenceOptions: options
1232
+ };
1233
+ } else this.config.generatedIdentity = { type: "always" };
1234
+ this.config.hasDefault = true;
1235
+ this.config.notNull = true;
1236
+ return this;
1237
+ }
1238
+ generatedByDefaultAsIdentity(sequence) {
1239
+ if (sequence) {
1240
+ const { name: name$1, ...options } = sequence;
1241
+ this.config.generatedIdentity = {
1242
+ type: "byDefault",
1243
+ sequenceName: name$1,
1244
+ sequenceOptions: options
1245
+ };
1246
+ } else this.config.generatedIdentity = { type: "byDefault" };
1247
+ this.config.hasDefault = true;
1248
+ this.config.notNull = true;
1249
+ return this;
1250
+ }
1251
+ };
1252
+
1253
+ //#endregion
1254
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/bigint.js
1255
+ var PgBigInt53Builder = class extends PgIntColumnBaseBuilder {
1256
+ static [entityKind] = "PgBigInt53Builder";
1257
+ constructor(name$1) {
1258
+ super(name$1, "number int53", "PgBigInt53");
1259
+ }
1260
+ /** @internal */
1261
+ build(table) {
1262
+ return new PgBigInt53(table, this.config);
1263
+ }
1264
+ };
1265
+ var PgBigInt53 = class extends PgColumn {
1266
+ static [entityKind] = "PgBigInt53";
1267
+ getSQLType() {
1268
+ return "bigint";
1269
+ }
1270
+ mapFromDriverValue(value) {
1271
+ if (typeof value === "number") return value;
1272
+ return Number(value);
1273
+ }
1274
+ };
1275
+ var PgBigInt64Builder = class extends PgIntColumnBaseBuilder {
1276
+ static [entityKind] = "PgBigInt64Builder";
1277
+ constructor(name$1) {
1278
+ super(name$1, "bigint int64", "PgBigInt64");
1279
+ }
1280
+ /** @internal */
1281
+ build(table) {
1282
+ return new PgBigInt64(table, this.config);
1283
+ }
1284
+ };
1285
+ var PgBigInt64 = class extends PgColumn {
1286
+ static [entityKind] = "PgBigInt64";
1287
+ getSQLType() {
1288
+ return "bigint";
1289
+ }
1290
+ mapFromDriverValue(value) {
1291
+ return BigInt(value);
1292
+ }
1293
+ };
1294
+ var PgBigIntStringBuilder = class extends PgIntColumnBaseBuilder {
1295
+ static [entityKind] = "PgBigIntStringBuilder";
1296
+ constructor(name$1) {
1297
+ super(name$1, "string int64", "PgBigIntString");
1298
+ }
1299
+ /** @internal */
1300
+ build(table) {
1301
+ return new PgBigIntString(table, this.config);
1302
+ }
1303
+ };
1304
+ var PgBigIntString = class extends PgColumn {
1305
+ static [entityKind] = "PgBigIntString";
1306
+ getSQLType() {
1307
+ return "bigint";
1308
+ }
1309
+ mapFromDriverValue(value) {
1310
+ if (typeof value === "string") return value;
1311
+ return String(value);
1312
+ }
1313
+ };
1314
+ function bigint(a, b) {
1315
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
1316
+ if (config.mode === "number") return new PgBigInt53Builder(name$1);
1317
+ if (config.mode === "string") return new PgBigIntStringBuilder(name$1);
1318
+ return new PgBigInt64Builder(name$1);
1319
+ }
1320
+
1321
+ //#endregion
1322
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/bigserial.js
1323
+ var PgBigSerial53Builder = class extends PgColumnBuilder {
1324
+ static [entityKind] = "PgBigSerial53Builder";
1325
+ constructor(name$1) {
1326
+ super(name$1, "number int53", "PgBigSerial53");
1327
+ this.config.hasDefault = true;
1328
+ this.config.notNull = true;
1329
+ }
1330
+ /** @internal */
1331
+ build(table) {
1332
+ return new PgBigSerial53(table, this.config);
1333
+ }
1334
+ };
1335
+ var PgBigSerial53 = class extends PgColumn {
1336
+ static [entityKind] = "PgBigSerial53";
1337
+ getSQLType() {
1338
+ return "bigserial";
1339
+ }
1340
+ mapFromDriverValue(value) {
1341
+ if (typeof value === "number") return value;
1342
+ return Number(value);
1343
+ }
1344
+ };
1345
+ var PgBigSerial64Builder = class extends PgColumnBuilder {
1346
+ static [entityKind] = "PgBigSerial64Builder";
1347
+ constructor(name$1) {
1348
+ super(name$1, "bigint int64", "PgBigSerial64");
1349
+ this.config.hasDefault = true;
1350
+ this.config.notNull = true;
1351
+ }
1352
+ /** @internal */
1353
+ build(table) {
1354
+ return new PgBigSerial64(table, this.config);
1355
+ }
1356
+ };
1357
+ var PgBigSerial64 = class extends PgColumn {
1358
+ static [entityKind] = "PgBigSerial64";
1359
+ getSQLType() {
1360
+ return "bigserial";
1361
+ }
1362
+ mapFromDriverValue(value) {
1363
+ return BigInt(value);
1364
+ }
1365
+ };
1366
+ function bigserial(a, b) {
1367
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
1368
+ if (config.mode === "number") return new PgBigSerial53Builder(name$1);
1369
+ return new PgBigSerial64Builder(name$1);
1370
+ }
1371
+
1372
+ //#endregion
1373
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/boolean.js
1374
+ var PgBooleanBuilder = class extends PgColumnBuilder {
1375
+ static [entityKind] = "PgBooleanBuilder";
1376
+ constructor(name$1) {
1377
+ super(name$1, "boolean", "PgBoolean");
1378
+ }
1379
+ /** @internal */
1380
+ build(table) {
1381
+ return new PgBoolean(table, this.config);
1382
+ }
1383
+ };
1384
+ var PgBoolean = class extends PgColumn {
1385
+ static [entityKind] = "PgBoolean";
1386
+ getSQLType() {
1387
+ return "boolean";
1388
+ }
1389
+ };
1390
+ function boolean(name$1) {
1391
+ return new PgBooleanBuilder(name$1 ?? "");
1392
+ }
1393
+
1394
+ //#endregion
1395
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/char.js
1396
+ var PgCharBuilder = class extends PgColumnBuilder {
1397
+ static [entityKind] = "PgCharBuilder";
1398
+ constructor(name$1, config) {
1399
+ super(name$1, config.enum?.length ? "string enum" : "string", "PgChar");
1400
+ this.config.length = config.length ?? 1;
1401
+ this.config.setLength = config.length !== void 0;
1402
+ this.config.enumValues = config.enum;
1403
+ }
1404
+ /** @internal */
1405
+ build(table) {
1406
+ return new PgChar(table, this.config);
1407
+ }
1408
+ };
1409
+ var PgChar = class extends PgColumn {
1410
+ static [entityKind] = "PgChar";
1411
+ enumValues = this.config.enumValues;
1412
+ getSQLType() {
1413
+ return this.config.setLength ? `char(${this.length})` : `char`;
1414
+ }
1415
+ };
1416
+ function char(a, b = {}) {
1417
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
1418
+ return new PgCharBuilder(name$1, config);
1419
+ }
1420
+
1421
+ //#endregion
1422
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/cidr.js
1423
+ var PgCidrBuilder = class extends PgColumnBuilder {
1424
+ static [entityKind] = "PgCidrBuilder";
1425
+ constructor(name$1) {
1426
+ super(name$1, "string cidr", "PgCidr");
1427
+ }
1428
+ /** @internal */
1429
+ build(table) {
1430
+ return new PgCidr(table, this.config);
1431
+ }
1432
+ };
1433
+ var PgCidr = class extends PgColumn {
1434
+ static [entityKind] = "PgCidr";
1435
+ getSQLType() {
1436
+ return "cidr";
1437
+ }
1438
+ };
1439
+ function cidr(name$1) {
1440
+ return new PgCidrBuilder(name$1 ?? "");
1441
+ }
1442
+
1443
+ //#endregion
1444
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/custom.js
1445
+ var PgCustomColumnBuilder = class extends PgColumnBuilder {
1446
+ static [entityKind] = "PgCustomColumnBuilder";
1447
+ constructor(name$1, fieldConfig, customTypeParams) {
1448
+ super(name$1, "custom", "PgCustomColumn");
1449
+ this.config.fieldConfig = fieldConfig;
1450
+ this.config.customTypeParams = customTypeParams;
1451
+ }
1452
+ /** @internal */
1453
+ build(table) {
1454
+ return new PgCustomColumn(table, this.config);
1455
+ }
1456
+ };
1457
+ var PgCustomColumn = class extends PgColumn {
1458
+ static [entityKind] = "PgCustomColumn";
1459
+ sqlName;
1460
+ mapTo;
1461
+ mapFrom;
1462
+ mapJson;
1463
+ forJsonSelect;
1464
+ constructor(table, config) {
1465
+ super(table, config);
1466
+ this.sqlName = config.customTypeParams.dataType(config.fieldConfig);
1467
+ this.mapTo = config.customTypeParams.toDriver;
1468
+ this.mapFrom = config.customTypeParams.fromDriver;
1469
+ this.mapJson = config.customTypeParams.fromJson;
1470
+ this.forJsonSelect = config.customTypeParams.forJsonSelect;
1471
+ }
1472
+ getSQLType() {
1473
+ return this.sqlName;
1474
+ }
1475
+ mapFromDriverValue(value) {
1476
+ return typeof this.mapFrom === "function" ? this.mapFrom(value) : value;
1477
+ }
1478
+ mapFromJsonValue(value) {
1479
+ return typeof this.mapJson === "function" ? this.mapJson(value) : this.mapFromDriverValue(value);
1480
+ }
1481
+ jsonSelectIdentifier(identifier, sql$1, arrayDimensions) {
1482
+ if (typeof this.forJsonSelect === "function") return this.forJsonSelect(identifier, sql$1, arrayDimensions);
1483
+ const rawType = this.getSQLType().toLowerCase();
1484
+ const parenPos = rawType.indexOf("(");
1485
+ switch (parenPos + 1 ? rawType.slice(0, parenPos) : rawType) {
1486
+ case "bytea":
1487
+ case "geometry":
1488
+ case "timestamp":
1489
+ case "numeric":
1490
+ case "bigint": {
1491
+ const arrVal = "[]".repeat(arrayDimensions ?? 0);
1492
+ return sql$1`${identifier}::text${sql$1.raw(arrVal).if(arrayDimensions)}`;
1493
+ }
1494
+ default: return identifier;
1495
+ }
1496
+ }
1497
+ mapToDriverValue(value) {
1498
+ return typeof this.mapTo === "function" ? this.mapTo(value) : value;
1499
+ }
1500
+ };
1501
+ function customType(customTypeParams) {
1502
+ return (a, b) => {
1503
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
1504
+ return new PgCustomColumnBuilder(name$1, config, customTypeParams);
1505
+ };
1506
+ }
1507
+
1508
+ //#endregion
1509
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/date.common.js
1510
+ var PgDateColumnBaseBuilder = class extends PgColumnBuilder {
1511
+ static [entityKind] = "PgDateColumnBaseBuilder";
1512
+ defaultNow() {
1513
+ return this.default(sql`now()`);
1514
+ }
1515
+ };
1516
+
1517
+ //#endregion
1518
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/date.js
1519
+ var PgDateBuilder = class extends PgDateColumnBaseBuilder {
1520
+ static [entityKind] = "PgDateBuilder";
1521
+ constructor(name$1) {
1522
+ super(name$1, "object date", "PgDate");
1523
+ }
1524
+ /** @internal */
1525
+ build(table) {
1526
+ return new PgDate(table, this.config);
1527
+ }
1528
+ };
1529
+ var PgDate = class extends PgColumn {
1530
+ static [entityKind] = "PgDate";
1531
+ getSQLType() {
1532
+ return "date";
1533
+ }
1534
+ mapFromDriverValue(value) {
1535
+ if (typeof value === "string") return new Date(value);
1536
+ return value;
1537
+ }
1538
+ mapToDriverValue(value) {
1539
+ if (typeof value === "string") return value;
1540
+ return value.toISOString();
1541
+ }
1542
+ };
1543
+ var PgDateStringBuilder = class extends PgDateColumnBaseBuilder {
1544
+ static [entityKind] = "PgDateStringBuilder";
1545
+ constructor(name$1) {
1546
+ super(name$1, "string date", "PgDateString");
1547
+ }
1548
+ /** @internal */
1549
+ build(table) {
1550
+ return new PgDateString(table, this.config);
1551
+ }
1552
+ };
1553
+ var PgDateString = class extends PgColumn {
1554
+ static [entityKind] = "PgDateString";
1555
+ getSQLType() {
1556
+ return "date";
1557
+ }
1558
+ mapFromDriverValue(value) {
1559
+ if (typeof value === "string") return value;
1560
+ return value.toISOString().slice(0, -14);
1561
+ }
1562
+ mapToDriverValue(value) {
1563
+ if (typeof value === "string") return value;
1564
+ return value.toISOString();
1565
+ }
1566
+ };
1567
+ function date(a, b) {
1568
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
1569
+ if (config?.mode === "date") return new PgDateBuilder(name$1);
1570
+ return new PgDateStringBuilder(name$1);
1571
+ }
1572
+
1573
+ //#endregion
1574
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/double-precision.js
1575
+ var PgDoublePrecisionBuilder = class extends PgColumnBuilder {
1576
+ static [entityKind] = "PgDoublePrecisionBuilder";
1577
+ constructor(name$1) {
1578
+ super(name$1, "number double", "PgDoublePrecision");
1579
+ }
1580
+ /** @internal */
1581
+ build(table) {
1582
+ return new PgDoublePrecision(table, this.config);
1583
+ }
1584
+ };
1585
+ var PgDoublePrecision = class extends PgColumn {
1586
+ static [entityKind] = "PgDoublePrecision";
1587
+ getSQLType() {
1588
+ return "double precision";
1589
+ }
1590
+ mapFromDriverValue(value) {
1591
+ if (typeof value === "string") return Number.parseFloat(value);
1592
+ return value;
1593
+ }
1594
+ };
1595
+ function doublePrecision(name$1) {
1596
+ return new PgDoublePrecisionBuilder(name$1 ?? "");
1597
+ }
1598
+
1599
+ //#endregion
1600
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/inet.js
1601
+ var PgInetBuilder = class extends PgColumnBuilder {
1602
+ static [entityKind] = "PgInetBuilder";
1603
+ constructor(name$1) {
1604
+ super(name$1, "string inet", "PgInet");
1605
+ }
1606
+ /** @internal */
1607
+ build(table) {
1608
+ return new PgInet(table, this.config);
1609
+ }
1610
+ };
1611
+ var PgInet = class extends PgColumn {
1612
+ static [entityKind] = "PgInet";
1613
+ getSQLType() {
1614
+ return "inet";
1615
+ }
1616
+ };
1617
+ function inet(name$1) {
1618
+ return new PgInetBuilder(name$1 ?? "");
1619
+ }
1620
+
1621
+ //#endregion
1622
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/integer.js
1623
+ var PgIntegerBuilder = class extends PgIntColumnBaseBuilder {
1624
+ static [entityKind] = "PgIntegerBuilder";
1625
+ constructor(name$1) {
1626
+ super(name$1, "number int32", "PgInteger");
1627
+ }
1628
+ /** @internal */
1629
+ build(table) {
1630
+ return new PgInteger(table, this.config);
1631
+ }
1632
+ };
1633
+ var PgInteger = class extends PgColumn {
1634
+ static [entityKind] = "PgInteger";
1635
+ getSQLType() {
1636
+ return "integer";
1637
+ }
1638
+ mapFromDriverValue(value) {
1639
+ if (typeof value === "string") return Number.parseInt(value);
1640
+ return value;
1641
+ }
1642
+ };
1643
+ function integer(name$1) {
1644
+ return new PgIntegerBuilder(name$1 ?? "");
1645
+ }
1646
+
1647
+ //#endregion
1648
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/interval.js
1649
+ var PgIntervalBuilder = class extends PgColumnBuilder {
1650
+ static [entityKind] = "PgIntervalBuilder";
1651
+ constructor(name$1, intervalConfig) {
1652
+ super(name$1, "string interval", "PgInterval");
1653
+ this.config.intervalConfig = intervalConfig;
1654
+ }
1655
+ /** @internal */
1656
+ build(table) {
1657
+ return new PgInterval(table, this.config);
1658
+ }
1659
+ };
1660
+ var PgInterval = class extends PgColumn {
1661
+ static [entityKind] = "PgInterval";
1662
+ fields = this.config.intervalConfig.fields;
1663
+ precision = this.config.intervalConfig.precision;
1664
+ getSQLType() {
1665
+ return `interval${this.fields ? ` ${this.fields}` : ""}${this.precision ? `(${this.precision})` : ""}`;
1666
+ }
1667
+ };
1668
+ function interval(a, b = {}) {
1669
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
1670
+ return new PgIntervalBuilder(name$1, config);
1671
+ }
1672
+
1673
+ //#endregion
1674
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/json.js
1675
+ var PgJsonBuilder = class extends PgColumnBuilder {
1676
+ static [entityKind] = "PgJsonBuilder";
1677
+ constructor(name$1) {
1678
+ super(name$1, "object json", "PgJson");
1679
+ }
1680
+ /** @internal */
1681
+ build(table) {
1682
+ return new PgJson(table, this.config);
1683
+ }
1684
+ };
1685
+ var PgJson = class extends PgColumn {
1686
+ static [entityKind] = "PgJson";
1687
+ constructor(table, config) {
1688
+ super(table, config);
1689
+ }
1690
+ getSQLType() {
1691
+ return "json";
1692
+ }
1693
+ mapToDriverValue(value) {
1694
+ return JSON.stringify(value);
1695
+ }
1696
+ mapFromDriverValue(value) {
1697
+ if (typeof value === "string") try {
1698
+ return JSON.parse(value);
1699
+ } catch {
1700
+ return value;
1701
+ }
1702
+ return value;
1703
+ }
1704
+ };
1705
+ function json(name$1) {
1706
+ return new PgJsonBuilder(name$1 ?? "");
1707
+ }
1708
+
1709
+ //#endregion
1710
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/jsonb.js
1711
+ var PgJsonbBuilder = class extends PgColumnBuilder {
1712
+ static [entityKind] = "PgJsonbBuilder";
1713
+ constructor(name$1) {
1714
+ super(name$1, "object json", "PgJsonb");
1715
+ }
1716
+ /** @internal */
1717
+ build(table) {
1718
+ return new PgJsonb(table, this.config);
1719
+ }
1720
+ };
1721
+ var PgJsonb = class extends PgColumn {
1722
+ static [entityKind] = "PgJsonb";
1723
+ constructor(table, config) {
1724
+ super(table, config);
1725
+ }
1726
+ getSQLType() {
1727
+ return "jsonb";
1728
+ }
1729
+ mapToDriverValue(value) {
1730
+ return JSON.stringify(value);
1731
+ }
1732
+ mapFromDriverValue(value) {
1733
+ if (typeof value === "string") try {
1734
+ return JSON.parse(value);
1735
+ } catch {
1736
+ return value;
1737
+ }
1738
+ return value;
1739
+ }
1740
+ };
1741
+ function jsonb(name$1) {
1742
+ return new PgJsonbBuilder(name$1 ?? "");
1743
+ }
1744
+
1745
+ //#endregion
1746
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/line.js
1747
+ var PgLineBuilder = class extends PgColumnBuilder {
1748
+ static [entityKind] = "PgLineBuilder";
1749
+ constructor(name$1) {
1750
+ super(name$1, "array line", "PgLine");
1751
+ }
1752
+ /** @internal */
1753
+ build(table) {
1754
+ return new PgLineTuple(table, this.config);
1755
+ }
1756
+ };
1757
+ var PgLineTuple = class extends PgColumn {
1758
+ static [entityKind] = "PgLine";
1759
+ mode = "tuple";
1760
+ getSQLType() {
1761
+ return "line";
1762
+ }
1763
+ mapFromDriverValue(value) {
1764
+ const [a, b, c] = value.slice(1, -1).split(",");
1765
+ return [
1766
+ Number.parseFloat(a),
1767
+ Number.parseFloat(b),
1768
+ Number.parseFloat(c)
1769
+ ];
1770
+ }
1771
+ mapToDriverValue(value) {
1772
+ return `{${value[0]},${value[1]},${value[2]}}`;
1773
+ }
1774
+ };
1775
+ var PgLineABCBuilder = class extends PgColumnBuilder {
1776
+ static [entityKind] = "PgLineABCBuilder";
1777
+ constructor(name$1) {
1778
+ super(name$1, "object line", "PgLineABC");
1779
+ }
1780
+ /** @internal */
1781
+ build(table) {
1782
+ return new PgLineABC(table, this.config);
1783
+ }
1784
+ };
1785
+ var PgLineABC = class extends PgColumn {
1786
+ static [entityKind] = "PgLineABC";
1787
+ mode = "abc";
1788
+ getSQLType() {
1789
+ return "line";
1790
+ }
1791
+ mapFromDriverValue(value) {
1792
+ const [a, b, c] = value.slice(1, -1).split(",");
1793
+ return {
1794
+ a: Number.parseFloat(a),
1795
+ b: Number.parseFloat(b),
1796
+ c: Number.parseFloat(c)
1797
+ };
1798
+ }
1799
+ mapToDriverValue(value) {
1800
+ return `{${value.a},${value.b},${value.c}}`;
1801
+ }
1802
+ };
1803
+ function line(a, b) {
1804
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
1805
+ if (!config?.mode || config.mode === "tuple") return new PgLineBuilder(name$1);
1806
+ return new PgLineABCBuilder(name$1);
1807
+ }
1808
+
1809
+ //#endregion
1810
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/macaddr.js
1811
+ var PgMacaddrBuilder = class extends PgColumnBuilder {
1812
+ static [entityKind] = "PgMacaddrBuilder";
1813
+ constructor(name$1) {
1814
+ super(name$1, "string macaddr", "PgMacaddr");
1815
+ }
1816
+ /** @internal */
1817
+ build(table) {
1818
+ return new PgMacaddr(table, this.config);
1819
+ }
1820
+ };
1821
+ var PgMacaddr = class extends PgColumn {
1822
+ static [entityKind] = "PgMacaddr";
1823
+ getSQLType() {
1824
+ return "macaddr";
1825
+ }
1826
+ };
1827
+ function macaddr(name$1) {
1828
+ return new PgMacaddrBuilder(name$1 ?? "");
1829
+ }
1830
+
1831
+ //#endregion
1832
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/macaddr8.js
1833
+ var PgMacaddr8Builder = class extends PgColumnBuilder {
1834
+ static [entityKind] = "PgMacaddr8Builder";
1835
+ constructor(name$1) {
1836
+ super(name$1, "string macaddr8", "PgMacaddr8");
1837
+ }
1838
+ /** @internal */
1839
+ build(table) {
1840
+ return new PgMacaddr8(table, this.config);
1841
+ }
1842
+ };
1843
+ var PgMacaddr8 = class extends PgColumn {
1844
+ static [entityKind] = "PgMacaddr8";
1845
+ getSQLType() {
1846
+ return "macaddr8";
1847
+ }
1848
+ };
1849
+ function macaddr8(name$1) {
1850
+ return new PgMacaddr8Builder(name$1 ?? "");
1851
+ }
1852
+
1853
+ //#endregion
1854
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/numeric.js
1855
+ var PgNumericBuilder = class extends PgColumnBuilder {
1856
+ static [entityKind] = "PgNumericBuilder";
1857
+ constructor(name$1, precision, scale) {
1858
+ super(name$1, "string numeric", "PgNumeric");
1859
+ this.config.precision = precision;
1860
+ this.config.scale = scale;
1861
+ }
1862
+ /** @internal */
1863
+ build(table) {
1864
+ return new PgNumeric(table, this.config);
1865
+ }
1866
+ };
1867
+ var PgNumeric = class extends PgColumn {
1868
+ static [entityKind] = "PgNumeric";
1869
+ precision;
1870
+ scale;
1871
+ constructor(table, config) {
1872
+ super(table, config);
1873
+ this.precision = config.precision;
1874
+ this.scale = config.scale;
1875
+ }
1876
+ mapFromDriverValue(value) {
1877
+ if (typeof value === "string") return value;
1878
+ return String(value);
1879
+ }
1880
+ getSQLType() {
1881
+ if (this.precision !== void 0 && this.scale !== void 0) return `numeric(${this.precision}, ${this.scale})`;
1882
+ else if (this.precision === void 0) return "numeric";
1883
+ else return `numeric(${this.precision})`;
1884
+ }
1885
+ };
1886
+ var PgNumericNumberBuilder = class extends PgColumnBuilder {
1887
+ static [entityKind] = "PgNumericNumberBuilder";
1888
+ constructor(name$1, precision, scale) {
1889
+ super(name$1, "number", "PgNumericNumber");
1890
+ this.config.precision = precision;
1891
+ this.config.scale = scale;
1892
+ }
1893
+ /** @internal */
1894
+ build(table) {
1895
+ return new PgNumericNumber(table, this.config);
1896
+ }
1897
+ };
1898
+ var PgNumericNumber = class extends PgColumn {
1899
+ static [entityKind] = "PgNumericNumber";
1900
+ precision;
1901
+ scale;
1902
+ constructor(table, config) {
1903
+ super(table, config);
1904
+ this.precision = config.precision;
1905
+ this.scale = config.scale;
1906
+ }
1907
+ mapFromDriverValue(value) {
1908
+ if (typeof value === "number") return value;
1909
+ return Number(value);
1910
+ }
1911
+ mapToDriverValue = String;
1912
+ getSQLType() {
1913
+ if (this.precision !== void 0 && this.scale !== void 0) return `numeric(${this.precision}, ${this.scale})`;
1914
+ else if (this.precision === void 0) return "numeric";
1915
+ else return `numeric(${this.precision})`;
1916
+ }
1917
+ };
1918
+ var PgNumericBigIntBuilder = class extends PgColumnBuilder {
1919
+ static [entityKind] = "PgNumericBigIntBuilder";
1920
+ constructor(name$1, precision, scale) {
1921
+ super(name$1, "bigint int64", "PgNumericBigInt");
1922
+ this.config.precision = precision;
1923
+ this.config.scale = scale;
1924
+ }
1925
+ /** @internal */
1926
+ build(table) {
1927
+ return new PgNumericBigInt(table, this.config);
1928
+ }
1929
+ };
1930
+ var PgNumericBigInt = class extends PgColumn {
1931
+ static [entityKind] = "PgNumericBigInt";
1932
+ precision;
1933
+ scale;
1934
+ constructor(table, config) {
1935
+ super(table, config);
1936
+ this.precision = config.precision;
1937
+ this.scale = config.scale;
1938
+ }
1939
+ mapFromDriverValue = BigInt;
1940
+ mapToDriverValue = String;
1941
+ getSQLType() {
1942
+ if (this.precision !== void 0 && this.scale !== void 0) return `numeric(${this.precision}, ${this.scale})`;
1943
+ else if (this.precision === void 0) return "numeric";
1944
+ else return `numeric(${this.precision})`;
1945
+ }
1946
+ };
1947
+ function numeric(a, b) {
1948
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
1949
+ const mode = config?.mode;
1950
+ return mode === "number" ? new PgNumericNumberBuilder(name$1, config?.precision, config?.scale) : mode === "bigint" ? new PgNumericBigIntBuilder(name$1, config?.precision, config?.scale) : new PgNumericBuilder(name$1, config?.precision, config?.scale);
1951
+ }
1952
+
1953
+ //#endregion
1954
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/point.js
1955
+ var PgPointTupleBuilder = class extends PgColumnBuilder {
1956
+ static [entityKind] = "PgPointTupleBuilder";
1957
+ constructor(name$1) {
1958
+ super(name$1, "array point", "PgPointTuple");
1959
+ }
1960
+ /** @internal */
1961
+ build(table) {
1962
+ return new PgPointTuple(table, this.config);
1963
+ }
1964
+ };
1965
+ var PgPointTuple = class extends PgColumn {
1966
+ static [entityKind] = "PgPointTuple";
1967
+ mode = "tuple";
1968
+ getSQLType() {
1969
+ return "point";
1970
+ }
1971
+ mapFromDriverValue(value) {
1972
+ if (typeof value === "string") {
1973
+ const [x, y] = value.slice(1, -1).split(",");
1974
+ return [Number.parseFloat(x), Number.parseFloat(y)];
1975
+ }
1976
+ return [value.x, value.y];
1977
+ }
1978
+ mapToDriverValue(value) {
1979
+ return `(${value[0]},${value[1]})`;
1980
+ }
1981
+ };
1982
+ var PgPointObjectBuilder = class extends PgColumnBuilder {
1983
+ static [entityKind] = "PgPointObjectBuilder";
1984
+ constructor(name$1) {
1985
+ super(name$1, "object point", "PgPointObject");
1986
+ }
1987
+ /** @internal */
1988
+ build(table) {
1989
+ return new PgPointObject(table, this.config);
1990
+ }
1991
+ };
1992
+ var PgPointObject = class extends PgColumn {
1993
+ static [entityKind] = "PgPointObject";
1994
+ mode = "xy";
1995
+ getSQLType() {
1996
+ return "point";
1997
+ }
1998
+ mapFromDriverValue(value) {
1999
+ if (typeof value === "string") {
2000
+ const [x, y] = value.slice(1, -1).split(",");
2001
+ return {
2002
+ x: Number.parseFloat(x),
2003
+ y: Number.parseFloat(y)
2004
+ };
2005
+ }
2006
+ return value;
2007
+ }
2008
+ mapToDriverValue(value) {
2009
+ return `(${value.x},${value.y})`;
2010
+ }
2011
+ };
2012
+ function point(a, b) {
2013
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2014
+ if (!config?.mode || config.mode === "tuple") return new PgPointTupleBuilder(name$1);
2015
+ return new PgPointObjectBuilder(name$1);
2016
+ }
2017
+
2018
+ //#endregion
2019
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/postgis_extension/utils.js
2020
+ function hexToBytes(hex) {
2021
+ const bytes = [];
2022
+ for (let c = 0; c < hex.length; c += 2) bytes.push(Number.parseInt(hex.slice(c, c + 2), 16));
2023
+ return new Uint8Array(bytes);
2024
+ }
2025
+ function bytesToFloat64(bytes, offset) {
2026
+ const buffer = /* @__PURE__ */ new ArrayBuffer(8);
2027
+ const view = new DataView(buffer);
2028
+ for (let i = 0; i < 8; i++) view.setUint8(i, bytes[offset + i]);
2029
+ return view.getFloat64(0, true);
2030
+ }
2031
+ function parseEWKB(hex) {
2032
+ const bytes = hexToBytes(hex);
2033
+ let offset = 0;
2034
+ const byteOrder = bytes[offset];
2035
+ offset += 1;
2036
+ const view = new DataView(bytes.buffer);
2037
+ const geomType = view.getUint32(offset, byteOrder === 1);
2038
+ offset += 4;
2039
+ let srid;
2040
+ if (geomType & 536870912) {
2041
+ srid = view.getUint32(offset, byteOrder === 1);
2042
+ offset += 4;
2043
+ }
2044
+ if ((geomType & 65535) === 1) {
2045
+ const x = bytesToFloat64(bytes, offset);
2046
+ offset += 8;
2047
+ const y = bytesToFloat64(bytes, offset);
2048
+ offset += 8;
2049
+ return {
2050
+ srid,
2051
+ point: [x, y]
2052
+ };
2053
+ }
2054
+ throw new Error("Unsupported geometry type");
2055
+ }
2056
+
2057
+ //#endregion
2058
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/postgis_extension/geometry.js
2059
+ var PgGeometryBuilder = class extends PgColumnBuilder {
2060
+ static [entityKind] = "PgGeometryBuilder";
2061
+ constructor(name$1, srid) {
2062
+ super(name$1, "array geometry", "PgGeometry");
2063
+ this.config.srid = srid;
2064
+ }
2065
+ /** @internal */
2066
+ build(table) {
2067
+ return new PgGeometry(table, this.config);
2068
+ }
2069
+ };
2070
+ var PgGeometry = class extends PgColumn {
2071
+ static [entityKind] = "PgGeometry";
2072
+ srid = this.config.srid;
2073
+ mode = "tuple";
2074
+ getSQLType() {
2075
+ return `geometry(point${this.srid === void 0 ? "" : `,${this.srid}`})`;
2076
+ }
2077
+ mapFromDriverValue(value) {
2078
+ if (typeof value !== "string") return value;
2079
+ return parseEWKB(value).point;
2080
+ }
2081
+ mapToDriverValue(value) {
2082
+ return `point(${value[0]} ${value[1]})`;
2083
+ }
2084
+ };
2085
+ var PgGeometryObjectBuilder = class extends PgColumnBuilder {
2086
+ static [entityKind] = "PgGeometryObjectBuilder";
2087
+ constructor(name$1, srid) {
2088
+ super(name$1, "object geometry", "PgGeometryObject");
2089
+ this.config.srid = srid;
2090
+ }
2091
+ /** @internal */
2092
+ build(table) {
2093
+ return new PgGeometryObject(table, this.config);
2094
+ }
2095
+ };
2096
+ var PgGeometryObject = class extends PgColumn {
2097
+ static [entityKind] = "PgGeometryObject";
2098
+ srid = this.config.srid;
2099
+ mode = "object";
2100
+ getSQLType() {
2101
+ return `geometry(point${this.srid === void 0 ? "" : `,${this.srid}`})`;
2102
+ }
2103
+ mapFromDriverValue(value) {
2104
+ const parsed = parseEWKB(value);
2105
+ return {
2106
+ x: parsed.point[0],
2107
+ y: parsed.point[1]
2108
+ };
2109
+ }
2110
+ mapToDriverValue(value) {
2111
+ return `point(${value.x} ${value.y})`;
2112
+ }
2113
+ };
2114
+ function geometry(a, b) {
2115
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2116
+ if (!config?.mode || config.mode === "tuple") return new PgGeometryBuilder(name$1, config?.srid);
2117
+ return new PgGeometryObjectBuilder(name$1, config?.srid);
2118
+ }
2119
+
2120
+ //#endregion
2121
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/real.js
2122
+ var PgRealBuilder = class extends PgColumnBuilder {
2123
+ static [entityKind] = "PgRealBuilder";
2124
+ constructor(name$1, length) {
2125
+ super(name$1, "number float", "PgReal");
2126
+ this.config.length = length;
2127
+ }
2128
+ /** @internal */
2129
+ build(table) {
2130
+ return new PgReal(table, this.config);
2131
+ }
2132
+ };
2133
+ var PgReal = class extends PgColumn {
2134
+ static [entityKind] = "PgReal";
2135
+ constructor(table, config) {
2136
+ super(table, config);
2137
+ }
2138
+ getSQLType() {
2139
+ return "real";
2140
+ }
2141
+ mapFromDriverValue = (value) => {
2142
+ if (typeof value === "string") return Number.parseFloat(value);
2143
+ return value;
2144
+ };
2145
+ };
2146
+ function real(name$1) {
2147
+ return new PgRealBuilder(name$1 ?? "");
2148
+ }
2149
+
2150
+ //#endregion
2151
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/serial.js
2152
+ var PgSerialBuilder = class extends PgColumnBuilder {
2153
+ static [entityKind] = "PgSerialBuilder";
2154
+ constructor(name$1) {
2155
+ super(name$1, "number int32", "PgSerial");
2156
+ this.config.hasDefault = true;
2157
+ this.config.notNull = true;
2158
+ }
2159
+ /** @internal */
2160
+ build(table) {
2161
+ return new PgSerial(table, this.config);
2162
+ }
2163
+ };
2164
+ var PgSerial = class extends PgColumn {
2165
+ static [entityKind] = "PgSerial";
2166
+ getSQLType() {
2167
+ return "serial";
2168
+ }
2169
+ };
2170
+ function serial(name$1) {
2171
+ return new PgSerialBuilder(name$1 ?? "");
2172
+ }
2173
+
2174
+ //#endregion
2175
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/smallint.js
2176
+ var PgSmallIntBuilder = class extends PgIntColumnBaseBuilder {
2177
+ static [entityKind] = "PgSmallIntBuilder";
2178
+ constructor(name$1) {
2179
+ super(name$1, "number int16", "PgSmallInt");
2180
+ }
2181
+ /** @internal */
2182
+ build(table) {
2183
+ return new PgSmallInt(table, this.config);
2184
+ }
2185
+ };
2186
+ var PgSmallInt = class extends PgColumn {
2187
+ static [entityKind] = "PgSmallInt";
2188
+ getSQLType() {
2189
+ return "smallint";
2190
+ }
2191
+ mapFromDriverValue = (value) => {
2192
+ if (typeof value === "string") return Number(value);
2193
+ return value;
2194
+ };
2195
+ };
2196
+ function smallint(name$1) {
2197
+ return new PgSmallIntBuilder(name$1 ?? "");
2198
+ }
2199
+
2200
+ //#endregion
2201
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/smallserial.js
2202
+ var PgSmallSerialBuilder = class extends PgColumnBuilder {
2203
+ static [entityKind] = "PgSmallSerialBuilder";
2204
+ constructor(name$1) {
2205
+ super(name$1, "number int16", "PgSmallSerial");
2206
+ this.config.hasDefault = true;
2207
+ this.config.notNull = true;
2208
+ }
2209
+ /** @internal */
2210
+ build(table) {
2211
+ return new PgSmallSerial(table, this.config);
2212
+ }
2213
+ };
2214
+ var PgSmallSerial = class extends PgColumn {
2215
+ static [entityKind] = "PgSmallSerial";
2216
+ getSQLType() {
2217
+ return "smallserial";
2218
+ }
2219
+ };
2220
+ function smallserial(name$1) {
2221
+ return new PgSmallSerialBuilder(name$1 ?? "");
2222
+ }
2223
+
2224
+ //#endregion
2225
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/text.js
2226
+ var PgTextBuilder = class extends PgColumnBuilder {
2227
+ static [entityKind] = "PgTextBuilder";
2228
+ constructor(name$1, config) {
2229
+ super(name$1, config.enum?.length ? "string enum" : "string", "PgText");
2230
+ this.config.enumValues = config.enum;
2231
+ }
2232
+ /** @internal */
2233
+ build(table) {
2234
+ return new PgText(table, this.config, this.config.enumValues);
2235
+ }
2236
+ };
2237
+ var PgText = class extends PgColumn {
2238
+ static [entityKind] = "PgText";
2239
+ enumValues;
2240
+ constructor(table, config, enumValues) {
2241
+ super(table, config);
2242
+ this.enumValues = enumValues;
2243
+ }
2244
+ getSQLType() {
2245
+ return "text";
2246
+ }
2247
+ };
2248
+ function text(a, b = {}) {
2249
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2250
+ return new PgTextBuilder(name$1, config);
2251
+ }
2252
+
2253
+ //#endregion
2254
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/time.js
2255
+ var PgTimeBuilder = class extends PgDateColumnBaseBuilder {
2256
+ constructor(name$1, withTimezone, precision) {
2257
+ super(name$1, "string time", "PgTime");
2258
+ this.withTimezone = withTimezone;
2259
+ this.precision = precision;
2260
+ this.config.withTimezone = withTimezone;
2261
+ this.config.precision = precision;
2262
+ }
2263
+ static [entityKind] = "PgTimeBuilder";
2264
+ /** @internal */
2265
+ build(table) {
2266
+ return new PgTime(table, this.config);
2267
+ }
2268
+ };
2269
+ var PgTime = class extends PgColumn {
2270
+ static [entityKind] = "PgTime";
2271
+ withTimezone;
2272
+ precision;
2273
+ constructor(table, config) {
2274
+ super(table, config);
2275
+ this.withTimezone = config.withTimezone;
2276
+ this.precision = config.precision;
2277
+ }
2278
+ getSQLType() {
2279
+ return `time${this.precision === void 0 ? "" : `(${this.precision})`}${this.withTimezone ? " with time zone" : ""}`;
2280
+ }
2281
+ };
2282
+ function time(a, b = {}) {
2283
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2284
+ return new PgTimeBuilder(name$1, config.withTimezone ?? false, config.precision);
2285
+ }
2286
+
2287
+ //#endregion
2288
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/timestamp.js
2289
+ var PgTimestampBuilder = class extends PgDateColumnBaseBuilder {
2290
+ static [entityKind] = "PgTimestampBuilder";
2291
+ constructor(name$1, withTimezone, precision) {
2292
+ super(name$1, "object date", "PgTimestamp");
2293
+ this.config.withTimezone = withTimezone;
2294
+ this.config.precision = precision;
2295
+ }
2296
+ /** @internal */
2297
+ build(table) {
2298
+ return new PgTimestamp(table, this.config);
2299
+ }
2300
+ };
2301
+ var PgTimestamp = class extends PgColumn {
2302
+ static [entityKind] = "PgTimestamp";
2303
+ withTimezone;
2304
+ precision;
2305
+ constructor(table, config) {
2306
+ super(table, config);
2307
+ this.withTimezone = config.withTimezone;
2308
+ this.precision = config.precision;
2309
+ }
2310
+ getSQLType() {
2311
+ return `timestamp${this.precision === void 0 ? "" : ` (${this.precision})`}${this.withTimezone ? " with time zone" : ""}`;
2312
+ }
2313
+ mapFromDriverValue(value) {
2314
+ if (typeof value === "string") return new Date(this.withTimezone ? value : value + "+0000");
2315
+ return value;
2316
+ }
2317
+ mapToDriverValue(value) {
2318
+ if (typeof value === "string") return value;
2319
+ return value.toISOString();
2320
+ }
2321
+ };
2322
+ var PgTimestampStringBuilder = class extends PgDateColumnBaseBuilder {
2323
+ static [entityKind] = "PgTimestampStringBuilder";
2324
+ constructor(name$1, withTimezone, precision) {
2325
+ super(name$1, "string timestamp", "PgTimestampString");
2326
+ this.config.withTimezone = withTimezone;
2327
+ this.config.precision = precision;
2328
+ }
2329
+ /** @internal */
2330
+ build(table) {
2331
+ return new PgTimestampString(table, this.config);
2332
+ }
2333
+ };
2334
+ var PgTimestampString = class extends PgColumn {
2335
+ static [entityKind] = "PgTimestampString";
2336
+ withTimezone;
2337
+ precision;
2338
+ constructor(table, config) {
2339
+ super(table, config);
2340
+ this.withTimezone = config.withTimezone;
2341
+ this.precision = config.precision;
2342
+ }
2343
+ getSQLType() {
2344
+ return `timestamp${this.precision === void 0 ? "" : `(${this.precision})`}${this.withTimezone ? " with time zone" : ""}`;
2345
+ }
2346
+ mapFromDriverValue(value) {
2347
+ if (typeof value === "string") return value;
2348
+ const shortened = value.toISOString().slice(0, -1).replace("T", " ");
2349
+ if (this.withTimezone) {
2350
+ const offset = value.getTimezoneOffset();
2351
+ return `${shortened}${offset <= 0 ? "+" : "-"}${Math.floor(Math.abs(offset) / 60).toString().padStart(2, "0")}`;
2352
+ }
2353
+ return shortened;
2354
+ }
2355
+ mapToDriverValue(value) {
2356
+ if (typeof value === "string") return value;
2357
+ return value.toISOString();
2358
+ }
2359
+ };
2360
+ function timestamp(a, b = {}) {
2361
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2362
+ if (config?.mode === "string") return new PgTimestampStringBuilder(name$1, config.withTimezone ?? false, config.precision);
2363
+ return new PgTimestampBuilder(name$1, config?.withTimezone ?? false, config?.precision);
2364
+ }
2365
+
2366
+ //#endregion
2367
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/uuid.js
2368
+ var PgUUIDBuilder = class extends PgColumnBuilder {
2369
+ static [entityKind] = "PgUUIDBuilder";
2370
+ constructor(name$1) {
2371
+ super(name$1, "string uuid", "PgUUID");
2372
+ }
2373
+ /**
2374
+ * Adds `default gen_random_uuid()` to the column definition.
2375
+ */
2376
+ defaultRandom() {
2377
+ return this.default(sql`gen_random_uuid()`);
2378
+ }
2379
+ /** @internal */
2380
+ build(table) {
2381
+ return new PgUUID(table, this.config);
2382
+ }
2383
+ };
2384
+ var PgUUID = class extends PgColumn {
2385
+ static [entityKind] = "PgUUID";
2386
+ getSQLType() {
2387
+ return "uuid";
2388
+ }
2389
+ };
2390
+ function uuid(name$1) {
2391
+ return new PgUUIDBuilder(name$1 ?? "");
2392
+ }
2393
+
2394
+ //#endregion
2395
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/varchar.js
2396
+ var PgVarcharBuilder = class extends PgColumnBuilder {
2397
+ static [entityKind] = "PgVarcharBuilder";
2398
+ constructor(name$1, config) {
2399
+ super(name$1, config.enum?.length ? "string enum" : "string", "PgVarchar");
2400
+ this.config.length = config.length;
2401
+ this.config.enumValues = config.enum;
2402
+ }
2403
+ /** @internal */
2404
+ build(table) {
2405
+ return new PgVarchar(table, this.config);
2406
+ }
2407
+ };
2408
+ var PgVarchar = class extends PgColumn {
2409
+ static [entityKind] = "PgVarchar";
2410
+ enumValues = this.config.enumValues;
2411
+ getSQLType() {
2412
+ return this.length === void 0 ? `varchar` : `varchar(${this.length})`;
2413
+ }
2414
+ };
2415
+ function varchar(a, b = {}) {
2416
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2417
+ return new PgVarcharBuilder(name$1, config);
2418
+ }
2419
+
2420
+ //#endregion
2421
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/vector_extension/bit.js
2422
+ var PgBinaryVectorBuilder = class extends PgColumnBuilder {
2423
+ static [entityKind] = "PgBinaryVectorBuilder";
2424
+ constructor(name$1, config) {
2425
+ super(name$1, "string binary", "PgBinaryVector");
2426
+ this.config.length = config.dimensions;
2427
+ this.config.isLengthExact = true;
2428
+ }
2429
+ /** @internal */
2430
+ build(table) {
2431
+ return new PgBinaryVector(table, this.config);
2432
+ }
2433
+ };
2434
+ var PgBinaryVector = class extends PgColumn {
2435
+ static [entityKind] = "PgBinaryVector";
2436
+ getSQLType() {
2437
+ return `bit(${this.length})`;
2438
+ }
2439
+ };
2440
+ function bit(a, b) {
2441
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2442
+ return new PgBinaryVectorBuilder(name$1, config);
2443
+ }
2444
+
2445
+ //#endregion
2446
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/vector_extension/halfvec.js
2447
+ var PgHalfVectorBuilder = class extends PgColumnBuilder {
2448
+ static [entityKind] = "PgHalfVectorBuilder";
2449
+ constructor(name$1, config) {
2450
+ super(name$1, "array halfvector", "PgHalfVector");
2451
+ this.config.length = config.dimensions;
2452
+ this.config.isLengthExact = true;
2453
+ }
2454
+ /** @internal */
2455
+ build(table) {
2456
+ return new PgHalfVector(table, this.config);
2457
+ }
2458
+ };
2459
+ var PgHalfVector = class extends PgColumn {
2460
+ static [entityKind] = "PgHalfVector";
2461
+ getSQLType() {
2462
+ return `halfvec(${this.length})`;
2463
+ }
2464
+ mapToDriverValue(value) {
2465
+ return JSON.stringify(value);
2466
+ }
2467
+ mapFromDriverValue(value) {
2468
+ return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
2469
+ }
2470
+ };
2471
+ function halfvec(a, b) {
2472
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2473
+ return new PgHalfVectorBuilder(name$1, config);
2474
+ }
2475
+
2476
+ //#endregion
2477
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/vector_extension/sparsevec.js
2478
+ var PgSparseVectorBuilder = class extends PgColumnBuilder {
2479
+ static [entityKind] = "PgSparseVectorBuilder";
2480
+ constructor(name$1, config) {
2481
+ super(name$1, "string sparsevec", "PgSparseVector");
2482
+ this.config.dimensions = config.dimensions;
2483
+ }
2484
+ /** @internal */
2485
+ build(table) {
2486
+ return new PgSparseVector(table, this.config);
2487
+ }
2488
+ };
2489
+ var PgSparseVector = class extends PgColumn {
2490
+ static [entityKind] = "PgSparseVector";
2491
+ dimensions = this.config.dimensions;
2492
+ getSQLType() {
2493
+ return `sparsevec(${this.dimensions})`;
2494
+ }
2495
+ };
2496
+ function sparsevec(a, b) {
2497
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2498
+ return new PgSparseVectorBuilder(name$1, config);
2499
+ }
2500
+
2501
+ //#endregion
2502
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/vector_extension/vector.js
2503
+ var PgVectorBuilder = class extends PgColumnBuilder {
2504
+ static [entityKind] = "PgVectorBuilder";
2505
+ constructor(name$1, config) {
2506
+ super(name$1, "array vector", "PgVector");
2507
+ this.config.length = config.dimensions;
2508
+ this.config.isLengthExact = true;
2509
+ }
2510
+ /** @internal */
2511
+ build(table) {
2512
+ return new PgVector(table, this.config);
2513
+ }
2514
+ };
2515
+ var PgVector = class extends PgColumn {
2516
+ static [entityKind] = "PgVector";
2517
+ getSQLType() {
2518
+ return `vector(${this.length})`;
2519
+ }
2520
+ mapToDriverValue(value) {
2521
+ return JSON.stringify(value);
2522
+ }
2523
+ mapFromDriverValue(value) {
2524
+ return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
2525
+ }
2526
+ };
2527
+ function vector(a, b) {
2528
+ const { name: name$1, config } = getColumnNameAndConfig(a, b);
2529
+ return new PgVectorBuilder(name$1, config);
2530
+ }
2531
+
2532
+ //#endregion
2533
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/columns/all.js
2534
+ function getPgColumnBuilders() {
2535
+ return {
2536
+ bigint,
2537
+ bigserial,
2538
+ boolean,
2539
+ char,
2540
+ cidr,
2541
+ customType,
2542
+ date,
2543
+ doublePrecision,
2544
+ inet,
2545
+ integer,
2546
+ interval,
2547
+ json,
2548
+ jsonb,
2549
+ line,
2550
+ macaddr,
2551
+ macaddr8,
2552
+ numeric,
2553
+ point,
2554
+ geometry,
2555
+ real,
2556
+ serial,
2557
+ smallint,
2558
+ smallserial,
2559
+ text,
2560
+ time,
2561
+ timestamp,
2562
+ uuid,
2563
+ varchar,
2564
+ bit,
2565
+ halfvec,
2566
+ sparsevec,
2567
+ vector
2568
+ };
2569
+ }
2570
+
2571
+ //#endregion
2572
+ //#region ../../node_modules/.bun/drizzle-orm@1.0.0-beta.2-f9236e3+94f63afaebaec8a7/node_modules/drizzle-orm/pg-core/table.js
2573
+ const InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
2574
+ const EnableRLS = Symbol.for("drizzle:EnableRLS");
2575
+ var PgTable = class extends Table {
2576
+ static [entityKind] = "PgTable";
2577
+ /** @internal */
2578
+ static Symbol = Object.assign({}, Table.Symbol, {
2579
+ InlineForeignKeys,
2580
+ EnableRLS
2581
+ });
2582
+ /**@internal */
2583
+ [InlineForeignKeys] = [];
2584
+ /** @internal */
2585
+ [EnableRLS] = false;
2586
+ /** @internal */
2587
+ [Table.Symbol.ExtraConfigBuilder] = void 0;
2588
+ /** @internal */
2589
+ [Table.Symbol.ExtraConfigColumns] = {};
2590
+ };
2591
+ function pgTableWithSchema(name$1, columns, extraConfig, schema, baseName = name$1) {
2592
+ const rawTable = new PgTable(name$1, schema, baseName);
2593
+ const parsedColumns = typeof columns === "function" ? columns(getPgColumnBuilders()) : columns;
2594
+ const builtColumns = Object.fromEntries(Object.entries(parsedColumns).map(([name2, colBuilderBase]) => {
2595
+ const colBuilder = colBuilderBase;
2596
+ colBuilder.setName(name2);
2597
+ const column = colBuilder.build(rawTable);
2598
+ rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable));
2599
+ return [name2, column];
2600
+ }));
2601
+ const builtColumnsForExtraConfig = Object.fromEntries(Object.entries(parsedColumns).map(([name2, colBuilderBase]) => {
2602
+ const colBuilder = colBuilderBase;
2603
+ colBuilder.setName(name2);
2604
+ return [name2, colBuilder.buildExtraConfigColumn(rawTable)];
2605
+ }));
2606
+ const table = Object.assign(rawTable, builtColumns);
2607
+ table[Table.Symbol.Columns] = builtColumns;
2608
+ table[Table.Symbol.ExtraConfigColumns] = builtColumnsForExtraConfig;
2609
+ if (extraConfig) table[PgTable.Symbol.ExtraConfigBuilder] = extraConfig;
2610
+ return Object.assign(table, { enableRLS: () => {
2611
+ table[PgTable.Symbol.EnableRLS] = true;
2612
+ return table;
2613
+ } });
2614
+ }
2615
+ const pgTableInternal = (name$1, columns, extraConfig) => {
2616
+ return pgTableWithSchema(name$1, columns, extraConfig, void 0);
2617
+ };
2618
+ const pgTableWithRLS = (name$1, columns, extraConfig) => {
2619
+ const table = pgTableWithSchema(name$1, columns, extraConfig, void 0);
2620
+ table[EnableRLS] = true;
2621
+ return table;
2622
+ };
2623
+ const pgTable = Object.assign(pgTableInternal, { withRLS: pgTableWithRLS });
2624
+ function pgTableCreator(customizeTableName) {
2625
+ const fn = (name$1, columns, extraConfig) => {
2626
+ return pgTableWithSchema(customizeTableName(name$1), columns, extraConfig, void 0, name$1);
2627
+ };
2628
+ return Object.assign(fn, { withRLS: ((name$1, columns, extraConfig) => {
2629
+ const table = pgTableWithSchema(customizeTableName(name$1), columns, extraConfig, void 0, name$1);
2630
+ table[EnableRLS] = true;
2631
+ return table;
2632
+ }) });
2633
+ }
2634
+
2635
+ //#endregion
2636
+ export { ExtraConfigColumns as $, orderSelectedFields as A, is as At, getViewName as B, getTableColumns as C, TableName as Ct, isConfig as D, getColumnTable as Dt, haveSameKeys as E, Column as Et, Placeholder as F, noopDecoder as G, isSQLWrapper as H, SQL as I, param as J, noopEncoder as K, StringChunk as L, FakePrimitiveParam as M, Name as N, mapResultRow as O, entityKind as Ot, Param as P, ExtraConfigBuilder as Q, View as R, getColumns as S, ForeignKeyBuilder as St, getViewSelectedFields as T, extractExtendedColumnType as Tt, isView as U, isDriverValueEncoder as V, name as W, sql as X, placeholder as Y, BaseName as Z, PgJson as _, PgArray as _t, pgTableWithSchema as a, getTableName as at, applyMixins as b, parsePgNestedArray as bt, PgTimestamp as c, ViewBaseConfig as ct, smallserial as d, WithSubquery as dt, IsAlias as et, smallint as f, isPgEnum as ft, PgJsonb as g, IndexedColumn as gt, numeric as h, pgEnumWithSchema as ht, pgTableCreator as i, TableSchema as it, textDecoder as j, OriginalColumn as jt, mapUpdateSet as k, hasOwnEntityKind as kt, PgTimestampString as l, tracer as lt, PgNumeric as m, pgEnumObjectWithSchema as mt, PgTable as n, Table as nt, sparsevec as o, getTableUniqueName as ot, serial as p, pgEnum as pt, noopMapper as q, pgTable as r, TableColumns as rt, PgUUID as s, isTable as st, EnableRLS as t, OriginalName as tt, PgTime as u, Subquery as ut, PgDate as v, PgColumn as vt, getTableLikeName as w, ColumnBuilder as wt, getColumnNameAndConfig as x, iife as xt, PgDateString as y, parsePgArray as yt, fillPlaceholders as z };