drizzle-orm 1.0.0-beta.1-84d9a79 → 1.0.0-beta.1-9fb1d0d

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 (1221) hide show
  1. package/aws-data-api/common/index.d.cts +1 -1
  2. package/aws-data-api/common/index.d.ts +1 -1
  3. package/aws-data-api/pg/driver.cjs +1 -1
  4. package/aws-data-api/pg/driver.cjs.map +1 -1
  5. package/aws-data-api/pg/driver.js +1 -1
  6. package/aws-data-api/pg/driver.js.map +1 -1
  7. package/aws-data-api/pg/session.cjs.map +1 -1
  8. package/aws-data-api/pg/session.d.cts +6 -6
  9. package/aws-data-api/pg/session.d.ts +6 -6
  10. package/aws-data-api/pg/session.js.map +1 -1
  11. package/better-sqlite3/driver.cjs +1 -1
  12. package/better-sqlite3/driver.cjs.map +1 -1
  13. package/better-sqlite3/driver.js +1 -1
  14. package/better-sqlite3/driver.js.map +1 -1
  15. package/better-sqlite3/session.cjs.map +1 -1
  16. package/better-sqlite3/session.d.cts +6 -6
  17. package/better-sqlite3/session.d.ts +6 -6
  18. package/better-sqlite3/session.js.map +1 -1
  19. package/bun-sql/driver.cjs +1 -1
  20. package/bun-sql/driver.cjs.map +1 -1
  21. package/bun-sql/driver.js +1 -1
  22. package/bun-sql/driver.js.map +1 -1
  23. package/bun-sql/migrator.cjs.map +1 -1
  24. package/bun-sql/migrator.d.cts +2 -2
  25. package/bun-sql/migrator.d.ts +2 -2
  26. package/bun-sql/migrator.js.map +1 -1
  27. package/bun-sql/session.cjs.map +1 -1
  28. package/bun-sql/session.d.cts +7 -7
  29. package/bun-sql/session.d.ts +7 -7
  30. package/bun-sql/session.js.map +1 -1
  31. package/bun-sqlite/driver.cjs +1 -1
  32. package/bun-sqlite/driver.cjs.map +1 -1
  33. package/bun-sqlite/driver.js +1 -1
  34. package/bun-sqlite/driver.js.map +1 -1
  35. package/bun-sqlite/session.cjs.map +1 -1
  36. package/bun-sqlite/session.d.cts +6 -6
  37. package/bun-sqlite/session.d.ts +6 -6
  38. package/bun-sqlite/session.js.map +1 -1
  39. package/column-builder.cjs +9 -2
  40. package/column-builder.cjs.map +1 -1
  41. package/column-builder.d.cts +50 -65
  42. package/column-builder.d.ts +50 -65
  43. package/column-builder.js +7 -1
  44. package/column-builder.js.map +1 -1
  45. package/column.cjs +37 -21
  46. package/column.cjs.map +1 -1
  47. package/column.d.cts +20 -32
  48. package/column.d.ts +20 -32
  49. package/column.js +35 -20
  50. package/column.js.map +1 -1
  51. package/d1/driver.cjs +1 -1
  52. package/d1/driver.cjs.map +1 -1
  53. package/d1/driver.js +1 -1
  54. package/d1/driver.js.map +1 -1
  55. package/d1/session.cjs.map +1 -1
  56. package/d1/session.d.cts +6 -6
  57. package/d1/session.d.ts +6 -6
  58. package/d1/session.js.map +1 -1
  59. package/durable-sqlite/driver.cjs +1 -1
  60. package/durable-sqlite/driver.cjs.map +1 -1
  61. package/durable-sqlite/driver.js +1 -1
  62. package/durable-sqlite/driver.js.map +1 -1
  63. package/durable-sqlite/session.cjs.map +1 -1
  64. package/durable-sqlite/session.d.cts +6 -6
  65. package/durable-sqlite/session.d.ts +6 -6
  66. package/durable-sqlite/session.js.map +1 -1
  67. package/expo-sqlite/driver.cjs +1 -1
  68. package/expo-sqlite/driver.cjs.map +1 -1
  69. package/expo-sqlite/driver.js +1 -1
  70. package/expo-sqlite/driver.js.map +1 -1
  71. package/expo-sqlite/session.cjs.map +1 -1
  72. package/expo-sqlite/session.d.cts +6 -6
  73. package/expo-sqlite/session.d.ts +6 -6
  74. package/expo-sqlite/session.js.map +1 -1
  75. package/gel/driver.cjs +1 -1
  76. package/gel/driver.cjs.map +1 -1
  77. package/gel/driver.d.cts +2 -2
  78. package/gel/driver.d.ts +2 -2
  79. package/gel/driver.js +1 -1
  80. package/gel/driver.js.map +1 -1
  81. package/gel/session.cjs.map +1 -1
  82. package/gel/session.d.cts +6 -6
  83. package/gel/session.d.ts +6 -6
  84. package/gel/session.js.map +1 -1
  85. package/gel-core/columns/bigint.cjs +1 -1
  86. package/gel-core/columns/bigint.cjs.map +1 -1
  87. package/gel-core/columns/bigint.d.cts +7 -12
  88. package/gel-core/columns/bigint.d.ts +7 -12
  89. package/gel-core/columns/bigint.js +1 -1
  90. package/gel-core/columns/bigint.js.map +1 -1
  91. package/gel-core/columns/bigintT.cjs +1 -1
  92. package/gel-core/columns/bigintT.cjs.map +1 -1
  93. package/gel-core/columns/bigintT.d.cts +7 -12
  94. package/gel-core/columns/bigintT.d.ts +7 -12
  95. package/gel-core/columns/bigintT.js +1 -1
  96. package/gel-core/columns/bigintT.js.map +1 -1
  97. package/gel-core/columns/boolean.cjs.map +1 -1
  98. package/gel-core/columns/boolean.d.cts +6 -11
  99. package/gel-core/columns/boolean.d.ts +6 -11
  100. package/gel-core/columns/boolean.js.map +1 -1
  101. package/gel-core/columns/bytes.cjs +1 -1
  102. package/gel-core/columns/bytes.cjs.map +1 -1
  103. package/gel-core/columns/bytes.d.cts +7 -12
  104. package/gel-core/columns/bytes.d.ts +7 -12
  105. package/gel-core/columns/bytes.js +1 -1
  106. package/gel-core/columns/bytes.js.map +1 -1
  107. package/gel-core/columns/common.cjs +9 -9
  108. package/gel-core/columns/common.cjs.map +1 -1
  109. package/gel-core/columns/common.d.cts +24 -41
  110. package/gel-core/columns/common.d.ts +24 -41
  111. package/gel-core/columns/common.js +9 -9
  112. package/gel-core/columns/common.js.map +1 -1
  113. package/gel-core/columns/custom.cjs.map +1 -1
  114. package/gel-core/columns/custom.d.cts +10 -14
  115. package/gel-core/columns/custom.d.ts +10 -14
  116. package/gel-core/columns/custom.js.map +1 -1
  117. package/gel-core/columns/date-duration.cjs +1 -1
  118. package/gel-core/columns/date-duration.cjs.map +1 -1
  119. package/gel-core/columns/date-duration.d.cts +7 -12
  120. package/gel-core/columns/date-duration.d.ts +7 -12
  121. package/gel-core/columns/date-duration.js +1 -1
  122. package/gel-core/columns/date-duration.js.map +1 -1
  123. package/gel-core/columns/date.common.cjs.map +1 -1
  124. package/gel-core/columns/date.common.d.cts +2 -2
  125. package/gel-core/columns/date.common.d.ts +2 -2
  126. package/gel-core/columns/date.common.js.map +1 -1
  127. package/gel-core/columns/decimal.cjs +1 -1
  128. package/gel-core/columns/decimal.cjs.map +1 -1
  129. package/gel-core/columns/decimal.d.cts +8 -13
  130. package/gel-core/columns/decimal.d.ts +8 -13
  131. package/gel-core/columns/decimal.js +1 -1
  132. package/gel-core/columns/decimal.js.map +1 -1
  133. package/gel-core/columns/double-precision.cjs +1 -1
  134. package/gel-core/columns/double-precision.cjs.map +1 -1
  135. package/gel-core/columns/double-precision.d.cts +7 -12
  136. package/gel-core/columns/double-precision.d.ts +7 -12
  137. package/gel-core/columns/double-precision.js +1 -1
  138. package/gel-core/columns/double-precision.js.map +1 -1
  139. package/gel-core/columns/duration.cjs +1 -1
  140. package/gel-core/columns/duration.cjs.map +1 -1
  141. package/gel-core/columns/duration.d.cts +7 -12
  142. package/gel-core/columns/duration.d.ts +7 -12
  143. package/gel-core/columns/duration.js +1 -1
  144. package/gel-core/columns/duration.js.map +1 -1
  145. package/gel-core/columns/int.common.cjs.map +1 -1
  146. package/gel-core/columns/int.common.d.cts +2 -2
  147. package/gel-core/columns/int.common.d.ts +2 -2
  148. package/gel-core/columns/int.common.js.map +1 -1
  149. package/gel-core/columns/integer.cjs +1 -1
  150. package/gel-core/columns/integer.cjs.map +1 -1
  151. package/gel-core/columns/integer.d.cts +7 -12
  152. package/gel-core/columns/integer.d.ts +7 -12
  153. package/gel-core/columns/integer.js +1 -1
  154. package/gel-core/columns/integer.js.map +1 -1
  155. package/gel-core/columns/json.cjs +1 -1
  156. package/gel-core/columns/json.cjs.map +1 -1
  157. package/gel-core/columns/json.d.cts +8 -13
  158. package/gel-core/columns/json.d.ts +8 -13
  159. package/gel-core/columns/json.js +1 -1
  160. package/gel-core/columns/json.js.map +1 -1
  161. package/gel-core/columns/localdate.cjs +1 -1
  162. package/gel-core/columns/localdate.cjs.map +1 -1
  163. package/gel-core/columns/localdate.d.cts +7 -12
  164. package/gel-core/columns/localdate.d.ts +7 -12
  165. package/gel-core/columns/localdate.js +1 -1
  166. package/gel-core/columns/localdate.js.map +1 -1
  167. package/gel-core/columns/localtime.cjs +1 -1
  168. package/gel-core/columns/localtime.cjs.map +1 -1
  169. package/gel-core/columns/localtime.d.cts +7 -12
  170. package/gel-core/columns/localtime.d.ts +7 -12
  171. package/gel-core/columns/localtime.js +1 -1
  172. package/gel-core/columns/localtime.js.map +1 -1
  173. package/gel-core/columns/real.cjs +1 -1
  174. package/gel-core/columns/real.cjs.map +1 -1
  175. package/gel-core/columns/real.d.cts +8 -13
  176. package/gel-core/columns/real.d.ts +8 -13
  177. package/gel-core/columns/real.js +1 -1
  178. package/gel-core/columns/real.js.map +1 -1
  179. package/gel-core/columns/relative-duration.cjs +1 -1
  180. package/gel-core/columns/relative-duration.cjs.map +1 -1
  181. package/gel-core/columns/relative-duration.d.cts +7 -12
  182. package/gel-core/columns/relative-duration.d.ts +7 -12
  183. package/gel-core/columns/relative-duration.js +1 -1
  184. package/gel-core/columns/relative-duration.js.map +1 -1
  185. package/gel-core/columns/smallint.cjs +1 -1
  186. package/gel-core/columns/smallint.cjs.map +1 -1
  187. package/gel-core/columns/smallint.d.cts +7 -12
  188. package/gel-core/columns/smallint.d.ts +7 -12
  189. package/gel-core/columns/smallint.js +1 -1
  190. package/gel-core/columns/smallint.js.map +1 -1
  191. package/gel-core/columns/text.cjs.map +1 -1
  192. package/gel-core/columns/text.d.cts +6 -12
  193. package/gel-core/columns/text.d.ts +6 -12
  194. package/gel-core/columns/text.js.map +1 -1
  195. package/gel-core/columns/timestamp.cjs +1 -1
  196. package/gel-core/columns/timestamp.cjs.map +1 -1
  197. package/gel-core/columns/timestamp.d.cts +8 -13
  198. package/gel-core/columns/timestamp.d.ts +8 -13
  199. package/gel-core/columns/timestamp.js +1 -1
  200. package/gel-core/columns/timestamp.js.map +1 -1
  201. package/gel-core/columns/timestamptz.cjs +1 -1
  202. package/gel-core/columns/timestamptz.cjs.map +1 -1
  203. package/gel-core/columns/timestamptz.d.cts +8 -13
  204. package/gel-core/columns/timestamptz.d.ts +8 -13
  205. package/gel-core/columns/timestamptz.js +1 -1
  206. package/gel-core/columns/timestamptz.js.map +1 -1
  207. package/gel-core/columns/uuid.cjs +1 -1
  208. package/gel-core/columns/uuid.cjs.map +1 -1
  209. package/gel-core/columns/uuid.d.cts +7 -12
  210. package/gel-core/columns/uuid.d.ts +7 -12
  211. package/gel-core/columns/uuid.js +1 -1
  212. package/gel-core/columns/uuid.js.map +1 -1
  213. package/gel-core/db.cjs +10 -15
  214. package/gel-core/db.cjs.map +1 -1
  215. package/gel-core/db.d.cts +8 -8
  216. package/gel-core/db.d.ts +8 -8
  217. package/gel-core/db.js +10 -15
  218. package/gel-core/db.js.map +1 -1
  219. package/gel-core/dialect.cjs +13 -13
  220. package/gel-core/dialect.cjs.map +1 -1
  221. package/gel-core/dialect.d.cts +1 -3
  222. package/gel-core/dialect.d.ts +1 -3
  223. package/gel-core/dialect.js +14 -14
  224. package/gel-core/dialect.js.map +1 -1
  225. package/gel-core/query-builders/delete.cjs.map +1 -1
  226. package/gel-core/query-builders/delete.js.map +1 -1
  227. package/gel-core/query-builders/insert.cjs +1 -1
  228. package/gel-core/query-builders/insert.cjs.map +1 -1
  229. package/gel-core/query-builders/insert.d.cts +2 -2
  230. package/gel-core/query-builders/insert.d.ts +2 -2
  231. package/gel-core/query-builders/insert.js +2 -2
  232. package/gel-core/query-builders/insert.js.map +1 -1
  233. package/gel-core/query-builders/query.cjs +2 -12
  234. package/gel-core/query-builders/query.cjs.map +1 -1
  235. package/gel-core/query-builders/query.d.cts +2 -6
  236. package/gel-core/query-builders/query.d.ts +2 -6
  237. package/gel-core/query-builders/query.js +2 -12
  238. package/gel-core/query-builders/query.js.map +1 -1
  239. package/gel-core/query-builders/select.types.cjs.map +1 -1
  240. package/gel-core/query-builders/select.types.d.cts +1 -1
  241. package/gel-core/query-builders/select.types.d.ts +1 -1
  242. package/gel-core/query-builders/update.cjs.map +1 -1
  243. package/gel-core/query-builders/update.d.cts +3 -3
  244. package/gel-core/query-builders/update.d.ts +3 -3
  245. package/gel-core/query-builders/update.js.map +1 -1
  246. package/gel-core/session.cjs.map +1 -1
  247. package/gel-core/session.d.cts +7 -7
  248. package/gel-core/session.d.ts +7 -7
  249. package/gel-core/session.js.map +1 -1
  250. package/gel-core/table.cjs.map +1 -1
  251. package/gel-core/table.d.cts +9 -11
  252. package/gel-core/table.d.ts +9 -11
  253. package/gel-core/table.js +3 -1
  254. package/gel-core/table.js.map +1 -1
  255. package/gel-core/utils.d.cts +1 -1
  256. package/gel-core/utils.d.ts +1 -1
  257. package/gel-core/view.cjs.map +1 -1
  258. package/gel-core/view.d.cts +3 -4
  259. package/gel-core/view.d.ts +3 -4
  260. package/gel-core/view.js.map +1 -1
  261. package/libsql/driver-core.cjs +1 -1
  262. package/libsql/driver-core.cjs.map +1 -1
  263. package/libsql/driver-core.js +1 -1
  264. package/libsql/driver-core.js.map +1 -1
  265. package/libsql/session.cjs.map +1 -1
  266. package/libsql/session.d.cts +6 -6
  267. package/libsql/session.d.ts +6 -6
  268. package/libsql/session.js.map +1 -1
  269. package/mysql-core/columns/bigint.cjs +2 -2
  270. package/mysql-core/columns/bigint.cjs.map +1 -1
  271. package/mysql-core/columns/bigint.d.cts +19 -25
  272. package/mysql-core/columns/bigint.d.ts +19 -25
  273. package/mysql-core/columns/bigint.js +2 -2
  274. package/mysql-core/columns/bigint.js.map +1 -1
  275. package/mysql-core/columns/binary.cjs +5 -4
  276. package/mysql-core/columns/binary.cjs.map +1 -1
  277. package/mysql-core/columns/binary.d.cts +13 -14
  278. package/mysql-core/columns/binary.d.ts +13 -14
  279. package/mysql-core/columns/binary.js +5 -4
  280. package/mysql-core/columns/binary.js.map +1 -1
  281. package/mysql-core/columns/boolean.cjs.map +1 -1
  282. package/mysql-core/columns/boolean.d.cts +6 -11
  283. package/mysql-core/columns/boolean.d.ts +6 -11
  284. package/mysql-core/columns/boolean.js.map +1 -1
  285. package/mysql-core/columns/char.cjs +5 -4
  286. package/mysql-core/columns/char.cjs.map +1 -1
  287. package/mysql-core/columns/char.d.cts +18 -23
  288. package/mysql-core/columns/char.d.ts +18 -23
  289. package/mysql-core/columns/char.js +5 -4
  290. package/mysql-core/columns/char.js.map +1 -1
  291. package/mysql-core/columns/common.cjs +3 -1
  292. package/mysql-core/columns/common.cjs.map +1 -1
  293. package/mysql-core/columns/common.d.cts +10 -18
  294. package/mysql-core/columns/common.d.ts +10 -18
  295. package/mysql-core/columns/common.js +3 -1
  296. package/mysql-core/columns/common.js.map +1 -1
  297. package/mysql-core/columns/custom.cjs.map +1 -1
  298. package/mysql-core/columns/custom.d.cts +9 -14
  299. package/mysql-core/columns/custom.d.ts +9 -14
  300. package/mysql-core/columns/custom.js.map +1 -1
  301. package/mysql-core/columns/date.cjs +2 -2
  302. package/mysql-core/columns/date.cjs.map +1 -1
  303. package/mysql-core/columns/date.common.cjs +1 -1
  304. package/mysql-core/columns/date.common.cjs.map +1 -1
  305. package/mysql-core/columns/date.common.d.cts +3 -3
  306. package/mysql-core/columns/date.common.d.ts +3 -3
  307. package/mysql-core/columns/date.common.js +1 -1
  308. package/mysql-core/columns/date.common.js.map +1 -1
  309. package/mysql-core/columns/date.d.cts +16 -24
  310. package/mysql-core/columns/date.d.ts +16 -24
  311. package/mysql-core/columns/date.js +2 -2
  312. package/mysql-core/columns/date.js.map +1 -1
  313. package/mysql-core/columns/datetime.cjs +2 -2
  314. package/mysql-core/columns/datetime.cjs.map +1 -1
  315. package/mysql-core/columns/datetime.d.cts +16 -24
  316. package/mysql-core/columns/datetime.d.ts +16 -24
  317. package/mysql-core/columns/datetime.js +2 -2
  318. package/mysql-core/columns/datetime.js.map +1 -1
  319. package/mysql-core/columns/decimal.cjs +3 -3
  320. package/mysql-core/columns/decimal.cjs.map +1 -1
  321. package/mysql-core/columns/decimal.d.cts +22 -33
  322. package/mysql-core/columns/decimal.d.ts +22 -33
  323. package/mysql-core/columns/decimal.js +3 -3
  324. package/mysql-core/columns/decimal.js.map +1 -1
  325. package/mysql-core/columns/double.cjs +1 -1
  326. package/mysql-core/columns/double.cjs.map +1 -1
  327. package/mysql-core/columns/double.d.cts +11 -15
  328. package/mysql-core/columns/double.d.ts +11 -15
  329. package/mysql-core/columns/double.js +1 -1
  330. package/mysql-core/columns/double.js.map +1 -1
  331. package/mysql-core/columns/enum.cjs +2 -2
  332. package/mysql-core/columns/enum.cjs.map +1 -1
  333. package/mysql-core/columns/enum.d.cts +18 -23
  334. package/mysql-core/columns/enum.d.ts +18 -23
  335. package/mysql-core/columns/enum.js +2 -2
  336. package/mysql-core/columns/enum.js.map +1 -1
  337. package/mysql-core/columns/float.cjs +1 -1
  338. package/mysql-core/columns/float.cjs.map +1 -1
  339. package/mysql-core/columns/float.d.cts +11 -15
  340. package/mysql-core/columns/float.d.ts +11 -15
  341. package/mysql-core/columns/float.js +1 -1
  342. package/mysql-core/columns/float.js.map +1 -1
  343. package/mysql-core/columns/int.cjs +1 -1
  344. package/mysql-core/columns/int.cjs.map +1 -1
  345. package/mysql-core/columns/int.d.cts +11 -15
  346. package/mysql-core/columns/int.d.ts +11 -15
  347. package/mysql-core/columns/int.js +1 -1
  348. package/mysql-core/columns/int.js.map +1 -1
  349. package/mysql-core/columns/json.cjs +1 -1
  350. package/mysql-core/columns/json.cjs.map +1 -1
  351. package/mysql-core/columns/json.d.cts +7 -12
  352. package/mysql-core/columns/json.d.ts +7 -12
  353. package/mysql-core/columns/json.js +1 -1
  354. package/mysql-core/columns/json.js.map +1 -1
  355. package/mysql-core/columns/mediumint.cjs +1 -1
  356. package/mysql-core/columns/mediumint.cjs.map +1 -1
  357. package/mysql-core/columns/mediumint.d.cts +9 -13
  358. package/mysql-core/columns/mediumint.d.ts +9 -13
  359. package/mysql-core/columns/mediumint.js +1 -1
  360. package/mysql-core/columns/mediumint.js.map +1 -1
  361. package/mysql-core/columns/real.cjs +1 -1
  362. package/mysql-core/columns/real.cjs.map +1 -1
  363. package/mysql-core/columns/real.d.cts +8 -13
  364. package/mysql-core/columns/real.d.ts +8 -13
  365. package/mysql-core/columns/real.js +1 -1
  366. package/mysql-core/columns/real.js.map +1 -1
  367. package/mysql-core/columns/serial.cjs +1 -1
  368. package/mysql-core/columns/serial.cjs.map +1 -1
  369. package/mysql-core/columns/serial.d.cts +11 -12
  370. package/mysql-core/columns/serial.d.ts +11 -12
  371. package/mysql-core/columns/serial.js +1 -1
  372. package/mysql-core/columns/serial.js.map +1 -1
  373. package/mysql-core/columns/smallint.cjs +1 -1
  374. package/mysql-core/columns/smallint.cjs.map +1 -1
  375. package/mysql-core/columns/smallint.d.cts +9 -13
  376. package/mysql-core/columns/smallint.d.ts +9 -13
  377. package/mysql-core/columns/smallint.js +1 -1
  378. package/mysql-core/columns/smallint.js.map +1 -1
  379. package/mysql-core/columns/text.cjs +19 -1
  380. package/mysql-core/columns/text.cjs.map +1 -1
  381. package/mysql-core/columns/text.d.cts +17 -23
  382. package/mysql-core/columns/text.d.ts +17 -23
  383. package/mysql-core/columns/text.js +19 -1
  384. package/mysql-core/columns/text.js.map +1 -1
  385. package/mysql-core/columns/time.cjs +1 -1
  386. package/mysql-core/columns/time.cjs.map +1 -1
  387. package/mysql-core/columns/time.d.cts +8 -13
  388. package/mysql-core/columns/time.d.ts +8 -13
  389. package/mysql-core/columns/time.js +1 -1
  390. package/mysql-core/columns/time.js.map +1 -1
  391. package/mysql-core/columns/timestamp.cjs +2 -2
  392. package/mysql-core/columns/timestamp.cjs.map +1 -1
  393. package/mysql-core/columns/timestamp.d.cts +14 -22
  394. package/mysql-core/columns/timestamp.d.ts +14 -22
  395. package/mysql-core/columns/timestamp.js +2 -2
  396. package/mysql-core/columns/timestamp.js.map +1 -1
  397. package/mysql-core/columns/tinyint.cjs +1 -1
  398. package/mysql-core/columns/tinyint.cjs.map +1 -1
  399. package/mysql-core/columns/tinyint.d.cts +9 -13
  400. package/mysql-core/columns/tinyint.d.ts +9 -13
  401. package/mysql-core/columns/tinyint.js +1 -1
  402. package/mysql-core/columns/tinyint.js.map +1 -1
  403. package/mysql-core/columns/varbinary.cjs +2 -3
  404. package/mysql-core/columns/varbinary.cjs.map +1 -1
  405. package/mysql-core/columns/varbinary.d.cts +7 -12
  406. package/mysql-core/columns/varbinary.d.ts +7 -12
  407. package/mysql-core/columns/varbinary.js +2 -3
  408. package/mysql-core/columns/varbinary.js.map +1 -1
  409. package/mysql-core/columns/varchar.cjs +2 -3
  410. package/mysql-core/columns/varchar.cjs.map +1 -1
  411. package/mysql-core/columns/varchar.d.cts +12 -21
  412. package/mysql-core/columns/varchar.d.ts +12 -21
  413. package/mysql-core/columns/varchar.js +2 -3
  414. package/mysql-core/columns/varchar.js.map +1 -1
  415. package/mysql-core/columns/year.cjs +1 -1
  416. package/mysql-core/columns/year.cjs.map +1 -1
  417. package/mysql-core/columns/year.d.cts +7 -12
  418. package/mysql-core/columns/year.d.ts +7 -12
  419. package/mysql-core/columns/year.js +1 -1
  420. package/mysql-core/columns/year.js.map +1 -1
  421. package/mysql-core/db.cjs +10 -29
  422. package/mysql-core/db.cjs.map +1 -1
  423. package/mysql-core/db.d.cts +7 -7
  424. package/mysql-core/db.d.ts +7 -7
  425. package/mysql-core/db.js +10 -29
  426. package/mysql-core/db.js.map +1 -1
  427. package/mysql-core/dialect.cjs +8 -12
  428. package/mysql-core/dialect.cjs.map +1 -1
  429. package/mysql-core/dialect.d.cts +1 -3
  430. package/mysql-core/dialect.d.ts +1 -3
  431. package/mysql-core/dialect.js +9 -13
  432. package/mysql-core/dialect.js.map +1 -1
  433. package/mysql-core/query-builders/insert.cjs +1 -1
  434. package/mysql-core/query-builders/insert.cjs.map +1 -1
  435. package/mysql-core/query-builders/insert.d.cts +5 -5
  436. package/mysql-core/query-builders/insert.d.ts +5 -5
  437. package/mysql-core/query-builders/insert.js +2 -2
  438. package/mysql-core/query-builders/insert.js.map +1 -1
  439. package/mysql-core/query-builders/query.cjs +2 -12
  440. package/mysql-core/query-builders/query.cjs.map +1 -1
  441. package/mysql-core/query-builders/query.d.cts +2 -6
  442. package/mysql-core/query-builders/query.d.ts +2 -6
  443. package/mysql-core/query-builders/query.js +2 -12
  444. package/mysql-core/query-builders/query.js.map +1 -1
  445. package/mysql-core/query-builders/select.types.cjs.map +1 -1
  446. package/mysql-core/query-builders/select.types.d.cts +1 -1
  447. package/mysql-core/query-builders/select.types.d.ts +1 -1
  448. package/mysql-core/query-builders/update.cjs.map +1 -1
  449. package/mysql-core/query-builders/update.d.cts +3 -2
  450. package/mysql-core/query-builders/update.d.ts +3 -2
  451. package/mysql-core/query-builders/update.js.map +1 -1
  452. package/mysql-core/session.cjs.map +1 -1
  453. package/mysql-core/session.d.cts +7 -7
  454. package/mysql-core/session.d.ts +7 -7
  455. package/mysql-core/session.js.map +1 -1
  456. package/mysql-core/table.cjs.map +1 -1
  457. package/mysql-core/table.d.cts +10 -13
  458. package/mysql-core/table.d.ts +10 -13
  459. package/mysql-core/table.js +3 -1
  460. package/mysql-core/table.js.map +1 -1
  461. package/mysql-core/utils.d.cts +1 -1
  462. package/mysql-core/utils.d.ts +1 -1
  463. package/mysql-core/view.cjs.map +1 -1
  464. package/mysql-core/view.d.cts +3 -4
  465. package/mysql-core/view.d.ts +3 -4
  466. package/mysql-core/view.js.map +1 -1
  467. package/mysql-proxy/driver.cjs +1 -1
  468. package/mysql-proxy/driver.cjs.map +1 -1
  469. package/mysql-proxy/driver.js +1 -1
  470. package/mysql-proxy/driver.js.map +1 -1
  471. package/mysql-proxy/session.cjs.map +1 -1
  472. package/mysql-proxy/session.d.cts +6 -6
  473. package/mysql-proxy/session.d.ts +6 -6
  474. package/mysql-proxy/session.js.map +1 -1
  475. package/mysql2/driver.cjs +1 -1
  476. package/mysql2/driver.cjs.map +1 -1
  477. package/mysql2/driver.d.cts +2 -2
  478. package/mysql2/driver.d.ts +2 -2
  479. package/mysql2/driver.js +1 -1
  480. package/mysql2/driver.js.map +1 -1
  481. package/mysql2/session.cjs.map +1 -1
  482. package/mysql2/session.d.cts +6 -6
  483. package/mysql2/session.d.ts +6 -6
  484. package/mysql2/session.js.map +1 -1
  485. package/neon/neon-auth.d.cts +18 -25
  486. package/neon/neon-auth.d.ts +18 -25
  487. package/neon-http/driver.cjs +1 -1
  488. package/neon-http/driver.cjs.map +1 -1
  489. package/neon-http/driver.d.cts +2 -2
  490. package/neon-http/driver.d.ts +2 -2
  491. package/neon-http/driver.js +1 -1
  492. package/neon-http/driver.js.map +1 -1
  493. package/neon-http/session.cjs.map +1 -1
  494. package/neon-http/session.d.cts +5 -5
  495. package/neon-http/session.d.ts +5 -5
  496. package/neon-http/session.js.map +1 -1
  497. package/neon-serverless/driver.cjs +1 -1
  498. package/neon-serverless/driver.cjs.map +1 -1
  499. package/neon-serverless/driver.d.cts +2 -2
  500. package/neon-serverless/driver.d.ts +2 -2
  501. package/neon-serverless/driver.js +1 -1
  502. package/neon-serverless/driver.js.map +1 -1
  503. package/neon-serverless/session.cjs.map +1 -1
  504. package/neon-serverless/session.d.cts +6 -6
  505. package/neon-serverless/session.d.ts +6 -6
  506. package/neon-serverless/session.js.map +1 -1
  507. package/node-postgres/driver.cjs +1 -1
  508. package/node-postgres/driver.cjs.map +1 -1
  509. package/node-postgres/driver.d.cts +2 -2
  510. package/node-postgres/driver.d.ts +2 -2
  511. package/node-postgres/driver.js +1 -1
  512. package/node-postgres/driver.js.map +1 -1
  513. package/node-postgres/session.cjs.map +1 -1
  514. package/node-postgres/session.d.cts +6 -6
  515. package/node-postgres/session.d.ts +6 -6
  516. package/node-postgres/session.js.map +1 -1
  517. package/op-sqlite/driver.cjs +1 -1
  518. package/op-sqlite/driver.cjs.map +1 -1
  519. package/op-sqlite/driver.js +1 -1
  520. package/op-sqlite/driver.js.map +1 -1
  521. package/op-sqlite/session.cjs.map +1 -1
  522. package/op-sqlite/session.d.cts +6 -6
  523. package/op-sqlite/session.d.ts +6 -6
  524. package/op-sqlite/session.js.map +1 -1
  525. package/operations.cjs.map +1 -1
  526. package/operations.d.cts +3 -3
  527. package/operations.d.ts +3 -3
  528. package/package.json +122 -155
  529. package/pg-core/columns/bigint.cjs +3 -6
  530. package/pg-core/columns/bigint.cjs.map +1 -1
  531. package/pg-core/columns/bigint.d.cts +14 -21
  532. package/pg-core/columns/bigint.d.ts +14 -21
  533. package/pg-core/columns/bigint.js +3 -6
  534. package/pg-core/columns/bigint.js.map +1 -1
  535. package/pg-core/columns/bigserial.cjs +2 -2
  536. package/pg-core/columns/bigserial.cjs.map +1 -1
  537. package/pg-core/columns/bigserial.d.cts +16 -19
  538. package/pg-core/columns/bigserial.d.ts +16 -19
  539. package/pg-core/columns/bigserial.js +2 -2
  540. package/pg-core/columns/bigserial.js.map +1 -1
  541. package/pg-core/columns/boolean.cjs.map +1 -1
  542. package/pg-core/columns/boolean.d.cts +6 -11
  543. package/pg-core/columns/boolean.d.ts +6 -11
  544. package/pg-core/columns/boolean.js.map +1 -1
  545. package/pg-core/columns/bytea.cjs +1 -1
  546. package/pg-core/columns/bytea.cjs.map +1 -1
  547. package/pg-core/columns/bytea.d.cts +7 -12
  548. package/pg-core/columns/bytea.d.ts +7 -12
  549. package/pg-core/columns/bytea.js +1 -1
  550. package/pg-core/columns/bytea.js.map +1 -1
  551. package/pg-core/columns/char.cjs +5 -4
  552. package/pg-core/columns/char.cjs.map +1 -1
  553. package/pg-core/columns/char.d.cts +18 -29
  554. package/pg-core/columns/char.d.ts +18 -29
  555. package/pg-core/columns/char.js +5 -4
  556. package/pg-core/columns/char.js.map +1 -1
  557. package/pg-core/columns/cidr.cjs +1 -1
  558. package/pg-core/columns/cidr.cjs.map +1 -1
  559. package/pg-core/columns/cidr.d.cts +7 -12
  560. package/pg-core/columns/cidr.d.ts +7 -12
  561. package/pg-core/columns/cidr.js +1 -1
  562. package/pg-core/columns/cidr.js.map +1 -1
  563. package/pg-core/columns/common.cjs +9 -9
  564. package/pg-core/columns/common.cjs.map +1 -1
  565. package/pg-core/columns/common.d.cts +24 -41
  566. package/pg-core/columns/common.d.ts +24 -41
  567. package/pg-core/columns/common.js +9 -9
  568. package/pg-core/columns/common.js.map +1 -1
  569. package/pg-core/columns/custom.cjs.map +1 -1
  570. package/pg-core/columns/custom.d.cts +11 -18
  571. package/pg-core/columns/custom.d.ts +11 -18
  572. package/pg-core/columns/custom.js.map +1 -1
  573. package/pg-core/columns/date.cjs +2 -2
  574. package/pg-core/columns/date.cjs.map +1 -1
  575. package/pg-core/columns/date.common.cjs.map +1 -1
  576. package/pg-core/columns/date.common.d.cts +2 -2
  577. package/pg-core/columns/date.common.d.ts +2 -2
  578. package/pg-core/columns/date.common.js.map +1 -1
  579. package/pg-core/columns/date.d.cts +14 -22
  580. package/pg-core/columns/date.d.ts +14 -22
  581. package/pg-core/columns/date.js +2 -2
  582. package/pg-core/columns/date.js.map +1 -1
  583. package/pg-core/columns/double-precision.cjs +1 -1
  584. package/pg-core/columns/double-precision.cjs.map +1 -1
  585. package/pg-core/columns/double-precision.d.cts +7 -12
  586. package/pg-core/columns/double-precision.d.ts +7 -12
  587. package/pg-core/columns/double-precision.js +1 -1
  588. package/pg-core/columns/double-precision.js.map +1 -1
  589. package/pg-core/columns/enum.cjs +2 -2
  590. package/pg-core/columns/enum.cjs.map +1 -1
  591. package/pg-core/columns/enum.d.cts +23 -40
  592. package/pg-core/columns/enum.d.ts +23 -40
  593. package/pg-core/columns/enum.js +2 -2
  594. package/pg-core/columns/enum.js.map +1 -1
  595. package/pg-core/columns/inet.cjs +1 -1
  596. package/pg-core/columns/inet.cjs.map +1 -1
  597. package/pg-core/columns/inet.d.cts +7 -12
  598. package/pg-core/columns/inet.d.ts +7 -12
  599. package/pg-core/columns/inet.js +1 -1
  600. package/pg-core/columns/inet.js.map +1 -1
  601. package/pg-core/columns/int.common.cjs.map +1 -1
  602. package/pg-core/columns/int.common.d.cts +2 -2
  603. package/pg-core/columns/int.common.d.ts +2 -2
  604. package/pg-core/columns/int.common.js.map +1 -1
  605. package/pg-core/columns/integer.cjs +1 -1
  606. package/pg-core/columns/integer.cjs.map +1 -1
  607. package/pg-core/columns/integer.d.cts +7 -12
  608. package/pg-core/columns/integer.d.ts +7 -12
  609. package/pg-core/columns/integer.js +1 -1
  610. package/pg-core/columns/integer.js.map +1 -1
  611. package/pg-core/columns/interval.cjs +1 -1
  612. package/pg-core/columns/interval.cjs.map +1 -1
  613. package/pg-core/columns/interval.d.cts +8 -13
  614. package/pg-core/columns/interval.d.ts +8 -13
  615. package/pg-core/columns/interval.js +1 -1
  616. package/pg-core/columns/interval.js.map +1 -1
  617. package/pg-core/columns/json.cjs +1 -1
  618. package/pg-core/columns/json.cjs.map +1 -1
  619. package/pg-core/columns/json.d.cts +9 -16
  620. package/pg-core/columns/json.d.ts +9 -16
  621. package/pg-core/columns/json.js +1 -1
  622. package/pg-core/columns/json.js.map +1 -1
  623. package/pg-core/columns/jsonb.cjs +1 -1
  624. package/pg-core/columns/jsonb.cjs.map +1 -1
  625. package/pg-core/columns/jsonb.d.cts +9 -16
  626. package/pg-core/columns/jsonb.d.ts +9 -16
  627. package/pg-core/columns/jsonb.js +1 -1
  628. package/pg-core/columns/jsonb.js.map +1 -1
  629. package/pg-core/columns/line.cjs +2 -2
  630. package/pg-core/columns/line.cjs.map +1 -1
  631. package/pg-core/columns/line.d.cts +14 -22
  632. package/pg-core/columns/line.d.ts +14 -22
  633. package/pg-core/columns/line.js +2 -2
  634. package/pg-core/columns/line.js.map +1 -1
  635. package/pg-core/columns/macaddr.cjs +1 -1
  636. package/pg-core/columns/macaddr.cjs.map +1 -1
  637. package/pg-core/columns/macaddr.d.cts +7 -12
  638. package/pg-core/columns/macaddr.d.ts +7 -12
  639. package/pg-core/columns/macaddr.js +1 -1
  640. package/pg-core/columns/macaddr.js.map +1 -1
  641. package/pg-core/columns/macaddr8.cjs +1 -1
  642. package/pg-core/columns/macaddr8.cjs.map +1 -1
  643. package/pg-core/columns/macaddr8.d.cts +7 -12
  644. package/pg-core/columns/macaddr8.d.ts +7 -12
  645. package/pg-core/columns/macaddr8.js +1 -1
  646. package/pg-core/columns/macaddr8.js.map +1 -1
  647. package/pg-core/columns/numeric.cjs +2 -2
  648. package/pg-core/columns/numeric.cjs.map +1 -1
  649. package/pg-core/columns/numeric.d.cts +23 -39
  650. package/pg-core/columns/numeric.d.ts +23 -39
  651. package/pg-core/columns/numeric.js +2 -2
  652. package/pg-core/columns/numeric.js.map +1 -1
  653. package/pg-core/columns/point.cjs +2 -2
  654. package/pg-core/columns/point.cjs.map +1 -1
  655. package/pg-core/columns/point.d.cts +12 -20
  656. package/pg-core/columns/point.d.ts +12 -20
  657. package/pg-core/columns/point.js +2 -2
  658. package/pg-core/columns/point.js.map +1 -1
  659. package/pg-core/columns/postgis_extension/geometry.cjs +2 -2
  660. package/pg-core/columns/postgis_extension/geometry.cjs.map +1 -1
  661. package/pg-core/columns/postgis_extension/geometry.d.cts +14 -22
  662. package/pg-core/columns/postgis_extension/geometry.d.ts +14 -22
  663. package/pg-core/columns/postgis_extension/geometry.js +2 -2
  664. package/pg-core/columns/postgis_extension/geometry.js.map +1 -1
  665. package/pg-core/columns/real.cjs +1 -1
  666. package/pg-core/columns/real.cjs.map +1 -1
  667. package/pg-core/columns/real.d.cts +9 -16
  668. package/pg-core/columns/real.d.ts +9 -16
  669. package/pg-core/columns/real.js +1 -1
  670. package/pg-core/columns/real.js.map +1 -1
  671. package/pg-core/columns/serial.cjs +1 -1
  672. package/pg-core/columns/serial.cjs.map +1 -1
  673. package/pg-core/columns/serial.d.cts +9 -12
  674. package/pg-core/columns/serial.d.ts +9 -12
  675. package/pg-core/columns/serial.js +1 -1
  676. package/pg-core/columns/serial.js.map +1 -1
  677. package/pg-core/columns/smallint.cjs +1 -1
  678. package/pg-core/columns/smallint.cjs.map +1 -1
  679. package/pg-core/columns/smallint.d.cts +7 -12
  680. package/pg-core/columns/smallint.d.ts +7 -12
  681. package/pg-core/columns/smallint.js +1 -1
  682. package/pg-core/columns/smallint.js.map +1 -1
  683. package/pg-core/columns/smallserial.cjs +1 -1
  684. package/pg-core/columns/smallserial.cjs.map +1 -1
  685. package/pg-core/columns/smallserial.d.cts +9 -12
  686. package/pg-core/columns/smallserial.d.ts +9 -12
  687. package/pg-core/columns/smallserial.js +1 -1
  688. package/pg-core/columns/smallserial.js.map +1 -1
  689. package/pg-core/columns/text.cjs +7 -3
  690. package/pg-core/columns/text.cjs.map +1 -1
  691. package/pg-core/columns/text.d.cts +14 -18
  692. package/pg-core/columns/text.d.ts +14 -18
  693. package/pg-core/columns/text.js +7 -3
  694. package/pg-core/columns/text.js.map +1 -1
  695. package/pg-core/columns/time.cjs +1 -1
  696. package/pg-core/columns/time.cjs.map +1 -1
  697. package/pg-core/columns/time.d.cts +10 -17
  698. package/pg-core/columns/time.d.ts +10 -17
  699. package/pg-core/columns/time.js +1 -1
  700. package/pg-core/columns/time.js.map +1 -1
  701. package/pg-core/columns/timestamp.cjs +2 -2
  702. package/pg-core/columns/timestamp.cjs.map +1 -1
  703. package/pg-core/columns/timestamp.d.cts +17 -29
  704. package/pg-core/columns/timestamp.d.ts +17 -29
  705. package/pg-core/columns/timestamp.js +2 -2
  706. package/pg-core/columns/timestamp.js.map +1 -1
  707. package/pg-core/columns/uuid.cjs +1 -1
  708. package/pg-core/columns/uuid.cjs.map +1 -1
  709. package/pg-core/columns/uuid.d.cts +7 -12
  710. package/pg-core/columns/uuid.d.ts +7 -12
  711. package/pg-core/columns/uuid.js +1 -1
  712. package/pg-core/columns/uuid.js.map +1 -1
  713. package/pg-core/columns/varchar.cjs +1 -2
  714. package/pg-core/columns/varchar.cjs.map +1 -1
  715. package/pg-core/columns/varchar.d.cts +14 -27
  716. package/pg-core/columns/varchar.d.ts +14 -27
  717. package/pg-core/columns/varchar.js +1 -2
  718. package/pg-core/columns/varchar.js.map +1 -1
  719. package/pg-core/columns/vector_extension/bit.cjs +4 -4
  720. package/pg-core/columns/vector_extension/bit.cjs.map +1 -1
  721. package/pg-core/columns/vector_extension/bit.d.cts +12 -25
  722. package/pg-core/columns/vector_extension/bit.d.ts +12 -25
  723. package/pg-core/columns/vector_extension/bit.js +4 -4
  724. package/pg-core/columns/vector_extension/bit.js.map +1 -1
  725. package/pg-core/columns/vector_extension/halfvec.cjs +4 -4
  726. package/pg-core/columns/vector_extension/halfvec.cjs.map +1 -1
  727. package/pg-core/columns/vector_extension/halfvec.d.cts +11 -26
  728. package/pg-core/columns/vector_extension/halfvec.d.ts +11 -26
  729. package/pg-core/columns/vector_extension/halfvec.js +4 -4
  730. package/pg-core/columns/vector_extension/halfvec.js.map +1 -1
  731. package/pg-core/columns/vector_extension/sparsevec.cjs +1 -1
  732. package/pg-core/columns/vector_extension/sparsevec.cjs.map +1 -1
  733. package/pg-core/columns/vector_extension/sparsevec.d.cts +7 -11
  734. package/pg-core/columns/vector_extension/sparsevec.d.ts +7 -11
  735. package/pg-core/columns/vector_extension/sparsevec.js +1 -1
  736. package/pg-core/columns/vector_extension/sparsevec.js.map +1 -1
  737. package/pg-core/columns/vector_extension/vector.cjs +4 -4
  738. package/pg-core/columns/vector_extension/vector.cjs.map +1 -1
  739. package/pg-core/columns/vector_extension/vector.d.cts +11 -26
  740. package/pg-core/columns/vector_extension/vector.d.ts +11 -26
  741. package/pg-core/columns/vector_extension/vector.js +4 -4
  742. package/pg-core/columns/vector_extension/vector.js.map +1 -1
  743. package/pg-core/db.cjs +10 -15
  744. package/pg-core/db.cjs.map +1 -1
  745. package/pg-core/db.d.cts +8 -8
  746. package/pg-core/db.d.ts +8 -8
  747. package/pg-core/db.js +10 -15
  748. package/pg-core/db.js.map +1 -1
  749. package/pg-core/dialect.cjs +13 -13
  750. package/pg-core/dialect.cjs.map +1 -1
  751. package/pg-core/dialect.d.cts +1 -3
  752. package/pg-core/dialect.d.ts +1 -3
  753. package/pg-core/dialect.js +14 -14
  754. package/pg-core/dialect.js.map +1 -1
  755. package/pg-core/query-builders/delete.cjs.map +1 -1
  756. package/pg-core/query-builders/delete.js.map +1 -1
  757. package/pg-core/query-builders/insert.cjs +1 -1
  758. package/pg-core/query-builders/insert.cjs.map +1 -1
  759. package/pg-core/query-builders/insert.d.cts +2 -2
  760. package/pg-core/query-builders/insert.d.ts +2 -2
  761. package/pg-core/query-builders/insert.js +2 -2
  762. package/pg-core/query-builders/insert.js.map +1 -1
  763. package/pg-core/query-builders/query.cjs +2 -12
  764. package/pg-core/query-builders/query.cjs.map +1 -1
  765. package/pg-core/query-builders/query.d.cts +2 -6
  766. package/pg-core/query-builders/query.d.ts +2 -6
  767. package/pg-core/query-builders/query.js +2 -12
  768. package/pg-core/query-builders/query.js.map +1 -1
  769. package/pg-core/query-builders/select.types.cjs.map +1 -1
  770. package/pg-core/query-builders/select.types.d.cts +1 -1
  771. package/pg-core/query-builders/select.types.d.ts +1 -1
  772. package/pg-core/query-builders/update.cjs.map +1 -1
  773. package/pg-core/query-builders/update.d.cts +3 -3
  774. package/pg-core/query-builders/update.d.ts +3 -3
  775. package/pg-core/query-builders/update.js.map +1 -1
  776. package/pg-core/session.cjs.map +1 -1
  777. package/pg-core/session.d.cts +7 -7
  778. package/pg-core/session.d.ts +7 -7
  779. package/pg-core/session.js.map +1 -1
  780. package/pg-core/table.cjs.map +1 -1
  781. package/pg-core/table.d.cts +9 -11
  782. package/pg-core/table.d.ts +9 -11
  783. package/pg-core/table.js +3 -1
  784. package/pg-core/table.js.map +1 -1
  785. package/pg-core/utils.cjs +3 -1
  786. package/pg-core/utils.cjs.map +1 -1
  787. package/pg-core/utils.d.cts +1 -1
  788. package/pg-core/utils.d.ts +1 -1
  789. package/pg-core/utils.js +4 -2
  790. package/pg-core/utils.js.map +1 -1
  791. package/pg-core/view.cjs.map +1 -1
  792. package/pg-core/view.d.cts +5 -6
  793. package/pg-core/view.d.ts +5 -6
  794. package/pg-core/view.js.map +1 -1
  795. package/pg-proxy/driver.cjs +1 -1
  796. package/pg-proxy/driver.cjs.map +1 -1
  797. package/pg-proxy/driver.js +1 -1
  798. package/pg-proxy/driver.js.map +1 -1
  799. package/pg-proxy/session.cjs.map +1 -1
  800. package/pg-proxy/session.d.cts +6 -6
  801. package/pg-proxy/session.d.ts +6 -6
  802. package/pg-proxy/session.js.map +1 -1
  803. package/pglite/driver.cjs +1 -1
  804. package/pglite/driver.cjs.map +1 -1
  805. package/pglite/driver.d.cts +2 -2
  806. package/pglite/driver.d.ts +2 -2
  807. package/pglite/driver.js +1 -1
  808. package/pglite/driver.js.map +1 -1
  809. package/pglite/session.cjs.map +1 -1
  810. package/pglite/session.d.cts +6 -6
  811. package/pglite/session.d.ts +6 -6
  812. package/pglite/session.js.map +1 -1
  813. package/planetscale-serverless/driver.cjs +1 -1
  814. package/planetscale-serverless/driver.cjs.map +1 -1
  815. package/planetscale-serverless/driver.js +1 -1
  816. package/planetscale-serverless/driver.js.map +1 -1
  817. package/planetscale-serverless/session.cjs.map +1 -1
  818. package/planetscale-serverless/session.d.cts +7 -7
  819. package/planetscale-serverless/session.d.ts +7 -7
  820. package/planetscale-serverless/session.js.map +1 -1
  821. package/postgres-js/driver.cjs +1 -1
  822. package/postgres-js/driver.cjs.map +1 -1
  823. package/postgres-js/driver.d.cts +1 -1
  824. package/postgres-js/driver.d.ts +1 -1
  825. package/postgres-js/driver.js +1 -1
  826. package/postgres-js/driver.js.map +1 -1
  827. package/postgres-js/session.cjs.map +1 -1
  828. package/postgres-js/session.d.cts +7 -7
  829. package/postgres-js/session.d.ts +7 -7
  830. package/postgres-js/session.js.map +1 -1
  831. package/prisma/mysql/driver.cjs +7 -1
  832. package/prisma/mysql/driver.cjs.map +1 -1
  833. package/prisma/mysql/driver.js +7 -1
  834. package/prisma/mysql/driver.js.map +1 -1
  835. package/prisma/mysql/session.cjs.map +1 -1
  836. package/prisma/mysql/session.d.cts +2 -2
  837. package/prisma/mysql/session.d.ts +2 -2
  838. package/prisma/mysql/session.js.map +1 -1
  839. package/prisma/pg/driver.cjs +1 -1
  840. package/prisma/pg/driver.cjs.map +1 -1
  841. package/prisma/pg/driver.js +1 -1
  842. package/prisma/pg/driver.js.map +1 -1
  843. package/prisma/pg/session.cjs.map +1 -1
  844. package/prisma/pg/session.d.cts +2 -2
  845. package/prisma/pg/session.d.ts +2 -2
  846. package/prisma/pg/session.js.map +1 -1
  847. package/prisma/sqlite/driver.cjs +7 -1
  848. package/prisma/sqlite/driver.cjs.map +1 -1
  849. package/prisma/sqlite/driver.js +7 -1
  850. package/prisma/sqlite/driver.js.map +1 -1
  851. package/prisma/sqlite/session.cjs.map +1 -1
  852. package/prisma/sqlite/session.d.cts +3 -3
  853. package/prisma/sqlite/session.d.ts +3 -3
  854. package/prisma/sqlite/session.js.map +1 -1
  855. package/query-builders/select.types.cjs.map +1 -1
  856. package/query-builders/select.types.d.cts +2 -2
  857. package/query-builders/select.types.d.ts +2 -2
  858. package/relations.cjs +174 -163
  859. package/relations.cjs.map +1 -1
  860. package/relations.d.cts +170 -190
  861. package/relations.d.ts +170 -190
  862. package/relations.js +170 -163
  863. package/relations.js.map +1 -1
  864. package/singlestore-core/columns/bigint.cjs +2 -2
  865. package/singlestore-core/columns/bigint.cjs.map +1 -1
  866. package/singlestore-core/columns/bigint.d.cts +17 -24
  867. package/singlestore-core/columns/bigint.d.ts +17 -24
  868. package/singlestore-core/columns/bigint.js +2 -2
  869. package/singlestore-core/columns/bigint.js.map +1 -1
  870. package/singlestore-core/columns/binary.cjs +5 -4
  871. package/singlestore-core/columns/binary.cjs.map +1 -1
  872. package/singlestore-core/columns/binary.d.cts +13 -15
  873. package/singlestore-core/columns/binary.d.ts +13 -15
  874. package/singlestore-core/columns/binary.js +5 -4
  875. package/singlestore-core/columns/binary.js.map +1 -1
  876. package/singlestore-core/columns/boolean.cjs.map +1 -1
  877. package/singlestore-core/columns/boolean.d.cts +6 -12
  878. package/singlestore-core/columns/boolean.d.ts +6 -12
  879. package/singlestore-core/columns/boolean.js.map +1 -1
  880. package/singlestore-core/columns/char.cjs +5 -4
  881. package/singlestore-core/columns/char.cjs.map +1 -1
  882. package/singlestore-core/columns/char.d.cts +18 -24
  883. package/singlestore-core/columns/char.d.ts +18 -24
  884. package/singlestore-core/columns/char.js +5 -4
  885. package/singlestore-core/columns/char.js.map +1 -1
  886. package/singlestore-core/columns/common.cjs +3 -2
  887. package/singlestore-core/columns/common.cjs.map +1 -1
  888. package/singlestore-core/columns/common.d.cts +14 -18
  889. package/singlestore-core/columns/common.d.ts +14 -18
  890. package/singlestore-core/columns/common.js +3 -2
  891. package/singlestore-core/columns/common.js.map +1 -1
  892. package/singlestore-core/columns/custom.cjs.map +1 -1
  893. package/singlestore-core/columns/custom.d.cts +10 -15
  894. package/singlestore-core/columns/custom.d.ts +10 -15
  895. package/singlestore-core/columns/custom.js.map +1 -1
  896. package/singlestore-core/columns/date.cjs +2 -2
  897. package/singlestore-core/columns/date.cjs.map +1 -1
  898. package/singlestore-core/columns/date.common.cjs.map +1 -1
  899. package/singlestore-core/columns/date.common.d.cts +3 -3
  900. package/singlestore-core/columns/date.common.d.ts +3 -3
  901. package/singlestore-core/columns/date.common.js.map +1 -1
  902. package/singlestore-core/columns/date.d.cts +16 -26
  903. package/singlestore-core/columns/date.d.ts +16 -26
  904. package/singlestore-core/columns/date.js +2 -2
  905. package/singlestore-core/columns/date.js.map +1 -1
  906. package/singlestore-core/columns/datetime.cjs +3 -5
  907. package/singlestore-core/columns/datetime.cjs.map +1 -1
  908. package/singlestore-core/columns/datetime.d.cts +25 -27
  909. package/singlestore-core/columns/datetime.d.ts +25 -27
  910. package/singlestore-core/columns/datetime.js +3 -5
  911. package/singlestore-core/columns/datetime.js.map +1 -1
  912. package/singlestore-core/columns/decimal.cjs +3 -3
  913. package/singlestore-core/columns/decimal.cjs.map +1 -1
  914. package/singlestore-core/columns/decimal.d.cts +22 -36
  915. package/singlestore-core/columns/decimal.d.ts +22 -36
  916. package/singlestore-core/columns/decimal.js +3 -3
  917. package/singlestore-core/columns/decimal.js.map +1 -1
  918. package/singlestore-core/columns/double.cjs +1 -1
  919. package/singlestore-core/columns/double.cjs.map +1 -1
  920. package/singlestore-core/columns/double.d.cts +11 -16
  921. package/singlestore-core/columns/double.d.ts +11 -16
  922. package/singlestore-core/columns/double.js +1 -1
  923. package/singlestore-core/columns/double.js.map +1 -1
  924. package/singlestore-core/columns/enum.cjs +1 -1
  925. package/singlestore-core/columns/enum.cjs.map +1 -1
  926. package/singlestore-core/columns/enum.d.cts +14 -15
  927. package/singlestore-core/columns/enum.d.ts +14 -15
  928. package/singlestore-core/columns/enum.js +1 -1
  929. package/singlestore-core/columns/enum.js.map +1 -1
  930. package/singlestore-core/columns/float.cjs +1 -1
  931. package/singlestore-core/columns/float.cjs.map +1 -1
  932. package/singlestore-core/columns/float.d.cts +11 -16
  933. package/singlestore-core/columns/float.d.ts +11 -16
  934. package/singlestore-core/columns/float.js +1 -1
  935. package/singlestore-core/columns/float.js.map +1 -1
  936. package/singlestore-core/columns/int.cjs +1 -1
  937. package/singlestore-core/columns/int.cjs.map +1 -1
  938. package/singlestore-core/columns/int.d.cts +11 -16
  939. package/singlestore-core/columns/int.d.ts +11 -16
  940. package/singlestore-core/columns/int.js +1 -1
  941. package/singlestore-core/columns/int.js.map +1 -1
  942. package/singlestore-core/columns/json.cjs +1 -1
  943. package/singlestore-core/columns/json.cjs.map +1 -1
  944. package/singlestore-core/columns/json.d.cts +7 -13
  945. package/singlestore-core/columns/json.d.ts +7 -13
  946. package/singlestore-core/columns/json.js +1 -1
  947. package/singlestore-core/columns/json.js.map +1 -1
  948. package/singlestore-core/columns/mediumint.cjs +1 -1
  949. package/singlestore-core/columns/mediumint.cjs.map +1 -1
  950. package/singlestore-core/columns/mediumint.d.cts +9 -14
  951. package/singlestore-core/columns/mediumint.d.ts +9 -14
  952. package/singlestore-core/columns/mediumint.js +1 -1
  953. package/singlestore-core/columns/mediumint.js.map +1 -1
  954. package/singlestore-core/columns/real.cjs +1 -1
  955. package/singlestore-core/columns/real.cjs.map +1 -1
  956. package/singlestore-core/columns/real.d.cts +8 -14
  957. package/singlestore-core/columns/real.d.ts +8 -14
  958. package/singlestore-core/columns/real.js +1 -1
  959. package/singlestore-core/columns/real.js.map +1 -1
  960. package/singlestore-core/columns/serial.cjs +1 -1
  961. package/singlestore-core/columns/serial.cjs.map +1 -1
  962. package/singlestore-core/columns/serial.d.cts +11 -13
  963. package/singlestore-core/columns/serial.d.ts +11 -13
  964. package/singlestore-core/columns/serial.js +1 -1
  965. package/singlestore-core/columns/serial.js.map +1 -1
  966. package/singlestore-core/columns/smallint.cjs +1 -1
  967. package/singlestore-core/columns/smallint.cjs.map +1 -1
  968. package/singlestore-core/columns/smallint.d.cts +9 -14
  969. package/singlestore-core/columns/smallint.d.ts +9 -14
  970. package/singlestore-core/columns/smallint.js +1 -1
  971. package/singlestore-core/columns/smallint.js.map +1 -1
  972. package/singlestore-core/columns/text.cjs +19 -1
  973. package/singlestore-core/columns/text.cjs.map +1 -1
  974. package/singlestore-core/columns/text.d.cts +17 -24
  975. package/singlestore-core/columns/text.d.ts +17 -24
  976. package/singlestore-core/columns/text.js +19 -1
  977. package/singlestore-core/columns/text.js.map +1 -1
  978. package/singlestore-core/columns/time.cjs +1 -1
  979. package/singlestore-core/columns/time.cjs.map +1 -1
  980. package/singlestore-core/columns/time.d.cts +7 -13
  981. package/singlestore-core/columns/time.d.ts +7 -13
  982. package/singlestore-core/columns/time.js +1 -1
  983. package/singlestore-core/columns/time.js.map +1 -1
  984. package/singlestore-core/columns/timestamp.cjs +2 -2
  985. package/singlestore-core/columns/timestamp.cjs.map +1 -1
  986. package/singlestore-core/columns/timestamp.d.cts +14 -24
  987. package/singlestore-core/columns/timestamp.d.ts +14 -24
  988. package/singlestore-core/columns/timestamp.js +2 -2
  989. package/singlestore-core/columns/timestamp.js.map +1 -1
  990. package/singlestore-core/columns/tinyint.cjs +1 -1
  991. package/singlestore-core/columns/tinyint.cjs.map +1 -1
  992. package/singlestore-core/columns/tinyint.d.cts +9 -14
  993. package/singlestore-core/columns/tinyint.d.ts +9 -14
  994. package/singlestore-core/columns/tinyint.js +1 -1
  995. package/singlestore-core/columns/tinyint.js.map +1 -1
  996. package/singlestore-core/columns/varbinary.cjs +2 -3
  997. package/singlestore-core/columns/varbinary.cjs.map +1 -1
  998. package/singlestore-core/columns/varbinary.d.cts +7 -13
  999. package/singlestore-core/columns/varbinary.d.ts +7 -13
  1000. package/singlestore-core/columns/varbinary.js +2 -3
  1001. package/singlestore-core/columns/varbinary.js.map +1 -1
  1002. package/singlestore-core/columns/varchar.cjs +1 -2
  1003. package/singlestore-core/columns/varchar.cjs.map +1 -1
  1004. package/singlestore-core/columns/varchar.d.cts +12 -24
  1005. package/singlestore-core/columns/varchar.d.ts +12 -24
  1006. package/singlestore-core/columns/varchar.js +1 -2
  1007. package/singlestore-core/columns/varchar.js.map +1 -1
  1008. package/singlestore-core/columns/vector.cjs +5 -5
  1009. package/singlestore-core/columns/vector.cjs.map +1 -1
  1010. package/singlestore-core/columns/vector.d.cts +17 -14
  1011. package/singlestore-core/columns/vector.d.ts +17 -14
  1012. package/singlestore-core/columns/vector.js +5 -5
  1013. package/singlestore-core/columns/vector.js.map +1 -1
  1014. package/singlestore-core/columns/year.cjs +1 -1
  1015. package/singlestore-core/columns/year.cjs.map +1 -1
  1016. package/singlestore-core/columns/year.d.cts +7 -13
  1017. package/singlestore-core/columns/year.d.ts +7 -13
  1018. package/singlestore-core/columns/year.js +1 -1
  1019. package/singlestore-core/columns/year.js.map +1 -1
  1020. package/singlestore-core/dialect.cjs +2 -2
  1021. package/singlestore-core/dialect.cjs.map +1 -1
  1022. package/singlestore-core/dialect.js +2 -2
  1023. package/singlestore-core/dialect.js.map +1 -1
  1024. package/singlestore-core/query-builders/insert.cjs.map +1 -1
  1025. package/singlestore-core/query-builders/insert.d.cts +3 -3
  1026. package/singlestore-core/query-builders/insert.d.ts +3 -3
  1027. package/singlestore-core/query-builders/insert.js.map +1 -1
  1028. package/singlestore-core/query-builders/select.types.cjs.map +1 -1
  1029. package/singlestore-core/query-builders/select.types.d.cts +1 -1
  1030. package/singlestore-core/query-builders/select.types.d.ts +1 -1
  1031. package/singlestore-core/query-builders/update.cjs.map +1 -1
  1032. package/singlestore-core/query-builders/update.d.cts +3 -2
  1033. package/singlestore-core/query-builders/update.d.ts +3 -2
  1034. package/singlestore-core/query-builders/update.js.map +1 -1
  1035. package/singlestore-core/table.cjs.map +1 -1
  1036. package/singlestore-core/table.d.cts +10 -13
  1037. package/singlestore-core/table.d.ts +10 -13
  1038. package/singlestore-core/table.js +3 -1
  1039. package/singlestore-core/table.js.map +1 -1
  1040. package/singlestore-core/utils.d.cts +1 -1
  1041. package/singlestore-core/utils.d.ts +1 -1
  1042. package/singlestore-core/view.cjs.map +1 -1
  1043. package/singlestore-core/view.d.cts +2 -3
  1044. package/singlestore-core/view.d.ts +2 -3
  1045. package/singlestore-core/view.js.map +1 -1
  1046. package/sql/sql.cjs +2 -2
  1047. package/sql/sql.cjs.map +1 -1
  1048. package/sql/sql.js +3 -3
  1049. package/sql/sql.js.map +1 -1
  1050. package/sql-js/driver.cjs +1 -1
  1051. package/sql-js/driver.cjs.map +1 -1
  1052. package/sql-js/driver.js +1 -1
  1053. package/sql-js/driver.js.map +1 -1
  1054. package/sql-js/session.cjs.map +1 -1
  1055. package/sql-js/session.d.cts +6 -6
  1056. package/sql-js/session.d.ts +6 -6
  1057. package/sql-js/session.js.map +1 -1
  1058. package/sqlite-core/columns/blob.cjs +3 -3
  1059. package/sqlite-core/columns/blob.cjs.map +1 -1
  1060. package/sqlite-core/columns/blob.d.cts +20 -31
  1061. package/sqlite-core/columns/blob.d.ts +20 -31
  1062. package/sqlite-core/columns/blob.js +3 -3
  1063. package/sqlite-core/columns/blob.js.map +1 -1
  1064. package/sqlite-core/columns/common.cjs +3 -1
  1065. package/sqlite-core/columns/common.cjs.map +1 -1
  1066. package/sqlite-core/columns/common.d.cts +6 -14
  1067. package/sqlite-core/columns/common.d.ts +6 -14
  1068. package/sqlite-core/columns/common.js +3 -1
  1069. package/sqlite-core/columns/common.js.map +1 -1
  1070. package/sqlite-core/columns/custom.cjs.map +1 -1
  1071. package/sqlite-core/columns/custom.d.cts +10 -14
  1072. package/sqlite-core/columns/custom.d.ts +10 -14
  1073. package/sqlite-core/columns/custom.js.map +1 -1
  1074. package/sqlite-core/columns/integer.cjs +2 -2
  1075. package/sqlite-core/columns/integer.cjs.map +1 -1
  1076. package/sqlite-core/columns/integer.d.cts +28 -44
  1077. package/sqlite-core/columns/integer.d.ts +28 -44
  1078. package/sqlite-core/columns/integer.js +2 -2
  1079. package/sqlite-core/columns/integer.js.map +1 -1
  1080. package/sqlite-core/columns/numeric.cjs +2 -2
  1081. package/sqlite-core/columns/numeric.cjs.map +1 -1
  1082. package/sqlite-core/columns/numeric.d.cts +19 -29
  1083. package/sqlite-core/columns/numeric.d.ts +19 -29
  1084. package/sqlite-core/columns/numeric.js +2 -2
  1085. package/sqlite-core/columns/numeric.js.map +1 -1
  1086. package/sqlite-core/columns/real.cjs +1 -1
  1087. package/sqlite-core/columns/real.cjs.map +1 -1
  1088. package/sqlite-core/columns/real.d.cts +7 -12
  1089. package/sqlite-core/columns/real.d.ts +7 -12
  1090. package/sqlite-core/columns/real.js +1 -1
  1091. package/sqlite-core/columns/real.js.map +1 -1
  1092. package/sqlite-core/columns/text.cjs +2 -3
  1093. package/sqlite-core/columns/text.cjs.map +1 -1
  1094. package/sqlite-core/columns/text.d.cts +20 -35
  1095. package/sqlite-core/columns/text.d.ts +20 -35
  1096. package/sqlite-core/columns/text.js +2 -3
  1097. package/sqlite-core/columns/text.js.map +1 -1
  1098. package/sqlite-core/db.cjs +13 -18
  1099. package/sqlite-core/db.cjs.map +1 -1
  1100. package/sqlite-core/db.d.cts +7 -7
  1101. package/sqlite-core/db.d.ts +7 -7
  1102. package/sqlite-core/db.js +13 -18
  1103. package/sqlite-core/db.js.map +1 -1
  1104. package/sqlite-core/dialect.cjs +8 -12
  1105. package/sqlite-core/dialect.cjs.map +1 -1
  1106. package/sqlite-core/dialect.d.cts +3 -5
  1107. package/sqlite-core/dialect.d.ts +3 -5
  1108. package/sqlite-core/dialect.js +9 -13
  1109. package/sqlite-core/dialect.js.map +1 -1
  1110. package/sqlite-core/query-builders/_query.cjs.map +1 -1
  1111. package/sqlite-core/query-builders/_query.d.cts +3 -3
  1112. package/sqlite-core/query-builders/_query.d.ts +3 -3
  1113. package/sqlite-core/query-builders/_query.js.map +1 -1
  1114. package/sqlite-core/query-builders/delete.cjs.map +1 -1
  1115. package/sqlite-core/query-builders/delete.d.cts +1 -1
  1116. package/sqlite-core/query-builders/delete.d.ts +1 -1
  1117. package/sqlite-core/query-builders/delete.js.map +1 -1
  1118. package/sqlite-core/query-builders/insert.cjs +1 -1
  1119. package/sqlite-core/query-builders/insert.cjs.map +1 -1
  1120. package/sqlite-core/query-builders/insert.d.cts +8 -7
  1121. package/sqlite-core/query-builders/insert.d.ts +8 -7
  1122. package/sqlite-core/query-builders/insert.js +2 -2
  1123. package/sqlite-core/query-builders/insert.js.map +1 -1
  1124. package/sqlite-core/query-builders/query.cjs +2 -18
  1125. package/sqlite-core/query-builders/query.cjs.map +1 -1
  1126. package/sqlite-core/query-builders/query.d.cts +2 -6
  1127. package/sqlite-core/query-builders/query.d.ts +2 -6
  1128. package/sqlite-core/query-builders/query.js +2 -18
  1129. package/sqlite-core/query-builders/query.js.map +1 -1
  1130. package/sqlite-core/query-builders/select.cjs.map +1 -1
  1131. package/sqlite-core/query-builders/select.d.cts +3 -3
  1132. package/sqlite-core/query-builders/select.d.ts +3 -3
  1133. package/sqlite-core/query-builders/select.js.map +1 -1
  1134. package/sqlite-core/query-builders/select.types.cjs.map +1 -1
  1135. package/sqlite-core/query-builders/select.types.d.cts +1 -1
  1136. package/sqlite-core/query-builders/select.types.d.ts +1 -1
  1137. package/sqlite-core/query-builders/update.cjs.map +1 -1
  1138. package/sqlite-core/query-builders/update.d.cts +6 -5
  1139. package/sqlite-core/query-builders/update.d.ts +6 -5
  1140. package/sqlite-core/query-builders/update.js.map +1 -1
  1141. package/sqlite-core/session.cjs.map +1 -1
  1142. package/sqlite-core/session.d.cts +6 -6
  1143. package/sqlite-core/session.d.ts +6 -6
  1144. package/sqlite-core/session.js.map +1 -1
  1145. package/sqlite-core/table.cjs.map +1 -1
  1146. package/sqlite-core/table.d.cts +9 -11
  1147. package/sqlite-core/table.d.ts +9 -11
  1148. package/sqlite-core/table.js +3 -1
  1149. package/sqlite-core/table.js.map +1 -1
  1150. package/sqlite-core/utils.d.cts +1 -1
  1151. package/sqlite-core/utils.d.ts +1 -1
  1152. package/sqlite-core/view.cjs.map +1 -1
  1153. package/sqlite-core/view.d.cts +3 -4
  1154. package/sqlite-core/view.d.ts +3 -4
  1155. package/sqlite-core/view.js.map +1 -1
  1156. package/sqlite-proxy/driver.cjs +1 -1
  1157. package/sqlite-proxy/driver.cjs.map +1 -1
  1158. package/sqlite-proxy/driver.js +1 -1
  1159. package/sqlite-proxy/driver.js.map +1 -1
  1160. package/sqlite-proxy/session.cjs.map +1 -1
  1161. package/sqlite-proxy/session.d.cts +6 -6
  1162. package/sqlite-proxy/session.d.ts +6 -6
  1163. package/sqlite-proxy/session.js.map +1 -1
  1164. package/supabase/rls.d.cts +30 -43
  1165. package/supabase/rls.d.ts +30 -43
  1166. package/table.cjs +13 -12
  1167. package/table.cjs.map +1 -1
  1168. package/table.d.cts +26 -35
  1169. package/table.d.ts +26 -35
  1170. package/table.js +11 -10
  1171. package/table.js.map +1 -1
  1172. package/tidb-serverless/driver.cjs +1 -1
  1173. package/tidb-serverless/driver.cjs.map +1 -1
  1174. package/tidb-serverless/driver.js +1 -1
  1175. package/tidb-serverless/driver.js.map +1 -1
  1176. package/tidb-serverless/session.cjs.map +1 -1
  1177. package/tidb-serverless/session.d.cts +7 -7
  1178. package/tidb-serverless/session.d.ts +7 -7
  1179. package/tidb-serverless/session.js.map +1 -1
  1180. package/utils.cjs +5 -0
  1181. package/utils.cjs.map +1 -1
  1182. package/utils.d.cts +2 -2
  1183. package/utils.d.ts +2 -2
  1184. package/utils.js +5 -0
  1185. package/utils.js.map +1 -1
  1186. package/vercel-postgres/driver.cjs +1 -1
  1187. package/vercel-postgres/driver.cjs.map +1 -1
  1188. package/vercel-postgres/driver.d.cts +2 -2
  1189. package/vercel-postgres/driver.d.ts +2 -2
  1190. package/vercel-postgres/driver.js +1 -1
  1191. package/vercel-postgres/driver.js.map +1 -1
  1192. package/vercel-postgres/session.cjs.map +1 -1
  1193. package/vercel-postgres/session.d.cts +6 -6
  1194. package/vercel-postgres/session.d.ts +6 -6
  1195. package/vercel-postgres/session.js.map +1 -1
  1196. package/version.cjs +1 -1
  1197. package/version.d.cts +1 -1
  1198. package/version.d.ts +1 -1
  1199. package/version.js +1 -1
  1200. package/xata-http/driver.cjs +1 -1
  1201. package/xata-http/driver.cjs.map +1 -1
  1202. package/xata-http/driver.d.cts +2 -2
  1203. package/xata-http/driver.d.ts +2 -2
  1204. package/xata-http/driver.js +1 -1
  1205. package/xata-http/driver.js.map +1 -1
  1206. package/xata-http/session.cjs.map +1 -1
  1207. package/xata-http/session.d.cts +6 -6
  1208. package/xata-http/session.d.ts +6 -6
  1209. package/xata-http/session.js.map +1 -1
  1210. package/knex/index.cjs +0 -2
  1211. package/knex/index.cjs.map +0 -1
  1212. package/knex/index.d.cts +0 -9
  1213. package/knex/index.d.ts +0 -9
  1214. package/knex/index.js +0 -1
  1215. package/knex/index.js.map +0 -1
  1216. package/kysely/index.cjs +0 -17
  1217. package/kysely/index.cjs.map +0 -1
  1218. package/kysely/index.d.cts +0 -16
  1219. package/kysely/index.d.ts +0 -16
  1220. package/kysely/index.js +0 -1
  1221. package/kysely/index.js.map +0 -1
package/gel-core/db.d.cts CHANGED
@@ -6,7 +6,7 @@ import { GelDeleteBase, GelInsertBuilder, GelSelectBuilder, GelUpdateBuilder, Qu
6
6
  import type { GelQueryResultHKT, GelSession, GelTransaction } from "./session.cjs";
7
7
  import type { GelTable } from "./table.cjs";
8
8
  import type { TypedQueryBuilder } from "../query-builders/query-builder.cjs";
9
- import type { AnyRelations, EmptyRelations, ExtractTablesWithRelations, TablesRelationalConfig } from "../relations.cjs";
9
+ import type { AnyRelations, EmptyRelations } from "../relations.cjs";
10
10
  import { type ColumnsSelection, type SQL, type SQLWrapper } from "../sql/sql.cjs";
11
11
  import { WithSubquery } from "../subquery.cjs";
12
12
  import type { DrizzleTypeError } from "../utils.cjs";
@@ -18,27 +18,27 @@ import { GelRaw } from "./query-builders/raw.cjs";
18
18
  import type { SelectedFields } from "./query-builders/select.types.cjs";
19
19
  import type { WithSubqueryWithSelection } from "./subquery.cjs";
20
20
  import type { GelViewBase } from "./view-base.cjs";
21
- export declare class GelDatabase<TQueryResult extends GelQueryResultHKT, TFullSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations, TTablesConfig extends TablesRelationalConfig = ExtractTablesWithRelations<TRelations>, TSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>> {
21
+ export declare class GelDatabase<TQueryResult extends GelQueryResultHKT, TFullSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations, TSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>> {
22
22
  static readonly [entityKind]: string;
23
23
  readonly _: {
24
24
  readonly schema: TSchema | undefined;
25
25
  readonly fullSchema: TFullSchema;
26
26
  readonly tableNamesMap: Record<string, string>;
27
27
  readonly relations: TRelations;
28
- readonly session: GelSession<TQueryResult, TFullSchema, TRelations, TTablesConfig, TSchema>;
28
+ readonly session: GelSession<TQueryResult, TFullSchema, TRelations, TSchema>;
29
29
  };
30
30
  /** @deprecated */
31
31
  _query: TFullSchema extends Record<string, never> ? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'> : {
32
32
  [K in keyof TSchema]: _RelationalQueryBuilder<TSchema, TSchema[K]>;
33
33
  };
34
34
  query: {
35
- [K in keyof TRelations['tables']]: RelationalQueryBuilder<TTablesConfig, TTablesConfig[K]>;
35
+ [K in keyof TRelations]: RelationalQueryBuilder<TRelations, TRelations[K]>;
36
36
  };
37
37
  constructor(
38
38
  /** @internal */
39
39
  dialect: GelDialect,
40
40
  /** @internal */
41
- session: GelSession<any, any, any, any, any>, relations: AnyRelations | undefined, schema: V1.RelationalSchemaConfig<TSchema> | undefined);
41
+ session: GelSession<any, any, any, any>, relations: TRelations, schema: V1.RelationalSchemaConfig<TSchema> | undefined);
42
42
  /**
43
43
  * Creates a subquery that defines a temporary named result set as a CTE.
44
44
  *
@@ -74,7 +74,7 @@ export declare class GelDatabase<TQueryResult extends GelQueryResultHKT, TFullSc
74
74
  $with<TAlias extends string>(alias: TAlias): {
75
75
  as<TSelection extends ColumnsSelection>(qb: TypedQueryBuilder<TSelection> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>)): WithSubqueryWithSelection<TSelection, TAlias>;
76
76
  };
77
- $count(source: GelTable | GelViewBase | SQL | SQLWrapper, filters?: SQL<unknown>): GelCountBuilder<GelSession<any, any, any, any, any>>;
77
+ $count(source: GelTable | GelViewBase | SQL | SQLWrapper, filters?: SQL<unknown>): GelCountBuilder<GelSession<any, any, any, any>>;
78
78
  /**
79
79
  * Incorporates a previously defined CTE (using `$with`) into the main query.
80
80
  *
@@ -284,9 +284,9 @@ export declare class GelDatabase<TQueryResult extends GelQueryResultHKT, TFullSc
284
284
  */
285
285
  delete<TTable extends GelTable>(table: TTable): GelDeleteBase<TTable, TQueryResult>;
286
286
  execute<TRow extends Record<string, unknown> = Record<string, unknown>>(query: SQLWrapper | string): GelRaw<TRow[]>;
287
- transaction<T>(transaction: (tx: GelTransaction<TQueryResult, TFullSchema, TRelations, TTablesConfig, TSchema>) => Promise<T>): Promise<T>;
287
+ transaction<T>(transaction: (tx: GelTransaction<TQueryResult, TFullSchema, TRelations, TSchema>) => Promise<T>): Promise<T>;
288
288
  }
289
289
  export type GelWithReplicas<Q> = Q & {
290
290
  $primary: Q;
291
291
  };
292
- export declare const withReplicas: <HKT extends GelQueryResultHKT, TFullSchema extends Record<string, unknown>, TRelations extends AnyRelations, TTablesConfig extends TablesRelationalConfig, TSchema extends V1.TablesRelationalConfig, Q extends GelDatabase<HKT, TFullSchema, TRelations, TRelations extends EmptyRelations ? TTablesConfig : ExtractTablesWithRelations<TRelations>, TSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema>>(primary: Q, replicas: [Q, ...Q[]], getReplica?: (replicas: Q[]) => Q) => GelWithReplicas<Q>;
292
+ export declare const withReplicas: <HKT extends GelQueryResultHKT, TFullSchema extends Record<string, unknown>, TRelations extends AnyRelations, TSchema extends V1.TablesRelationalConfig, Q extends GelDatabase<HKT, TFullSchema, TRelations, TSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema>>(primary: Q, replicas: [Q, ...Q[]], getReplica?: (replicas: Q[]) => Q) => GelWithReplicas<Q>;
package/gel-core/db.d.ts CHANGED
@@ -6,7 +6,7 @@ import { GelDeleteBase, GelInsertBuilder, GelSelectBuilder, GelUpdateBuilder, Qu
6
6
  import type { GelQueryResultHKT, GelSession, GelTransaction } from "./session.js";
7
7
  import type { GelTable } from "./table.js";
8
8
  import type { TypedQueryBuilder } from "../query-builders/query-builder.js";
9
- import type { AnyRelations, EmptyRelations, ExtractTablesWithRelations, TablesRelationalConfig } from "../relations.js";
9
+ import type { AnyRelations, EmptyRelations } from "../relations.js";
10
10
  import { type ColumnsSelection, type SQL, type SQLWrapper } from "../sql/sql.js";
11
11
  import { WithSubquery } from "../subquery.js";
12
12
  import type { DrizzleTypeError } from "../utils.js";
@@ -18,27 +18,27 @@ import { GelRaw } from "./query-builders/raw.js";
18
18
  import type { SelectedFields } from "./query-builders/select.types.js";
19
19
  import type { WithSubqueryWithSelection } from "./subquery.js";
20
20
  import type { GelViewBase } from "./view-base.js";
21
- export declare class GelDatabase<TQueryResult extends GelQueryResultHKT, TFullSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations, TTablesConfig extends TablesRelationalConfig = ExtractTablesWithRelations<TRelations>, TSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>> {
21
+ export declare class GelDatabase<TQueryResult extends GelQueryResultHKT, TFullSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations, TSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>> {
22
22
  static readonly [entityKind]: string;
23
23
  readonly _: {
24
24
  readonly schema: TSchema | undefined;
25
25
  readonly fullSchema: TFullSchema;
26
26
  readonly tableNamesMap: Record<string, string>;
27
27
  readonly relations: TRelations;
28
- readonly session: GelSession<TQueryResult, TFullSchema, TRelations, TTablesConfig, TSchema>;
28
+ readonly session: GelSession<TQueryResult, TFullSchema, TRelations, TSchema>;
29
29
  };
30
30
  /** @deprecated */
31
31
  _query: TFullSchema extends Record<string, never> ? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'> : {
32
32
  [K in keyof TSchema]: _RelationalQueryBuilder<TSchema, TSchema[K]>;
33
33
  };
34
34
  query: {
35
- [K in keyof TRelations['tables']]: RelationalQueryBuilder<TTablesConfig, TTablesConfig[K]>;
35
+ [K in keyof TRelations]: RelationalQueryBuilder<TRelations, TRelations[K]>;
36
36
  };
37
37
  constructor(
38
38
  /** @internal */
39
39
  dialect: GelDialect,
40
40
  /** @internal */
41
- session: GelSession<any, any, any, any, any>, relations: AnyRelations | undefined, schema: V1.RelationalSchemaConfig<TSchema> | undefined);
41
+ session: GelSession<any, any, any, any>, relations: TRelations, schema: V1.RelationalSchemaConfig<TSchema> | undefined);
42
42
  /**
43
43
  * Creates a subquery that defines a temporary named result set as a CTE.
44
44
  *
@@ -74,7 +74,7 @@ export declare class GelDatabase<TQueryResult extends GelQueryResultHKT, TFullSc
74
74
  $with<TAlias extends string>(alias: TAlias): {
75
75
  as<TSelection extends ColumnsSelection>(qb: TypedQueryBuilder<TSelection> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>)): WithSubqueryWithSelection<TSelection, TAlias>;
76
76
  };
77
- $count(source: GelTable | GelViewBase | SQL | SQLWrapper, filters?: SQL<unknown>): GelCountBuilder<GelSession<any, any, any, any, any>>;
77
+ $count(source: GelTable | GelViewBase | SQL | SQLWrapper, filters?: SQL<unknown>): GelCountBuilder<GelSession<any, any, any, any>>;
78
78
  /**
79
79
  * Incorporates a previously defined CTE (using `$with`) into the main query.
80
80
  *
@@ -284,9 +284,9 @@ export declare class GelDatabase<TQueryResult extends GelQueryResultHKT, TFullSc
284
284
  */
285
285
  delete<TTable extends GelTable>(table: TTable): GelDeleteBase<TTable, TQueryResult>;
286
286
  execute<TRow extends Record<string, unknown> = Record<string, unknown>>(query: SQLWrapper | string): GelRaw<TRow[]>;
287
- transaction<T>(transaction: (tx: GelTransaction<TQueryResult, TFullSchema, TRelations, TTablesConfig, TSchema>) => Promise<T>): Promise<T>;
287
+ transaction<T>(transaction: (tx: GelTransaction<TQueryResult, TFullSchema, TRelations, TSchema>) => Promise<T>): Promise<T>;
288
288
  }
289
289
  export type GelWithReplicas<Q> = Q & {
290
290
  $primary: Q;
291
291
  };
292
- export declare const withReplicas: <HKT extends GelQueryResultHKT, TFullSchema extends Record<string, unknown>, TRelations extends AnyRelations, TTablesConfig extends TablesRelationalConfig, TSchema extends V1.TablesRelationalConfig, Q extends GelDatabase<HKT, TFullSchema, TRelations, TRelations extends EmptyRelations ? TTablesConfig : ExtractTablesWithRelations<TRelations>, TSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema>>(primary: Q, replicas: [Q, ...Q[]], getReplica?: (replicas: Q[]) => Q) => GelWithReplicas<Q>;
292
+ export declare const withReplicas: <HKT extends GelQueryResultHKT, TFullSchema extends Record<string, unknown>, TRelations extends AnyRelations, TSchema extends V1.TablesRelationalConfig, Q extends GelDatabase<HKT, TFullSchema, TRelations, TSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema>>(primary: Q, replicas: [Q, ...Q[]], getReplica?: (replicas: Q[]) => Q) => GelWithReplicas<Q>;
package/gel-core/db.js CHANGED
@@ -17,18 +17,17 @@ class GelDatabase {
17
17
  constructor(dialect, session, relations, schema) {
18
18
  this.dialect = dialect;
19
19
  this.session = session;
20
- const rel = relations ?? {};
21
20
  this._ = schema ? {
22
21
  schema: schema.schema,
23
22
  fullSchema: schema.fullSchema,
24
23
  tableNamesMap: schema.tableNamesMap,
25
- relations: rel,
24
+ relations,
26
25
  session
27
26
  } : {
28
27
  schema: void 0,
29
28
  fullSchema: {},
30
29
  tableNamesMap: {},
31
- relations: rel,
30
+ relations,
32
31
  session
33
32
  };
34
33
  this._query = {};
@@ -46,18 +45,14 @@ class GelDatabase {
46
45
  }
47
46
  }
48
47
  this.query = {};
49
- if (relations) {
50
- for (const [tableName, relation] of Object.entries(relations.tablesConfig)) {
51
- this.query[tableName] = new RelationalQueryBuilder(
52
- relations.tables,
53
- relations.tablesConfig,
54
- relations.tableNamesMap,
55
- relation.table,
56
- relation,
57
- dialect,
58
- session
59
- );
60
- }
48
+ for (const [tableName, relation] of Object.entries(relations)) {
49
+ this.query[tableName] = new RelationalQueryBuilder(
50
+ relations,
51
+ relations[relation.name].table,
52
+ relation,
53
+ dialect,
54
+ session
55
+ );
61
56
  }
62
57
  this.$cache = { invalidate: async (_params) => {
63
58
  } };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/gel-core/db.ts"],"sourcesContent":["import type * as V1 from '~/_relations.ts';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { GelDialect } from '~/gel-core/dialect.ts';\nimport {\n\tGelDeleteBase,\n\tGelInsertBuilder,\n\tGelSelectBuilder,\n\tGelUpdateBuilder,\n\tQueryBuilder,\n} from '~/gel-core/query-builders/index.ts';\nimport type { GelQueryResultHKT, GelSession, GelTransaction, PreparedQueryConfig } from '~/gel-core/session.ts';\nimport type { GelTable } from '~/gel-core/table.ts';\nimport type { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type { AnyRelations, EmptyRelations, ExtractTablesWithRelations, TablesRelationalConfig } from '~/relations.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport { type ColumnsSelection, type SQL, sql, type SQLWrapper } from '~/sql/sql.ts';\nimport { WithSubquery } from '~/subquery.ts';\nimport type { DrizzleTypeError } from '~/utils.ts';\nimport type { GelColumn } from './columns/index.ts';\nimport { _RelationalQueryBuilder } from './query-builders/_query.ts';\nimport { GelCountBuilder } from './query-builders/count.ts';\nimport { RelationalQueryBuilder } from './query-builders/query.ts';\nimport { GelRaw } from './query-builders/raw.ts';\nimport type { SelectedFields } from './query-builders/select.types.ts';\nimport type { WithSubqueryWithSelection } from './subquery.ts';\nimport type { GelViewBase } from './view-base.ts';\n\nexport class GelDatabase<\n\tTQueryResult extends GelQueryResultHKT,\n\tTFullSchema extends Record<string, unknown> = Record<string, never>,\n\tTRelations extends AnyRelations = EmptyRelations,\n\tTTablesConfig extends TablesRelationalConfig = ExtractTablesWithRelations<TRelations>,\n\tTSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>,\n> {\n\tstatic readonly [entityKind]: string = 'GelDatabase';\n\n\tdeclare readonly _: {\n\t\treadonly schema: TSchema | undefined;\n\t\treadonly fullSchema: TFullSchema;\n\t\treadonly tableNamesMap: Record<string, string>;\n\t\treadonly relations: TRelations;\n\t\treadonly session: GelSession<TQueryResult, TFullSchema, TRelations, TTablesConfig, TSchema>;\n\t};\n\n\t/** @deprecated */\n\t_query: TFullSchema extends Record<string, never>\n\t\t? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'>\n\t\t: {\n\t\t\t[K in keyof TSchema]: _RelationalQueryBuilder<TSchema, TSchema[K]>;\n\t\t};\n\n\t// TO-DO: Figure out how to pass DrizzleTypeError without breaking withReplicas\n\tquery: {\n\t\t[K in keyof TRelations['tables']]: RelationalQueryBuilder<\n\t\t\tTTablesConfig,\n\t\t\tTTablesConfig[K]\n\t\t>;\n\t};\n\n\tconstructor(\n\t\t/** @internal */\n\t\treadonly dialect: GelDialect,\n\t\t/** @internal */\n\t\treadonly session: GelSession<any, any, any, any, any>,\n\t\trelations: AnyRelations | undefined,\n\t\tschema: V1.RelationalSchemaConfig<TSchema> | undefined,\n\t) {\n\t\tconst rel = relations ?? {} as EmptyRelations;\n\n\t\tthis._ = schema\n\t\t\t? {\n\t\t\t\tschema: schema.schema,\n\t\t\t\tfullSchema: schema.fullSchema as TFullSchema,\n\t\t\t\ttableNamesMap: schema.tableNamesMap,\n\t\t\t\trelations: rel as TRelations,\n\t\t\t\tsession,\n\t\t\t}\n\t\t\t: {\n\t\t\t\tschema: undefined,\n\t\t\t\tfullSchema: {} as TFullSchema,\n\t\t\t\ttableNamesMap: {},\n\t\t\t\trelations: rel as TRelations,\n\t\t\t\tsession,\n\t\t\t};\n\t\tthis._query = {} as typeof this['_query'];\n\t\tif (this._.schema) {\n\t\t\tfor (const [tableName, columns] of Object.entries(this._.schema)) {\n\t\t\t\t(this._query as GelDatabase<TQueryResult, Record<string, any>>['_query'])[tableName] =\n\t\t\t\t\tnew _RelationalQueryBuilder(\n\t\t\t\t\t\tschema!.fullSchema,\n\t\t\t\t\t\tthis._.schema,\n\t\t\t\t\t\tthis._.tableNamesMap,\n\t\t\t\t\t\tschema!.fullSchema[tableName] as GelTable,\n\t\t\t\t\t\tcolumns,\n\t\t\t\t\t\tdialect,\n\t\t\t\t\t\tsession,\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.query = {} as typeof this['query'];\n\t\tif (relations) {\n\t\t\tfor (const [tableName, relation] of Object.entries(relations.tablesConfig)) {\n\t\t\t\t(this.query as GelDatabase<\n\t\t\t\t\tTQueryResult,\n\t\t\t\t\tTSchema,\n\t\t\t\t\tAnyRelations,\n\t\t\t\t\tTablesRelationalConfig,\n\t\t\t\t\tV1.TablesRelationalConfig\n\t\t\t\t>['query'])[tableName] = new RelationalQueryBuilder(\n\t\t\t\t\trelations.tables,\n\t\t\t\t\trelations.tablesConfig,\n\t\t\t\t\trelations.tableNamesMap,\n\t\t\t\t\trelation.table as GelTable,\n\t\t\t\t\trelation,\n\t\t\t\t\tdialect,\n\t\t\t\t\tsession,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tthis.$cache = { invalidate: async (_params: any) => {} };\n\t}\n\n\t/**\n\t * Creates a subquery that defines a temporary named result set as a CTE.\n\t *\n\t * It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param alias The alias for the subquery.\n\t *\n\t * Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Create a subquery with alias 'sq' and use it in the select query\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * const result = await db.with(sq).select().from(sq);\n\t * ```\n\t *\n\t * To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them:\n\t *\n\t * ```ts\n\t * // Select an arbitrary SQL value as a field in a CTE and reference it in the main query\n\t * const sq = db.$with('sq').as(db.select({\n\t * name: sql<string>`upper(${users.name})`.as('name'),\n\t * })\n\t * .from(users));\n\t *\n\t * const result = await db.with(sq).select({ name: sq.name }).from(sq);\n\t * ```\n\t */\n\t$with<TAlias extends string>(alias: TAlias) {\n\t\tconst self = this;\n\t\treturn {\n\t\t\tas<TSelection extends ColumnsSelection>(\n\t\t\t\tqb: TypedQueryBuilder<TSelection> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>),\n\t\t\t): WithSubqueryWithSelection<TSelection, TAlias> {\n\t\t\t\tif (typeof qb === 'function') {\n\t\t\t\t\tqb = qb(new QueryBuilder(self.dialect));\n\t\t\t\t}\n\n\t\t\t\treturn new Proxy(\n\t\t\t\t\tnew WithSubquery(qb.getSQL(), qb.getSelectedFields() as SelectedFields, alias, true),\n\t\t\t\t\tnew SelectionProxyHandler({ alias, sqlAliasedBehavior: 'alias', sqlBehavior: 'error' }),\n\t\t\t\t) as WithSubqueryWithSelection<TSelection, TAlias>;\n\t\t\t},\n\t\t};\n\t}\n\n\t$count(\n\t\tsource: GelTable | GelViewBase | SQL | SQLWrapper,\n\t\tfilters?: SQL<unknown>,\n\t) {\n\t\treturn new GelCountBuilder({ source, filters, session: this.session });\n\t}\n\n\t/**\n\t * Incorporates a previously defined CTE (using `$with`) into the main query.\n\t *\n\t * This method allows the main query to reference a temporary named result set.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param queries The CTEs to incorporate into the main query.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Define a subquery 'sq' as a CTE using $with\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * // Incorporate the CTE 'sq' into the main query and select from it\n\t * const result = await db.with(sq).select().from(sq);\n\t * ```\n\t */\n\twith(...queries: WithSubquery[]) {\n\t\tconst self = this;\n\n\t\t/**\n\t\t * Creates a select query.\n\t\t *\n\t\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Select all columns and all rows from the 'cars' table\n\t\t * const allCars: Car[] = await db.select().from(cars);\n\t\t *\n\t\t * // Select specific columns and all rows from the 'cars' table\n\t\t * const carsIdsAndBrands: { id: number; brand: string }[] = await db.select({\n\t\t * id: cars.id,\n\t\t * brand: cars.brand\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t *\n\t\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t\t *\n\t\t * ```ts\n\t\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = await db.select({\n\t\t * id: cars.id,\n\t\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t */\n\t\tfunction select(): GelSelectBuilder<undefined>;\n\t\tfunction select<TSelection extends SelectedFields>(fields: TSelection): GelSelectBuilder<TSelection>;\n\t\tfunction select(fields?: SelectedFields): GelSelectBuilder<SelectedFields | undefined> {\n\t\t\treturn new GelSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Adds `distinct` expression to the select query.\n\t\t *\n\t\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t * ```ts\n\t\t * // Select all unique rows from the 'cars' table\n\t\t * await db.selectDistinct()\n\t\t * .from(cars)\n\t\t * .orderBy(cars.id, cars.brand, cars.color);\n\t\t *\n\t\t * // Select all unique brands from the 'cars' table\n\t\t * await db.selectDistinct({ brand: cars.brand })\n\t\t * .from(cars)\n\t\t * .orderBy(cars.brand);\n\t\t * ```\n\t\t */\n\t\tfunction selectDistinct(): GelSelectBuilder<undefined>;\n\t\tfunction selectDistinct<TSelection extends SelectedFields>(fields: TSelection): GelSelectBuilder<TSelection>;\n\t\tfunction selectDistinct(fields?: SelectedFields): GelSelectBuilder<SelectedFields | undefined> {\n\t\t\treturn new GelSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t\tdistinct: true,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Adds `distinct on` expression to the select query.\n\t\t *\n\t\t * Calling this method will specify how the unique rows are determined.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t\t *\n\t\t * @param on The expression defining uniqueness.\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t * ```ts\n\t\t * // Select the first row for each unique brand from the 'cars' table\n\t\t * await db.selectDistinctOn([cars.brand])\n\t\t * .from(cars)\n\t\t * .orderBy(cars.brand);\n\t\t *\n\t\t * // Selects the first occurrence of each unique car brand along with its color from the 'cars' table\n\t\t * await db.selectDistinctOn([cars.brand], { brand: cars.brand, color: cars.color })\n\t\t * .from(cars)\n\t\t * .orderBy(cars.brand, cars.color);\n\t\t * ```\n\t\t */\n\t\tfunction selectDistinctOn(on: (GelColumn | SQLWrapper)[]): GelSelectBuilder<undefined>;\n\t\tfunction selectDistinctOn<TSelection extends SelectedFields>(\n\t\t\ton: (GelColumn | SQLWrapper)[],\n\t\t\tfields: TSelection,\n\t\t): GelSelectBuilder<TSelection>;\n\t\tfunction selectDistinctOn(\n\t\t\ton: (GelColumn | SQLWrapper)[],\n\t\t\tfields?: SelectedFields,\n\t\t): GelSelectBuilder<SelectedFields | undefined> {\n\t\t\treturn new GelSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t\tdistinct: { on },\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Creates an update query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t\t *\n\t\t * Use `.set()` method to specify which values to update.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t\t *\n\t\t * @param table The table to update.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Update all rows in the 'cars' table\n\t\t * await db.update(cars).set({ color: 'red' });\n\t\t *\n\t\t * // Update rows with filters and conditions\n\t\t * await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t\t *\n\t\t * // Update with returning clause\n\t\t * const updatedCar: Car[] = await db.update(cars)\n\t\t * .set({ color: 'red' })\n\t\t * .where(eq(cars.id, 1))\n\t\t * .returning();\n\t\t * ```\n\t\t */\n\t\tfunction update<TTable extends GelTable>(table: TTable): GelUpdateBuilder<TTable, TQueryResult> {\n\t\t\treturn new GelUpdateBuilder(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\t/**\n\t\t * Creates an insert query.\n\t\t *\n\t\t * Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/insert}\n\t\t *\n\t\t * @param table The table to insert into.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Insert one row\n\t\t * await db.insert(cars).values({ brand: 'BMW' });\n\t\t *\n\t\t * // Insert multiple rows\n\t\t * await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);\n\t\t *\n\t\t * // Insert with returning clause\n\t\t * const insertedCar: Car[] = await db.insert(cars)\n\t\t * .values({ brand: 'BMW' })\n\t\t * .returning();\n\t\t * ```\n\t\t */\n\t\tfunction insert<TTable extends GelTable>(table: TTable): GelInsertBuilder<TTable, TQueryResult> {\n\t\t\treturn new GelInsertBuilder(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\t/**\n\t\t * Creates a delete query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t\t *\n\t\t * @param table The table to delete from.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Delete all rows in the 'cars' table\n\t\t * await db.delete(cars);\n\t\t *\n\t\t * // Delete rows with filters and conditions\n\t\t * await db.delete(cars).where(eq(cars.color, 'green'));\n\t\t *\n\t\t * // Delete with returning clause\n\t\t * const deletedCar: Car[] = await db.delete(cars)\n\t\t * .where(eq(cars.id, 1))\n\t\t * .returning();\n\t\t * ```\n\t\t */\n\t\tfunction delete_<TTable extends GelTable>(table: TTable): GelDeleteBase<TTable, TQueryResult> {\n\t\t\treturn new GelDeleteBase(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\treturn { select, selectDistinct, selectDistinctOn, update, insert, delete: delete_ };\n\t}\n\n\t/**\n\t * Creates a select query.\n\t *\n\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all columns and all rows from the 'cars' table\n\t * const allCars: Car[] = await db.select().from(cars);\n\t *\n\t * // Select specific columns and all rows from the 'cars' table\n\t * const carsIdsAndBrands: { id: number; brand: string }[] = await db.select({\n\t * id: cars.id,\n\t * brand: cars.brand\n\t * })\n\t * .from(cars);\n\t * ```\n\t *\n\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t *\n\t * ```ts\n\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = await db.select({\n\t * id: cars.id,\n\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t * })\n\t * .from(cars);\n\t * ```\n\t */\n\tselect(): GelSelectBuilder<undefined>;\n\tselect<TSelection extends SelectedFields>(fields: TSelection): GelSelectBuilder<TSelection>;\n\tselect(fields?: SelectedFields): GelSelectBuilder<SelectedFields | undefined> {\n\t\treturn new GelSelectBuilder({\n\t\t\tfields: fields ?? undefined,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t});\n\t}\n\n\t/**\n\t * Adds `distinct` expression to the select query.\n\t *\n\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t * ```ts\n\t * // Select all unique rows from the 'cars' table\n\t * await db.selectDistinct()\n\t * .from(cars)\n\t * .orderBy(cars.id, cars.brand, cars.color);\n\t *\n\t * // Select all unique brands from the 'cars' table\n\t * await db.selectDistinct({ brand: cars.brand })\n\t * .from(cars)\n\t * .orderBy(cars.brand);\n\t * ```\n\t */\n\tselectDistinct(): GelSelectBuilder<undefined>;\n\tselectDistinct<TSelection extends SelectedFields>(fields: TSelection): GelSelectBuilder<TSelection>;\n\tselectDistinct(fields?: SelectedFields): GelSelectBuilder<SelectedFields | undefined> {\n\t\treturn new GelSelectBuilder({\n\t\t\tfields: fields ?? undefined,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t\tdistinct: true,\n\t\t});\n\t}\n\n\t/**\n\t * Adds `distinct on` expression to the select query.\n\t *\n\t * Calling this method will specify how the unique rows are determined.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t *\n\t * @param on The expression defining uniqueness.\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t * ```ts\n\t * // Select the first row for each unique brand from the 'cars' table\n\t * await db.selectDistinctOn([cars.brand])\n\t * .from(cars)\n\t * .orderBy(cars.brand);\n\t *\n\t * // Selects the first occurrence of each unique car brand along with its color from the 'cars' table\n\t * await db.selectDistinctOn([cars.brand], { brand: cars.brand, color: cars.color })\n\t * .from(cars)\n\t * .orderBy(cars.brand, cars.color);\n\t * ```\n\t */\n\tselectDistinctOn(on: (GelColumn | SQLWrapper)[]): GelSelectBuilder<undefined>;\n\tselectDistinctOn<TSelection extends SelectedFields>(\n\t\ton: (GelColumn | SQLWrapper)[],\n\t\tfields: TSelection,\n\t): GelSelectBuilder<TSelection>;\n\tselectDistinctOn(\n\t\ton: (GelColumn | SQLWrapper)[],\n\t\tfields?: SelectedFields,\n\t): GelSelectBuilder<SelectedFields | undefined> {\n\t\treturn new GelSelectBuilder({\n\t\t\tfields: fields ?? undefined,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t\tdistinct: { on },\n\t\t});\n\t}\n\n\t$cache: { invalidate: Cache['onMutate'] };\n\n\t/**\n\t * Creates an update query.\n\t *\n\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t *\n\t * Use `.set()` method to specify which values to update.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t *\n\t * @param table The table to update.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Update all rows in the 'cars' table\n\t * await db.update(cars).set({ color: 'red' });\n\t *\n\t * // Update rows with filters and conditions\n\t * await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t *\n\t * // Update with returning clause\n\t * const updatedCar: Car[] = await db.update(cars)\n\t * .set({ color: 'red' })\n\t * .where(eq(cars.id, 1))\n\t * .returning();\n\t * ```\n\t */\n\tupdate<TTable extends GelTable>(table: TTable): GelUpdateBuilder<TTable, TQueryResult> {\n\t\treturn new GelUpdateBuilder(table, this.session, this.dialect);\n\t}\n\n\t/**\n\t * Creates an insert query.\n\t *\n\t * Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/insert}\n\t *\n\t * @param table The table to insert into.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Insert one row\n\t * await db.insert(cars).values({ brand: 'BMW' });\n\t *\n\t * // Insert multiple rows\n\t * await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);\n\t *\n\t * // Insert with returning clause\n\t * const insertedCar: Car[] = await db.insert(cars)\n\t * .values({ brand: 'BMW' })\n\t * .returning();\n\t * ```\n\t */\n\tinsert<TTable extends GelTable>(table: TTable): GelInsertBuilder<TTable, TQueryResult> {\n\t\treturn new GelInsertBuilder(table, this.session, this.dialect);\n\t}\n\n\t/**\n\t * Creates a delete query.\n\t *\n\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t *\n\t * @param table The table to delete from.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Delete all rows in the 'cars' table\n\t * await db.delete(cars);\n\t *\n\t * // Delete rows with filters and conditions\n\t * await db.delete(cars).where(eq(cars.color, 'green'));\n\t *\n\t * // Delete with returning clause\n\t * const deletedCar: Car[] = await db.delete(cars)\n\t * .where(eq(cars.id, 1))\n\t * .returning();\n\t * ```\n\t */\n\tdelete<TTable extends GelTable>(table: TTable): GelDeleteBase<TTable, TQueryResult> {\n\t\treturn new GelDeleteBase(table, this.session, this.dialect);\n\t}\n\n\t// TODO views are not implemented\n\t// refreshMaterializedView<TView extends GelMaterializedView>(view: TView): GelRefreshMaterializedView<TQueryResult> {\n\t// \treturn new GelRefreshMaterializedView(view, this.session, this.dialect);\n\t// }\n\n\texecute<TRow extends Record<string, unknown> = Record<string, unknown>>(\n\t\tquery: SQLWrapper | string,\n\t): GelRaw<TRow[]> {\n\t\tconst sequel = typeof query === 'string' ? sql.raw(query) : query.getSQL();\n\t\tconst builtQuery = this.dialect.sqlToQuery(sequel);\n\t\tconst prepared = this.session.prepareQuery<\n\t\t\tPreparedQueryConfig & { execute: TRow[] }\n\t\t>(\n\t\t\tbuiltQuery,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t\tfalse,\n\t\t);\n\t\treturn new GelRaw(\n\t\t\t() => prepared.execute(undefined),\n\t\t\tsequel,\n\t\t\tbuiltQuery,\n\t\t\t(result) => prepared.mapResult(result, true),\n\t\t);\n\t}\n\n\ttransaction<T>(\n\t\ttransaction: (tx: GelTransaction<TQueryResult, TFullSchema, TRelations, TTablesConfig, TSchema>) => Promise<T>,\n\t): Promise<T> {\n\t\treturn this.session.transaction(transaction);\n\t}\n}\n\nexport type GelWithReplicas<Q> = Q & { $primary: Q };\n\nexport const withReplicas = <\n\tHKT extends GelQueryResultHKT,\n\tTFullSchema extends Record<string, unknown>,\n\tTRelations extends AnyRelations,\n\tTTablesConfig extends TablesRelationalConfig,\n\tTSchema extends V1.TablesRelationalConfig,\n\tQ extends GelDatabase<\n\t\tHKT,\n\t\tTFullSchema,\n\t\tTRelations,\n\t\tTRelations extends EmptyRelations ? TTablesConfig : ExtractTablesWithRelations<TRelations>,\n\t\tTSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema\n\t>,\n>(\n\tprimary: Q,\n\treplicas: [Q, ...Q[]],\n\tgetReplica: (replicas: Q[]) => Q = () => replicas[Math.floor(Math.random() * replicas.length)]!,\n): GelWithReplicas<Q> => {\n\tconst select: Q['select'] = (...args: []) => getReplica(replicas).select(...args);\n\tconst selectDistinct: Q['selectDistinct'] = (...args: []) => getReplica(replicas).selectDistinct(...args);\n\tconst selectDistinctOn: Q['selectDistinctOn'] = (...args: [any]) => getReplica(replicas).selectDistinctOn(...args);\n\tconst _with: Q['with'] = (...args: any) => getReplica(replicas).with(...args);\n\tconst $with: Q['$with'] = (arg: any) => getReplica(replicas).$with(arg);\n\n\tconst update: Q['update'] = (...args: [any]) => primary.update(...args);\n\tconst insert: Q['insert'] = (...args: [any]) => primary.insert(...args);\n\tconst $delete: Q['delete'] = (...args: [any]) => primary.delete(...args);\n\tconst execute: Q['execute'] = (...args: [any]) => primary.execute(...args);\n\tconst transaction: Q['transaction'] = (...args: [any]) => primary.transaction(...args);\n\t// const refreshMaterializedView: Q['refreshMaterializedView'] = (...args: [any]) =>\n\t// \tprimary.refreshMaterializedView(...args);\n\n\treturn {\n\t\t...primary,\n\t\tupdate,\n\t\tinsert,\n\t\tdelete: $delete,\n\t\texecute,\n\t\ttransaction,\n\t\t// refreshMaterializedView,\n\t\t$primary: primary,\n\t\tselect,\n\t\tselectDistinct,\n\t\tselectDistinctOn,\n\t\t$with,\n\t\twith: _with,\n\t\tget _query() {\n\t\t\treturn getReplica(replicas)._query;\n\t\t},\n\t\tget query() {\n\t\t\treturn getReplica(replicas).query;\n\t\t},\n\t};\n};\n"],"mappings":"AAEA,SAAS,kBAAkB;AAE3B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,6BAA6B;AACtC,SAA0C,WAA4B;AACtE,SAAS,oBAAoB;AAG7B,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AACvC,SAAS,cAAc;AAKhB,MAAM,YAMX;AAAA,EA0BD,YAEU,SAEA,SACT,WACA,QACC;AALQ;AAEA;AAIT,UAAM,MAAM,aAAa,CAAC;AAE1B,SAAK,IAAI,SACN;AAAA,MACD,QAAQ,OAAO;AAAA,MACf,YAAY,OAAO;AAAA,MACnB,eAAe,OAAO;AAAA,MACtB,WAAW;AAAA,MACX;AAAA,IACD,IACE;AAAA,MACD,QAAQ;AAAA,MACR,YAAY,CAAC;AAAA,MACb,eAAe,CAAC;AAAA,MAChB,WAAW;AAAA,MACX;AAAA,IACD;AACD,SAAK,SAAS,CAAC;AACf,QAAI,KAAK,EAAE,QAAQ;AAClB,iBAAW,CAAC,WAAW,OAAO,KAAK,OAAO,QAAQ,KAAK,EAAE,MAAM,GAAG;AACjE,QAAC,KAAK,OAAoE,SAAS,IAClF,IAAI;AAAA,UACH,OAAQ;AAAA,UACR,KAAK,EAAE;AAAA,UACP,KAAK,EAAE;AAAA,UACP,OAAQ,WAAW,SAAS;AAAA,UAC5B;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACF;AAAA,IACD;AACA,SAAK,QAAQ,CAAC;AACd,QAAI,WAAW;AACd,iBAAW,CAAC,WAAW,QAAQ,KAAK,OAAO,QAAQ,UAAU,YAAY,GAAG;A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D;","names":[]}
1
+ {"version":3,"sources":["../../src/gel-core/db.ts"],"sourcesContent":["import type * as V1 from '~/_relations.ts';\nimport type { Cache } from '~/cache/core/cache.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { GelDialect } from '~/gel-core/dialect.ts';\nimport {\n\tGelDeleteBase,\n\tGelInsertBuilder,\n\tGelSelectBuilder,\n\tGelUpdateBuilder,\n\tQueryBuilder,\n} from '~/gel-core/query-builders/index.ts';\nimport type { GelQueryResultHKT, GelSession, GelTransaction, PreparedQueryConfig } from '~/gel-core/session.ts';\nimport type { GelTable } from '~/gel-core/table.ts';\nimport type { TypedQueryBuilder } from '~/query-builders/query-builder.ts';\nimport type { AnyRelations, EmptyRelations } from '~/relations.ts';\nimport { SelectionProxyHandler } from '~/selection-proxy.ts';\nimport { type ColumnsSelection, type SQL, sql, type SQLWrapper } from '~/sql/sql.ts';\nimport { WithSubquery } from '~/subquery.ts';\nimport type { DrizzleTypeError } from '~/utils.ts';\nimport type { GelColumn } from './columns/index.ts';\nimport { _RelationalQueryBuilder } from './query-builders/_query.ts';\nimport { GelCountBuilder } from './query-builders/count.ts';\nimport { RelationalQueryBuilder } from './query-builders/query.ts';\nimport { GelRaw } from './query-builders/raw.ts';\nimport type { SelectedFields } from './query-builders/select.types.ts';\nimport type { WithSubqueryWithSelection } from './subquery.ts';\nimport type { GelViewBase } from './view-base.ts';\n\nexport class GelDatabase<\n\tTQueryResult extends GelQueryResultHKT,\n\tTFullSchema extends Record<string, unknown> = Record<string, never>,\n\tTRelations extends AnyRelations = EmptyRelations,\n\tTSchema extends V1.TablesRelationalConfig = V1.ExtractTablesWithRelations<TFullSchema>,\n> {\n\tstatic readonly [entityKind]: string = 'GelDatabase';\n\n\tdeclare readonly _: {\n\t\treadonly schema: TSchema | undefined;\n\t\treadonly fullSchema: TFullSchema;\n\t\treadonly tableNamesMap: Record<string, string>;\n\t\treadonly relations: TRelations;\n\t\treadonly session: GelSession<TQueryResult, TFullSchema, TRelations, TSchema>;\n\t};\n\n\t/** @deprecated */\n\t_query: TFullSchema extends Record<string, never>\n\t\t? DrizzleTypeError<'Seems like the schema generic is missing - did you forget to add it to your DB type?'>\n\t\t: {\n\t\t\t[K in keyof TSchema]: _RelationalQueryBuilder<TSchema, TSchema[K]>;\n\t\t};\n\n\t// TO-DO: Figure out how to pass DrizzleTypeError without breaking withReplicas\n\tquery: {\n\t\t[K in keyof TRelations]: RelationalQueryBuilder<\n\t\t\tTRelations,\n\t\t\tTRelations[K]\n\t\t>;\n\t};\n\n\tconstructor(\n\t\t/** @internal */\n\t\treadonly dialect: GelDialect,\n\t\t/** @internal */\n\t\treadonly session: GelSession<any, any, any, any>,\n\t\trelations: TRelations,\n\t\tschema: V1.RelationalSchemaConfig<TSchema> | undefined,\n\t) {\n\t\tthis._ = schema\n\t\t\t? {\n\t\t\t\tschema: schema.schema,\n\t\t\t\tfullSchema: schema.fullSchema as TFullSchema,\n\t\t\t\ttableNamesMap: schema.tableNamesMap,\n\t\t\t\trelations: relations,\n\t\t\t\tsession,\n\t\t\t}\n\t\t\t: {\n\t\t\t\tschema: undefined,\n\t\t\t\tfullSchema: {} as TFullSchema,\n\t\t\t\ttableNamesMap: {},\n\t\t\t\trelations: relations,\n\t\t\t\tsession,\n\t\t\t};\n\t\tthis._query = {} as typeof this['_query'];\n\t\tif (this._.schema) {\n\t\t\tfor (const [tableName, columns] of Object.entries(this._.schema)) {\n\t\t\t\t(this._query as GelDatabase<TQueryResult, Record<string, any>>['_query'])[tableName] =\n\t\t\t\t\tnew _RelationalQueryBuilder(\n\t\t\t\t\t\tschema!.fullSchema,\n\t\t\t\t\t\tthis._.schema,\n\t\t\t\t\t\tthis._.tableNamesMap,\n\t\t\t\t\t\tschema!.fullSchema[tableName] as GelTable,\n\t\t\t\t\t\tcolumns,\n\t\t\t\t\t\tdialect,\n\t\t\t\t\t\tsession,\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tthis.query = {} as typeof this['query'];\n\t\tfor (const [tableName, relation] of Object.entries(relations)) {\n\t\t\t(this.query as GelDatabase<\n\t\t\t\tTQueryResult,\n\t\t\t\tTSchema,\n\t\t\t\tAnyRelations,\n\t\t\t\tV1.TablesRelationalConfig\n\t\t\t>['query'])[tableName] = new RelationalQueryBuilder(\n\t\t\t\trelations,\n\t\t\t\trelations[relation.name]!.table as GelTable,\n\t\t\t\trelation,\n\t\t\t\tdialect,\n\t\t\t\tsession,\n\t\t\t);\n\t\t}\n\n\t\tthis.$cache = { invalidate: async (_params: any) => {} };\n\t}\n\n\t/**\n\t * Creates a subquery that defines a temporary named result set as a CTE.\n\t *\n\t * It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param alias The alias for the subquery.\n\t *\n\t * Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Create a subquery with alias 'sq' and use it in the select query\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * const result = await db.with(sq).select().from(sq);\n\t * ```\n\t *\n\t * To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them:\n\t *\n\t * ```ts\n\t * // Select an arbitrary SQL value as a field in a CTE and reference it in the main query\n\t * const sq = db.$with('sq').as(db.select({\n\t * name: sql<string>`upper(${users.name})`.as('name'),\n\t * })\n\t * .from(users));\n\t *\n\t * const result = await db.with(sq).select({ name: sq.name }).from(sq);\n\t * ```\n\t */\n\t$with<TAlias extends string>(alias: TAlias) {\n\t\tconst self = this;\n\t\treturn {\n\t\t\tas<TSelection extends ColumnsSelection>(\n\t\t\t\tqb: TypedQueryBuilder<TSelection> | ((qb: QueryBuilder) => TypedQueryBuilder<TSelection>),\n\t\t\t): WithSubqueryWithSelection<TSelection, TAlias> {\n\t\t\t\tif (typeof qb === 'function') {\n\t\t\t\t\tqb = qb(new QueryBuilder(self.dialect));\n\t\t\t\t}\n\n\t\t\t\treturn new Proxy(\n\t\t\t\t\tnew WithSubquery(qb.getSQL(), qb.getSelectedFields() as SelectedFields, alias, true),\n\t\t\t\t\tnew SelectionProxyHandler({ alias, sqlAliasedBehavior: 'alias', sqlBehavior: 'error' }),\n\t\t\t\t) as WithSubqueryWithSelection<TSelection, TAlias>;\n\t\t\t},\n\t\t};\n\t}\n\n\t$count(\n\t\tsource: GelTable | GelViewBase | SQL | SQLWrapper,\n\t\tfilters?: SQL<unknown>,\n\t) {\n\t\treturn new GelCountBuilder({ source, filters, session: this.session });\n\t}\n\n\t/**\n\t * Incorporates a previously defined CTE (using `$with`) into the main query.\n\t *\n\t * This method allows the main query to reference a temporary named result set.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#with-clause}\n\t *\n\t * @param queries The CTEs to incorporate into the main query.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Define a subquery 'sq' as a CTE using $with\n\t * const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));\n\t *\n\t * // Incorporate the CTE 'sq' into the main query and select from it\n\t * const result = await db.with(sq).select().from(sq);\n\t * ```\n\t */\n\twith(...queries: WithSubquery[]) {\n\t\tconst self = this;\n\n\t\t/**\n\t\t * Creates a select query.\n\t\t *\n\t\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Select all columns and all rows from the 'cars' table\n\t\t * const allCars: Car[] = await db.select().from(cars);\n\t\t *\n\t\t * // Select specific columns and all rows from the 'cars' table\n\t\t * const carsIdsAndBrands: { id: number; brand: string }[] = await db.select({\n\t\t * id: cars.id,\n\t\t * brand: cars.brand\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t *\n\t\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t\t *\n\t\t * ```ts\n\t\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = await db.select({\n\t\t * id: cars.id,\n\t\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t\t * })\n\t\t * .from(cars);\n\t\t * ```\n\t\t */\n\t\tfunction select(): GelSelectBuilder<undefined>;\n\t\tfunction select<TSelection extends SelectedFields>(fields: TSelection): GelSelectBuilder<TSelection>;\n\t\tfunction select(fields?: SelectedFields): GelSelectBuilder<SelectedFields | undefined> {\n\t\t\treturn new GelSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Adds `distinct` expression to the select query.\n\t\t *\n\t\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t\t *\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t * ```ts\n\t\t * // Select all unique rows from the 'cars' table\n\t\t * await db.selectDistinct()\n\t\t * .from(cars)\n\t\t * .orderBy(cars.id, cars.brand, cars.color);\n\t\t *\n\t\t * // Select all unique brands from the 'cars' table\n\t\t * await db.selectDistinct({ brand: cars.brand })\n\t\t * .from(cars)\n\t\t * .orderBy(cars.brand);\n\t\t * ```\n\t\t */\n\t\tfunction selectDistinct(): GelSelectBuilder<undefined>;\n\t\tfunction selectDistinct<TSelection extends SelectedFields>(fields: TSelection): GelSelectBuilder<TSelection>;\n\t\tfunction selectDistinct(fields?: SelectedFields): GelSelectBuilder<SelectedFields | undefined> {\n\t\t\treturn new GelSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t\tdistinct: true,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Adds `distinct on` expression to the select query.\n\t\t *\n\t\t * Calling this method will specify how the unique rows are determined.\n\t\t *\n\t\t * Use `.from()` method to specify which table to select from.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t\t *\n\t\t * @param on The expression defining uniqueness.\n\t\t * @param fields The selection object.\n\t\t *\n\t\t * @example\n\t\t * ```ts\n\t\t * // Select the first row for each unique brand from the 'cars' table\n\t\t * await db.selectDistinctOn([cars.brand])\n\t\t * .from(cars)\n\t\t * .orderBy(cars.brand);\n\t\t *\n\t\t * // Selects the first occurrence of each unique car brand along with its color from the 'cars' table\n\t\t * await db.selectDistinctOn([cars.brand], { brand: cars.brand, color: cars.color })\n\t\t * .from(cars)\n\t\t * .orderBy(cars.brand, cars.color);\n\t\t * ```\n\t\t */\n\t\tfunction selectDistinctOn(on: (GelColumn | SQLWrapper)[]): GelSelectBuilder<undefined>;\n\t\tfunction selectDistinctOn<TSelection extends SelectedFields>(\n\t\t\ton: (GelColumn | SQLWrapper)[],\n\t\t\tfields: TSelection,\n\t\t): GelSelectBuilder<TSelection>;\n\t\tfunction selectDistinctOn(\n\t\t\ton: (GelColumn | SQLWrapper)[],\n\t\t\tfields?: SelectedFields,\n\t\t): GelSelectBuilder<SelectedFields | undefined> {\n\t\t\treturn new GelSelectBuilder({\n\t\t\t\tfields: fields ?? undefined,\n\t\t\t\tsession: self.session,\n\t\t\t\tdialect: self.dialect,\n\t\t\t\twithList: queries,\n\t\t\t\tdistinct: { on },\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Creates an update query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t\t *\n\t\t * Use `.set()` method to specify which values to update.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t\t *\n\t\t * @param table The table to update.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Update all rows in the 'cars' table\n\t\t * await db.update(cars).set({ color: 'red' });\n\t\t *\n\t\t * // Update rows with filters and conditions\n\t\t * await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t\t *\n\t\t * // Update with returning clause\n\t\t * const updatedCar: Car[] = await db.update(cars)\n\t\t * .set({ color: 'red' })\n\t\t * .where(eq(cars.id, 1))\n\t\t * .returning();\n\t\t * ```\n\t\t */\n\t\tfunction update<TTable extends GelTable>(table: TTable): GelUpdateBuilder<TTable, TQueryResult> {\n\t\t\treturn new GelUpdateBuilder(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\t/**\n\t\t * Creates an insert query.\n\t\t *\n\t\t * Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/insert}\n\t\t *\n\t\t * @param table The table to insert into.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Insert one row\n\t\t * await db.insert(cars).values({ brand: 'BMW' });\n\t\t *\n\t\t * // Insert multiple rows\n\t\t * await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);\n\t\t *\n\t\t * // Insert with returning clause\n\t\t * const insertedCar: Car[] = await db.insert(cars)\n\t\t * .values({ brand: 'BMW' })\n\t\t * .returning();\n\t\t * ```\n\t\t */\n\t\tfunction insert<TTable extends GelTable>(table: TTable): GelInsertBuilder<TTable, TQueryResult> {\n\t\t\treturn new GelInsertBuilder(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\t/**\n\t\t * Creates a delete query.\n\t\t *\n\t\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t\t *\n\t\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t\t *\n\t\t * @param table The table to delete from.\n\t\t *\n\t\t * @example\n\t\t *\n\t\t * ```ts\n\t\t * // Delete all rows in the 'cars' table\n\t\t * await db.delete(cars);\n\t\t *\n\t\t * // Delete rows with filters and conditions\n\t\t * await db.delete(cars).where(eq(cars.color, 'green'));\n\t\t *\n\t\t * // Delete with returning clause\n\t\t * const deletedCar: Car[] = await db.delete(cars)\n\t\t * .where(eq(cars.id, 1))\n\t\t * .returning();\n\t\t * ```\n\t\t */\n\t\tfunction delete_<TTable extends GelTable>(table: TTable): GelDeleteBase<TTable, TQueryResult> {\n\t\t\treturn new GelDeleteBase(table, self.session, self.dialect, queries);\n\t\t}\n\n\t\treturn { select, selectDistinct, selectDistinctOn, update, insert, delete: delete_ };\n\t}\n\n\t/**\n\t * Creates a select query.\n\t *\n\t * Calling this method with no arguments will select all columns from the table. Pass a selection object to specify the columns you want to select.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Select all columns and all rows from the 'cars' table\n\t * const allCars: Car[] = await db.select().from(cars);\n\t *\n\t * // Select specific columns and all rows from the 'cars' table\n\t * const carsIdsAndBrands: { id: number; brand: string }[] = await db.select({\n\t * id: cars.id,\n\t * brand: cars.brand\n\t * })\n\t * .from(cars);\n\t * ```\n\t *\n\t * Like in SQL, you can use arbitrary expressions as selection fields, not just table columns:\n\t *\n\t * ```ts\n\t * // Select specific columns along with expression and all rows from the 'cars' table\n\t * const carsIdsAndLowerNames: { id: number; lowerBrand: string }[] = await db.select({\n\t * id: cars.id,\n\t * lowerBrand: sql<string>`lower(${cars.brand})`,\n\t * })\n\t * .from(cars);\n\t * ```\n\t */\n\tselect(): GelSelectBuilder<undefined>;\n\tselect<TSelection extends SelectedFields>(fields: TSelection): GelSelectBuilder<TSelection>;\n\tselect(fields?: SelectedFields): GelSelectBuilder<SelectedFields | undefined> {\n\t\treturn new GelSelectBuilder({\n\t\t\tfields: fields ?? undefined,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t});\n\t}\n\n\t/**\n\t * Adds `distinct` expression to the select query.\n\t *\n\t * Calling this method will return only unique values. When multiple columns are selected, it returns rows with unique combinations of values in these columns.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t *\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t * ```ts\n\t * // Select all unique rows from the 'cars' table\n\t * await db.selectDistinct()\n\t * .from(cars)\n\t * .orderBy(cars.id, cars.brand, cars.color);\n\t *\n\t * // Select all unique brands from the 'cars' table\n\t * await db.selectDistinct({ brand: cars.brand })\n\t * .from(cars)\n\t * .orderBy(cars.brand);\n\t * ```\n\t */\n\tselectDistinct(): GelSelectBuilder<undefined>;\n\tselectDistinct<TSelection extends SelectedFields>(fields: TSelection): GelSelectBuilder<TSelection>;\n\tselectDistinct(fields?: SelectedFields): GelSelectBuilder<SelectedFields | undefined> {\n\t\treturn new GelSelectBuilder({\n\t\t\tfields: fields ?? undefined,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t\tdistinct: true,\n\t\t});\n\t}\n\n\t/**\n\t * Adds `distinct on` expression to the select query.\n\t *\n\t * Calling this method will specify how the unique rows are determined.\n\t *\n\t * Use `.from()` method to specify which table to select from.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/select#distinct}\n\t *\n\t * @param on The expression defining uniqueness.\n\t * @param fields The selection object.\n\t *\n\t * @example\n\t * ```ts\n\t * // Select the first row for each unique brand from the 'cars' table\n\t * await db.selectDistinctOn([cars.brand])\n\t * .from(cars)\n\t * .orderBy(cars.brand);\n\t *\n\t * // Selects the first occurrence of each unique car brand along with its color from the 'cars' table\n\t * await db.selectDistinctOn([cars.brand], { brand: cars.brand, color: cars.color })\n\t * .from(cars)\n\t * .orderBy(cars.brand, cars.color);\n\t * ```\n\t */\n\tselectDistinctOn(on: (GelColumn | SQLWrapper)[]): GelSelectBuilder<undefined>;\n\tselectDistinctOn<TSelection extends SelectedFields>(\n\t\ton: (GelColumn | SQLWrapper)[],\n\t\tfields: TSelection,\n\t): GelSelectBuilder<TSelection>;\n\tselectDistinctOn(\n\t\ton: (GelColumn | SQLWrapper)[],\n\t\tfields?: SelectedFields,\n\t): GelSelectBuilder<SelectedFields | undefined> {\n\t\treturn new GelSelectBuilder({\n\t\t\tfields: fields ?? undefined,\n\t\t\tsession: this.session,\n\t\t\tdialect: this.dialect,\n\t\t\tdistinct: { on },\n\t\t});\n\t}\n\n\t$cache: { invalidate: Cache['onMutate'] };\n\n\t/**\n\t * Creates an update query.\n\t *\n\t * Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.\n\t *\n\t * Use `.set()` method to specify which values to update.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/update}\n\t *\n\t * @param table The table to update.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Update all rows in the 'cars' table\n\t * await db.update(cars).set({ color: 'red' });\n\t *\n\t * // Update rows with filters and conditions\n\t * await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));\n\t *\n\t * // Update with returning clause\n\t * const updatedCar: Car[] = await db.update(cars)\n\t * .set({ color: 'red' })\n\t * .where(eq(cars.id, 1))\n\t * .returning();\n\t * ```\n\t */\n\tupdate<TTable extends GelTable>(table: TTable): GelUpdateBuilder<TTable, TQueryResult> {\n\t\treturn new GelUpdateBuilder(table, this.session, this.dialect);\n\t}\n\n\t/**\n\t * Creates an insert query.\n\t *\n\t * Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/insert}\n\t *\n\t * @param table The table to insert into.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Insert one row\n\t * await db.insert(cars).values({ brand: 'BMW' });\n\t *\n\t * // Insert multiple rows\n\t * await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);\n\t *\n\t * // Insert with returning clause\n\t * const insertedCar: Car[] = await db.insert(cars)\n\t * .values({ brand: 'BMW' })\n\t * .returning();\n\t * ```\n\t */\n\tinsert<TTable extends GelTable>(table: TTable): GelInsertBuilder<TTable, TQueryResult> {\n\t\treturn new GelInsertBuilder(table, this.session, this.dialect);\n\t}\n\n\t/**\n\t * Creates a delete query.\n\t *\n\t * Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.\n\t *\n\t * See docs: {@link https://orm.drizzle.team/docs/delete}\n\t *\n\t * @param table The table to delete from.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Delete all rows in the 'cars' table\n\t * await db.delete(cars);\n\t *\n\t * // Delete rows with filters and conditions\n\t * await db.delete(cars).where(eq(cars.color, 'green'));\n\t *\n\t * // Delete with returning clause\n\t * const deletedCar: Car[] = await db.delete(cars)\n\t * .where(eq(cars.id, 1))\n\t * .returning();\n\t * ```\n\t */\n\tdelete<TTable extends GelTable>(table: TTable): GelDeleteBase<TTable, TQueryResult> {\n\t\treturn new GelDeleteBase(table, this.session, this.dialect);\n\t}\n\n\t// TODO views are not implemented\n\t// refreshMaterializedView<TView extends GelMaterializedView>(view: TView): GelRefreshMaterializedView<TQueryResult> {\n\t// \treturn new GelRefreshMaterializedView(view, this.session, this.dialect);\n\t// }\n\n\texecute<TRow extends Record<string, unknown> = Record<string, unknown>>(\n\t\tquery: SQLWrapper | string,\n\t): GelRaw<TRow[]> {\n\t\tconst sequel = typeof query === 'string' ? sql.raw(query) : query.getSQL();\n\t\tconst builtQuery = this.dialect.sqlToQuery(sequel);\n\t\tconst prepared = this.session.prepareQuery<\n\t\t\tPreparedQueryConfig & { execute: TRow[] }\n\t\t>(\n\t\t\tbuiltQuery,\n\t\t\tundefined,\n\t\t\tundefined,\n\t\t\tfalse,\n\t\t);\n\t\treturn new GelRaw(\n\t\t\t() => prepared.execute(undefined),\n\t\t\tsequel,\n\t\t\tbuiltQuery,\n\t\t\t(result) => prepared.mapResult(result, true),\n\t\t);\n\t}\n\n\ttransaction<T>(\n\t\ttransaction: (tx: GelTransaction<TQueryResult, TFullSchema, TRelations, TSchema>) => Promise<T>,\n\t): Promise<T> {\n\t\treturn this.session.transaction(transaction);\n\t}\n}\n\nexport type GelWithReplicas<Q> = Q & { $primary: Q };\n\nexport const withReplicas = <\n\tHKT extends GelQueryResultHKT,\n\tTFullSchema extends Record<string, unknown>,\n\tTRelations extends AnyRelations,\n\tTSchema extends V1.TablesRelationalConfig,\n\tQ extends GelDatabase<\n\t\tHKT,\n\t\tTFullSchema,\n\t\tTRelations,\n\t\tTSchema extends Record<string, unknown> ? V1.ExtractTablesWithRelations<TFullSchema> : TSchema\n\t>,\n>(\n\tprimary: Q,\n\treplicas: [Q, ...Q[]],\n\tgetReplica: (replicas: Q[]) => Q = () => replicas[Math.floor(Math.random() * replicas.length)]!,\n): GelWithReplicas<Q> => {\n\tconst select: Q['select'] = (...args: []) => getReplica(replicas).select(...args);\n\tconst selectDistinct: Q['selectDistinct'] = (...args: []) => getReplica(replicas).selectDistinct(...args);\n\tconst selectDistinctOn: Q['selectDistinctOn'] = (...args: [any]) => getReplica(replicas).selectDistinctOn(...args);\n\tconst _with: Q['with'] = (...args: any) => getReplica(replicas).with(...args);\n\tconst $with: Q['$with'] = (arg: any) => getReplica(replicas).$with(arg);\n\n\tconst update: Q['update'] = (...args: [any]) => primary.update(...args);\n\tconst insert: Q['insert'] = (...args: [any]) => primary.insert(...args);\n\tconst $delete: Q['delete'] = (...args: [any]) => primary.delete(...args);\n\tconst execute: Q['execute'] = (...args: [any]) => primary.execute(...args);\n\tconst transaction: Q['transaction'] = (...args: [any]) => primary.transaction(...args);\n\t// const refreshMaterializedView: Q['refreshMaterializedView'] = (...args: [any]) =>\n\t// \tprimary.refreshMaterializedView(...args);\n\n\treturn {\n\t\t...primary,\n\t\tupdate,\n\t\tinsert,\n\t\tdelete: $delete,\n\t\texecute,\n\t\ttransaction,\n\t\t// refreshMaterializedView,\n\t\t$primary: primary,\n\t\tselect,\n\t\tselectDistinct,\n\t\tselectDistinctOn,\n\t\t$with,\n\t\twith: _with,\n\t\tget _query() {\n\t\t\treturn getReplica(replicas)._query;\n\t\t},\n\t\tget query() {\n\t\t\treturn getReplica(replicas).query;\n\t\t},\n\t};\n};\n"],"mappings":"AAEA,SAAS,kBAAkB;AAE3B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,6BAA6B;AACtC,SAA0C,WAA4B;AACtE,SAAS,oBAAoB;AAG7B,SAAS,+BAA+B;AACxC,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AACvC,SAAS,cAAc;AAKhB,MAAM,YAKX;AAAA,EA0BD,YAEU,SAEA,SACT,WACA,QACC;AALQ;AAEA;AAIT,SAAK,IAAI,SACN;AAAA,MACD,QAAQ,OAAO;AAAA,MACf,YAAY,OAAO;AAAA,MACnB,eAAe,OAAO;AAAA,MACtB;AAAA,MACA;AAAA,IACD,IACE;AAAA,MACD,QAAQ;AAAA,MACR,YAAY,CAAC;AAAA,MACb,eAAe,CAAC;AAAA,MAChB;AAAA,MACA;AAAA,IACD;AACD,SAAK,SAAS,CAAC;AACf,QAAI,KAAK,EAAE,QAAQ;AAClB,iBAAW,CAAC,WAAW,OAAO,KAAK,OAAO,QAAQ,KAAK,EAAE,MAAM,GAAG;AACjE,QAAC,KAAK,OAAoE,SAAS,IAClF,IAAI;AAAA,UACH,OAAQ;AAAA,UACR,KAAK,EAAE;AAAA,UACP,KAAK,EAAE;AAAA,UACP,OAAQ,WAAW,SAAS;AAAA,UAC5B;AAAA,UACA;AAAA,UACA;AAAA,QACD;AAAA,MACF;AAAA,IACD;AACA,SAAK,QAAQ,CAAC;AACd,eAAW,CAAC,WAAW,QAAQ,KAAK,OAAO,QAAQ,SAAS,GAAG;AAC9D,MAAC,KAAK,MAKM,SAAS,IAAI,IAAI;AAAA,QAC5B;AAAA,QACA,U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|| tableColumns[colName]?.onUpdateFn !== void 0
128
128
  );
129
- const setSize = columnNames.length;
129
+ const setLength = columnNames.length;
130
130
  return import_sql2.sql.join(columnNames.flatMap((colName, i) => {
131
131
  const col = tableColumns[colName];
132
132
  const value = set[colName] ?? import_sql2.sql.param(col.onUpdateFn(), col);
133
133
  const res = import_sql2.sql`${import_sql2.sql.identifier(this.casing.getColumnCasing(col))} = ${value}`;
134
- if (i < setSize - 1) {
134
+ if (i < setLength - 1) {
135
135
  return [res, import_sql2.sql.raw(", ")];
136
136
  }
137
137
  return [res];
@@ -674,7 +674,11 @@ class GelDialect {
674
674
  return import_sql2.sql`${name}::text${import_sql2.sql.raw(arrVal).if(arrVal)} as ${import_sql2.sql.identifier(key)}`;
675
675
  }
676
676
  case "GelCustomColumn": {
677
- return import_sql2.sql`${col.jsonSelectIdentifier(name, import_sql2.sql, dimensionCnt > 0 ? dimensionCnt : void 0)} as ${import_sql2.sql.identifier(key)}`;
677
+ return import_sql2.sql`${col.jsonSelectIdentifier(
678
+ name,
679
+ import_sql2.sql,
680
+ dimensionCnt > 0 ? dimensionCnt : void 0
681
+ )} as ${import_sql2.sql.identifier(key)}`;
678
682
  }
679
683
  default: {
680
684
  return import_sql2.sql`${name} as ${import_sql2.sql.identifier(key)}`;
@@ -685,7 +689,7 @@ class GelDialect {
685
689
  }
686
690
  unwrapAllColumns = (table, selection) => {
687
691
  return import_sql2.sql.join(
688
- Object.entries(table[import_table2.Columns]).map(([k, v]) => {
692
+ Object.entries(table[import_table2.TableColumns]).map(([k, v]) => {
689
693
  selection.push({
690
694
  key: k,
691
695
  field: v
@@ -697,7 +701,7 @@ class GelDialect {
697
701
  };
698
702
  buildColumns = (table, selection, config) => config?.columns ? (() => {
699
703
  const entries = Object.entries(config.columns);
700
- const columnContainer = table[import_table2.Columns];
704
+ const columnContainer = table[import_table2.TableColumns];
701
705
  const columnIdentifiers = [];
702
706
  let colSelectionMode;
703
707
  for (const [k, v] of entries) {
@@ -727,9 +731,7 @@ class GelDialect {
727
731
  return columnIdentifiers.length ? import_sql2.sql.join(columnIdentifiers, import_sql2.sql`, `) : void 0;
728
732
  })() : this.unwrapAllColumns(table, selection);
729
733
  buildRelationalQuery({
730
- tables,
731
734
  schema,
732
- tableNamesMap,
733
735
  table,
734
736
  tableConfig,
735
737
  queryConfig: config,
@@ -748,9 +750,9 @@ class GelDialect {
748
750
  const limit = isSingle ? 1 : params?.limit;
749
751
  const offset = params?.offset;
750
752
  const where = params?.where && relationWhere ? (0, import_sql.and)(
751
- (0, import_relations.relationsFilterToSQL)(table, params.where, tableConfig.relations, schema, tableNamesMap, this.casing),
753
+ (0, import_relations.relationsFilterToSQL)(table, params.where, tableConfig.relations, schema, this.casing),
752
754
  relationWhere
753
- ) : params?.where ? (0, import_relations.relationsFilterToSQL)(table, params.where, tableConfig.relations, schema, tableNamesMap, this.casing) : relationWhere;
755
+ ) : params?.where ? (0, import_relations.relationsFilterToSQL)(table, params.where, tableConfig.relations, schema, this.casing) : relationWhere;
754
756
  const order = params?.orderBy ? (0, import_relations.relationsOrderToSQL)(table, params.orderBy) : void 0;
755
757
  const columns = this.buildColumns(table, selection, params);
756
758
  const extras = params?.extras ? (0, import_relations.relationExtrasToSQL)(table, params.extras) : void 0;
@@ -781,9 +783,7 @@ class GelDialect {
781
783
  mode: isSingle2 ? "first" : "many",
782
784
  schema,
783
785
  queryConfig: join,
784
- tableConfig: schema[tableNamesMap[(0, import_table2.getTableUniqueName)(relation.targetTable)]],
785
- tableNamesMap,
786
- tables,
786
+ tableConfig: schema[relation.targetTableName],
787
787
  relationWhere: filter,
788
788
  errorPath: `${currentPath.length ? `${currentPath}.` : ""}${k}`,
789
789
  depth: currentDepth + 1,
@@ -805,7 +805,7 @@ class GelDialect {
805
805
  if (extras?.sql) selectionArr.push(extras.sql);
806
806
  if (!selectionArr.length) {
807
807
  throw new import_errors.DrizzleError({
808
- message: `No fields selected for table "${tableConfig.tsName}"${currentPath ? ` ("${currentPath}")` : ""}`
808
+ message: `No fields selected for table "${tableConfig.name}"${currentPath ? ` ("${currentPath}")` : ""}`
809
809
  });
810
810
  }
811
811
  const selectionSet = import_sql2.sql.join(selectionArr.filter((e) => e !== void 0), import_sql2.sql`, `);