blendsdk 5.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (538) hide show
  1. package/README.md +125 -0
  2. package/dist/cmdline/cmdline.d.ts +144 -0
  3. package/dist/cmdline/cmdline.d.ts.map +1 -0
  4. package/dist/cmdline/cmdline.js +683 -0
  5. package/dist/cmdline/cmdline.js.map +1 -0
  6. package/dist/cmdline/errors.d.ts +105 -0
  7. package/dist/cmdline/errors.d.ts.map +1 -0
  8. package/dist/cmdline/errors.js +153 -0
  9. package/dist/cmdline/errors.js.map +1 -0
  10. package/dist/cmdline/index.d.ts +5 -0
  11. package/dist/cmdline/index.d.ts.map +1 -0
  12. package/dist/cmdline/index.js +5 -0
  13. package/dist/cmdline/index.js.map +1 -0
  14. package/dist/cmdline/types.d.ts +260 -0
  15. package/dist/cmdline/types.d.ts.map +1 -0
  16. package/dist/cmdline/types.js +9 -0
  17. package/dist/cmdline/types.js.map +1 -0
  18. package/dist/cmdline/validators.d.ts +28 -0
  19. package/dist/cmdline/validators.d.ts.map +1 -0
  20. package/dist/cmdline/validators.js +211 -0
  21. package/dist/cmdline/validators.js.map +1 -0
  22. package/dist/codegen/database/index.d.ts +3 -0
  23. package/dist/codegen/database/index.d.ts.map +1 -0
  24. package/dist/codegen/database/index.js +3 -0
  25. package/dist/codegen/database/index.js.map +1 -0
  26. package/dist/codegen/database/introspect/index.d.ts +3 -0
  27. package/dist/codegen/database/introspect/index.d.ts.map +1 -0
  28. package/dist/codegen/database/introspect/index.js +3 -0
  29. package/dist/codegen/database/introspect/index.js.map +1 -0
  30. package/dist/codegen/database/introspect/introspect-query.d.ts +2 -0
  31. package/dist/codegen/database/introspect/introspect-query.d.ts.map +1 -0
  32. package/dist/codegen/database/introspect/introspect-query.js +416 -0
  33. package/dist/codegen/database/introspect/introspect-query.js.map +1 -0
  34. package/dist/codegen/database/introspect/introspect-types.d.ts +45 -0
  35. package/dist/codegen/database/introspect/introspect-types.d.ts.map +1 -0
  36. package/dist/codegen/database/introspect/introspect-types.js +2 -0
  37. package/dist/codegen/database/introspect/introspect-types.js.map +1 -0
  38. package/dist/codegen/database/introspect/introspect.d.ts +21 -0
  39. package/dist/codegen/database/introspect/introspect.d.ts.map +1 -0
  40. package/dist/codegen/database/introspect/introspect.js +223 -0
  41. package/dist/codegen/database/introspect/introspect.js.map +1 -0
  42. package/dist/codegen/database/schema/check-constraint.d.ts +8 -0
  43. package/dist/codegen/database/schema/check-constraint.d.ts.map +1 -0
  44. package/dist/codegen/database/schema/check-constraint.js +12 -0
  45. package/dist/codegen/database/schema/check-constraint.js.map +1 -0
  46. package/dist/codegen/database/schema/column-schema.d.ts +7 -0
  47. package/dist/codegen/database/schema/column-schema.d.ts.map +1 -0
  48. package/dist/codegen/database/schema/column-schema.js +9 -0
  49. package/dist/codegen/database/schema/column-schema.js.map +1 -0
  50. package/dist/codegen/database/schema/constraint-base.d.ts +13 -0
  51. package/dist/codegen/database/schema/constraint-base.d.ts.map +1 -0
  52. package/dist/codegen/database/schema/constraint-base.js +32 -0
  53. package/dist/codegen/database/schema/constraint-base.js.map +1 -0
  54. package/dist/codegen/database/schema/database-schema.d.ts +19 -0
  55. package/dist/codegen/database/schema/database-schema.d.ts.map +1 -0
  56. package/dist/codegen/database/schema/database-schema.js +48 -0
  57. package/dist/codegen/database/schema/database-schema.js.map +1 -0
  58. package/dist/codegen/database/schema/dataobject-schema.d.ts +9 -0
  59. package/dist/codegen/database/schema/dataobject-schema.d.ts.map +1 -0
  60. package/dist/codegen/database/schema/dataobject-schema.js +18 -0
  61. package/dist/codegen/database/schema/dataobject-schema.js.map +1 -0
  62. package/dist/codegen/database/schema/fkey-constraints.d.ts +21 -0
  63. package/dist/codegen/database/schema/fkey-constraints.d.ts.map +1 -0
  64. package/dist/codegen/database/schema/fkey-constraints.js +58 -0
  65. package/dist/codegen/database/schema/fkey-constraints.js.map +1 -0
  66. package/dist/codegen/database/schema/index-constraint.d.ts +34 -0
  67. package/dist/codegen/database/schema/index-constraint.d.ts.map +1 -0
  68. package/dist/codegen/database/schema/index-constraint.js +79 -0
  69. package/dist/codegen/database/schema/index-constraint.js.map +1 -0
  70. package/dist/codegen/database/schema/index.d.ts +5 -0
  71. package/dist/codegen/database/schema/index.d.ts.map +1 -0
  72. package/dist/codegen/database/schema/index.js +5 -0
  73. package/dist/codegen/database/schema/index.js.map +1 -0
  74. package/dist/codegen/database/schema/primarykey-constraint.d.ts +4 -0
  75. package/dist/codegen/database/schema/primarykey-constraint.d.ts.map +1 -0
  76. package/dist/codegen/database/schema/primarykey-constraint.js +4 -0
  77. package/dist/codegen/database/schema/primarykey-constraint.js.map +1 -0
  78. package/dist/codegen/database/schema/relation-schema.d.ts +16 -0
  79. package/dist/codegen/database/schema/relation-schema.d.ts.map +1 -0
  80. package/dist/codegen/database/schema/relation-schema.js +32 -0
  81. package/dist/codegen/database/schema/relation-schema.js.map +1 -0
  82. package/dist/codegen/database/schema/table-column-schema.d.ts +59 -0
  83. package/dist/codegen/database/schema/table-column-schema.d.ts.map +1 -0
  84. package/dist/codegen/database/schema/table-column-schema.js +137 -0
  85. package/dist/codegen/database/schema/table-column-schema.js.map +1 -0
  86. package/dist/codegen/database/schema/table-schema.d.ts +48 -0
  87. package/dist/codegen/database/schema/table-schema.d.ts.map +1 -0
  88. package/dist/codegen/database/schema/table-schema.js +219 -0
  89. package/dist/codegen/database/schema/table-schema.js.map +1 -0
  90. package/dist/codegen/database/schema/types.d.ts +13 -0
  91. package/dist/codegen/database/schema/types.d.ts.map +1 -0
  92. package/dist/codegen/database/schema/types.js +175 -0
  93. package/dist/codegen/database/schema/types.js.map +1 -0
  94. package/dist/codegen/database/schema/unique-constraint.d.ts +4 -0
  95. package/dist/codegen/database/schema/unique-constraint.d.ts.map +1 -0
  96. package/dist/codegen/database/schema/unique-constraint.js +4 -0
  97. package/dist/codegen/database/schema/unique-constraint.js.map +1 -0
  98. package/dist/codegen/database/schema/view-schema.d.ts +14 -0
  99. package/dist/codegen/database/schema/view-schema.d.ts.map +1 -0
  100. package/dist/codegen/database/schema/view-schema.js +32 -0
  101. package/dist/codegen/database/schema/view-schema.js.map +1 -0
  102. package/dist/codegen/generator/ctype-generator.d.ts +5 -0
  103. package/dist/codegen/generator/ctype-generator.d.ts.map +1 -0
  104. package/dist/codegen/generator/ctype-generator.js +26 -0
  105. package/dist/codegen/generator/ctype-generator.js.map +1 -0
  106. package/dist/codegen/generator/generator.d.ts +17 -0
  107. package/dist/codegen/generator/generator.d.ts.map +1 -0
  108. package/dist/codegen/generator/generator.js +57 -0
  109. package/dist/codegen/generator/generator.js.map +1 -0
  110. package/dist/codegen/generator/index.d.ts +8 -0
  111. package/dist/codegen/generator/index.d.ts.map +1 -0
  112. package/dist/codegen/generator/index.js +8 -0
  113. package/dist/codegen/generator/index.js.map +1 -0
  114. package/dist/codegen/generator/openapi-generator.d.ts +239 -0
  115. package/dist/codegen/generator/openapi-generator.d.ts.map +1 -0
  116. package/dist/codegen/generator/openapi-generator.js +434 -0
  117. package/dist/codegen/generator/openapi-generator.js.map +1 -0
  118. package/dist/codegen/generator/openapi-types.d.ts +263 -0
  119. package/dist/codegen/generator/openapi-types.d.ts.map +1 -0
  120. package/dist/codegen/generator/openapi-types.js +11 -0
  121. package/dist/codegen/generator/openapi-types.js.map +1 -0
  122. package/dist/codegen/generator/postgres-schema-generator.d.ts +48 -0
  123. package/dist/codegen/generator/postgres-schema-generator.d.ts.map +1 -0
  124. package/dist/codegen/generator/postgres-schema-generator.js +339 -0
  125. package/dist/codegen/generator/postgres-schema-generator.js.map +1 -0
  126. package/dist/codegen/generator/type-generator.d.ts +113 -0
  127. package/dist/codegen/generator/type-generator.d.ts.map +1 -0
  128. package/dist/codegen/generator/type-generator.js +249 -0
  129. package/dist/codegen/generator/type-generator.js.map +1 -0
  130. package/dist/codegen/generator/zod-generator.d.ts +15 -0
  131. package/dist/codegen/generator/zod-generator.d.ts.map +1 -0
  132. package/dist/codegen/generator/zod-generator.js +86 -0
  133. package/dist/codegen/generator/zod-generator.js.map +1 -0
  134. package/dist/codegen/generator/zod-to-openapi.d.ts +69 -0
  135. package/dist/codegen/generator/zod-to-openapi.d.ts.map +1 -0
  136. package/dist/codegen/generator/zod-to-openapi.js +480 -0
  137. package/dist/codegen/generator/zod-to-openapi.js.map +1 -0
  138. package/dist/codegen/index.d.ts +4 -0
  139. package/dist/codegen/index.d.ts.map +1 -0
  140. package/dist/codegen/index.js +4 -0
  141. package/dist/codegen/index.js.map +1 -0
  142. package/dist/codegen/schema/any-schema.d.ts +6 -0
  143. package/dist/codegen/schema/any-schema.d.ts.map +1 -0
  144. package/dist/codegen/schema/any-schema.js +12 -0
  145. package/dist/codegen/schema/any-schema.js.map +1 -0
  146. package/dist/codegen/schema/boolean-schema.d.ts +6 -0
  147. package/dist/codegen/schema/boolean-schema.d.ts.map +1 -0
  148. package/dist/codegen/schema/boolean-schema.js +12 -0
  149. package/dist/codegen/schema/boolean-schema.js.map +1 -0
  150. package/dist/codegen/schema/date-schema.d.ts +6 -0
  151. package/dist/codegen/schema/date-schema.d.ts.map +1 -0
  152. package/dist/codegen/schema/date-schema.js +12 -0
  153. package/dist/codegen/schema/date-schema.js.map +1 -0
  154. package/dist/codegen/schema/index.d.ts +10 -0
  155. package/dist/codegen/schema/index.d.ts.map +1 -0
  156. package/dist/codegen/schema/index.js +10 -0
  157. package/dist/codegen/schema/index.js.map +1 -0
  158. package/dist/codegen/schema/object-schema.d.ts +10 -0
  159. package/dist/codegen/schema/object-schema.d.ts.map +1 -0
  160. package/dist/codegen/schema/object-schema.js +21 -0
  161. package/dist/codegen/schema/object-schema.js.map +1 -0
  162. package/dist/codegen/schema/primitive-schema.d.ts +20 -0
  163. package/dist/codegen/schema/primitive-schema.d.ts.map +1 -0
  164. package/dist/codegen/schema/primitive-schema.js +48 -0
  165. package/dist/codegen/schema/primitive-schema.js.map +1 -0
  166. package/dist/codegen/schema/ref-schema.d.ts +6 -0
  167. package/dist/codegen/schema/ref-schema.d.ts.map +1 -0
  168. package/dist/codegen/schema/ref-schema.js +11 -0
  169. package/dist/codegen/schema/ref-schema.js.map +1 -0
  170. package/dist/codegen/schema/schema-container.d.ts +14 -0
  171. package/dist/codegen/schema/schema-container.d.ts.map +1 -0
  172. package/dist/codegen/schema/schema-container.js +38 -0
  173. package/dist/codegen/schema/schema-container.js.map +1 -0
  174. package/dist/codegen/schema/schema-object.d.ts +42 -0
  175. package/dist/codegen/schema/schema-object.d.ts.map +1 -0
  176. package/dist/codegen/schema/schema-object.js +90 -0
  177. package/dist/codegen/schema/schema-object.js.map +1 -0
  178. package/dist/codegen/schema/schema-scope.d.ts +23 -0
  179. package/dist/codegen/schema/schema-scope.d.ts.map +1 -0
  180. package/dist/codegen/schema/schema-scope.js +67 -0
  181. package/dist/codegen/schema/schema-scope.js.map +1 -0
  182. package/dist/codegen/schema/utils.d.ts +17 -0
  183. package/dist/codegen/schema/utils.d.ts.map +1 -0
  184. package/dist/codegen/schema/utils.js +47 -0
  185. package/dist/codegen/schema/utils.js.map +1 -0
  186. package/dist/dbcore/crud-statement.d.ts +67 -0
  187. package/dist/dbcore/crud-statement.d.ts.map +1 -0
  188. package/dist/dbcore/crud-statement.js +75 -0
  189. package/dist/dbcore/crud-statement.js.map +1 -0
  190. package/dist/dbcore/database.d.ts +272 -0
  191. package/dist/dbcore/database.d.ts.map +1 -0
  192. package/dist/dbcore/database.js +53 -0
  193. package/dist/dbcore/database.js.map +1 -0
  194. package/dist/dbcore/dataservice-base.d.ts +18 -0
  195. package/dist/dbcore/dataservice-base.d.ts.map +1 -0
  196. package/dist/dbcore/dataservice-base.js +19 -0
  197. package/dist/dbcore/dataservice-base.js.map +1 -0
  198. package/dist/dbcore/delete-statement.d.ts +29 -0
  199. package/dist/dbcore/delete-statement.d.ts.map +1 -0
  200. package/dist/dbcore/delete-statement.js +30 -0
  201. package/dist/dbcore/delete-statement.js.map +1 -0
  202. package/dist/dbcore/filterable-statement.d.ts +126 -0
  203. package/dist/dbcore/filterable-statement.d.ts.map +1 -0
  204. package/dist/dbcore/filterable-statement.js +178 -0
  205. package/dist/dbcore/filterable-statement.js.map +1 -0
  206. package/dist/dbcore/from-statement.d.ts +120 -0
  207. package/dist/dbcore/from-statement.d.ts.map +1 -0
  208. package/dist/dbcore/from-statement.js +150 -0
  209. package/dist/dbcore/from-statement.js.map +1 -0
  210. package/dist/dbcore/index.d.ts +21 -0
  211. package/dist/dbcore/index.d.ts.map +1 -0
  212. package/dist/dbcore/index.js +21 -0
  213. package/dist/dbcore/index.js.map +1 -0
  214. package/dist/dbcore/insert-statement.d.ts +48 -0
  215. package/dist/dbcore/insert-statement.d.ts.map +1 -0
  216. package/dist/dbcore/insert-statement.js +52 -0
  217. package/dist/dbcore/insert-statement.js.map +1 -0
  218. package/dist/dbcore/query-dataservice.d.ts +144 -0
  219. package/dist/dbcore/query-dataservice.d.ts.map +1 -0
  220. package/dist/dbcore/query-dataservice.js +144 -0
  221. package/dist/dbcore/query-dataservice.js.map +1 -0
  222. package/dist/dbcore/statement.d.ts +133 -0
  223. package/dist/dbcore/statement.d.ts.map +1 -0
  224. package/dist/dbcore/statement.js +138 -0
  225. package/dist/dbcore/statement.js.map +1 -0
  226. package/dist/dbcore/update-statement.d.ts +48 -0
  227. package/dist/dbcore/update-statement.d.ts.map +1 -0
  228. package/dist/dbcore/update-statement.js +52 -0
  229. package/dist/dbcore/update-statement.js.map +1 -0
  230. package/dist/expression/builders/comparison-builder.d.ts +47 -0
  231. package/dist/expression/builders/comparison-builder.d.ts.map +1 -0
  232. package/dist/expression/builders/comparison-builder.js +197 -0
  233. package/dist/expression/builders/comparison-builder.js.map +1 -0
  234. package/dist/expression/builders/query-builder.d.ts +80 -0
  235. package/dist/expression/builders/query-builder.d.ts.map +1 -0
  236. package/dist/expression/builders/query-builder.js +229 -0
  237. package/dist/expression/builders/query-builder.js.map +1 -0
  238. package/dist/expression/compiler/postgresql-compiler.d.ts +56 -0
  239. package/dist/expression/compiler/postgresql-compiler.d.ts.map +1 -0
  240. package/dist/expression/compiler/postgresql-compiler.js +217 -0
  241. package/dist/expression/compiler/postgresql-compiler.js.map +1 -0
  242. package/dist/expression/core/ast-node.d.ts +47 -0
  243. package/dist/expression/core/ast-node.d.ts.map +1 -0
  244. package/dist/expression/core/ast-node.js +154 -0
  245. package/dist/expression/core/ast-node.js.map +1 -0
  246. package/dist/expression/core/parameter-manager.d.ts +84 -0
  247. package/dist/expression/core/parameter-manager.d.ts.map +1 -0
  248. package/dist/expression/core/parameter-manager.js +164 -0
  249. package/dist/expression/core/parameter-manager.js.map +1 -0
  250. package/dist/expression/core/query-builder-interfaces.d.ts +188 -0
  251. package/dist/expression/core/query-builder-interfaces.d.ts.map +1 -0
  252. package/dist/expression/core/query-builder-interfaces.js +6 -0
  253. package/dist/expression/core/query-builder-interfaces.js.map +1 -0
  254. package/dist/expression/core/types.d.ts +239 -0
  255. package/dist/expression/core/types.d.ts.map +1 -0
  256. package/dist/expression/core/types.js +121 -0
  257. package/dist/expression/core/types.js.map +1 -0
  258. package/dist/expression/index.d.ts +11 -0
  259. package/dist/expression/index.d.ts.map +1 -0
  260. package/dist/expression/index.js +11 -0
  261. package/dist/expression/index.js.map +1 -0
  262. package/dist/i18n/content-file-source.d.ts +109 -0
  263. package/dist/i18n/content-file-source.d.ts.map +1 -0
  264. package/dist/i18n/content-file-source.js +218 -0
  265. package/dist/i18n/content-file-source.js.map +1 -0
  266. package/dist/i18n/index.d.ts +19 -0
  267. package/dist/i18n/index.d.ts.map +1 -0
  268. package/dist/i18n/index.js +21 -0
  269. package/dist/i18n/index.js.map +1 -0
  270. package/dist/i18n/json-file-source.d.ts +96 -0
  271. package/dist/i18n/json-file-source.d.ts.map +1 -0
  272. package/dist/i18n/json-file-source.js +258 -0
  273. package/dist/i18n/json-file-source.js.map +1 -0
  274. package/dist/i18n/merge-catalogs.d.ts +20 -0
  275. package/dist/i18n/merge-catalogs.d.ts.map +1 -0
  276. package/dist/i18n/merge-catalogs.js +34 -0
  277. package/dist/i18n/merge-catalogs.js.map +1 -0
  278. package/dist/i18n/node.d.ts +20 -0
  279. package/dist/i18n/node.d.ts.map +1 -0
  280. package/dist/i18n/node.js +19 -0
  281. package/dist/i18n/node.js.map +1 -0
  282. package/dist/i18n/translation-source.d.ts +35 -0
  283. package/dist/i18n/translation-source.d.ts.map +1 -0
  284. package/dist/i18n/translation-source.js +2 -0
  285. package/dist/i18n/translation-source.js.map +1 -0
  286. package/dist/i18n/translator.d.ts +162 -0
  287. package/dist/i18n/translator.d.ts.map +1 -0
  288. package/dist/i18n/translator.js +259 -0
  289. package/dist/i18n/translator.js.map +1 -0
  290. package/dist/i18n/types.d.ts +80 -0
  291. package/dist/i18n/types.d.ts.map +1 -0
  292. package/dist/i18n/types.js +2 -0
  293. package/dist/i18n/types.js.map +1 -0
  294. package/dist/postgresql/database.d.ts +204 -0
  295. package/dist/postgresql/database.d.ts.map +1 -0
  296. package/dist/postgresql/database.js +321 -0
  297. package/dist/postgresql/database.js.map +1 -0
  298. package/dist/postgresql/delete-statement.d.ts +36 -0
  299. package/dist/postgresql/delete-statement.d.ts.map +1 -0
  300. package/dist/postgresql/delete-statement.js +54 -0
  301. package/dist/postgresql/delete-statement.js.map +1 -0
  302. package/dist/postgresql/index.d.ts +12 -0
  303. package/dist/postgresql/index.d.ts.map +1 -0
  304. package/dist/postgresql/index.js +12 -0
  305. package/dist/postgresql/index.js.map +1 -0
  306. package/dist/postgresql/insert-statement.d.ts +34 -0
  307. package/dist/postgresql/insert-statement.d.ts.map +1 -0
  308. package/dist/postgresql/insert-statement.js +48 -0
  309. package/dist/postgresql/insert-statement.js.map +1 -0
  310. package/dist/postgresql/update-statement.d.ts +38 -0
  311. package/dist/postgresql/update-statement.d.ts.map +1 -0
  312. package/dist/postgresql/update-statement.js +75 -0
  313. package/dist/postgresql/update-statement.js.map +1 -0
  314. package/dist/stdlib/formatString.d.ts +52 -0
  315. package/dist/stdlib/formatString.d.ts.map +1 -0
  316. package/dist/stdlib/formatString.js +118 -0
  317. package/dist/stdlib/formatString.js.map +1 -0
  318. package/dist/stdlib/index.d.ts +8 -0
  319. package/dist/stdlib/index.d.ts.map +1 -0
  320. package/dist/stdlib/index.js +8 -0
  321. package/dist/stdlib/index.js.map +1 -0
  322. package/dist/stdlib/isBoolean.d.ts +15 -0
  323. package/dist/stdlib/isBoolean.d.ts.map +1 -0
  324. package/dist/stdlib/isBoolean.js +17 -0
  325. package/dist/stdlib/isBoolean.js.map +1 -0
  326. package/dist/stdlib/isNullOrUndef.d.ts +24 -0
  327. package/dist/stdlib/isNullOrUndef.d.ts.map +1 -0
  328. package/dist/stdlib/isNullOrUndef.js +28 -0
  329. package/dist/stdlib/isNullOrUndef.js.map +1 -0
  330. package/dist/stdlib/isNumeric.d.ts +20 -0
  331. package/dist/stdlib/isNumeric.d.ts.map +1 -0
  332. package/dist/stdlib/isNumeric.js +39 -0
  333. package/dist/stdlib/isNumeric.js.map +1 -0
  334. package/dist/stdlib/isString.d.ts +15 -0
  335. package/dist/stdlib/isString.d.ts.map +1 -0
  336. package/dist/stdlib/isString.js +17 -0
  337. package/dist/stdlib/isString.js.map +1 -0
  338. package/dist/stdlib/isTemplateString.d.ts +18 -0
  339. package/dist/stdlib/isTemplateString.d.ts.map +1 -0
  340. package/dist/stdlib/isTemplateString.js +38 -0
  341. package/dist/stdlib/isTemplateString.js.map +1 -0
  342. package/dist/stdlib/wrapInArray.d.ts +14 -0
  343. package/dist/stdlib/wrapInArray.d.ts.map +1 -0
  344. package/dist/stdlib/wrapInArray.js +17 -0
  345. package/dist/stdlib/wrapInArray.js.map +1 -0
  346. package/dist/webafx/application/application-settings.d.ts +129 -0
  347. package/dist/webafx/application/application-settings.d.ts.map +1 -0
  348. package/dist/webafx/application/application-settings.js +162 -0
  349. package/dist/webafx/application/application-settings.js.map +1 -0
  350. package/dist/webafx/application/base-controller.d.ts +128 -0
  351. package/dist/webafx/application/base-controller.d.ts.map +1 -0
  352. package/dist/webafx/application/base-controller.js +122 -0
  353. package/dist/webafx/application/base-controller.js.map +1 -0
  354. package/dist/webafx/application/console-logger.d.ts +81 -0
  355. package/dist/webafx/application/console-logger.d.ts.map +1 -0
  356. package/dist/webafx/application/console-logger.js +111 -0
  357. package/dist/webafx/application/console-logger.js.map +1 -0
  358. package/dist/webafx/application/controller-registry.d.ts +34 -0
  359. package/dist/webafx/application/controller-registry.d.ts.map +1 -0
  360. package/dist/webafx/application/controller-registry.js +32 -0
  361. package/dist/webafx/application/controller-registry.js.map +1 -0
  362. package/dist/webafx/application/error-handler-middleware.d.ts +22 -0
  363. package/dist/webafx/application/error-handler-middleware.d.ts.map +1 -0
  364. package/dist/webafx/application/error-handler-middleware.js +70 -0
  365. package/dist/webafx/application/error-handler-middleware.js.map +1 -0
  366. package/dist/webafx/application/index.d.ts +13 -0
  367. package/dist/webafx/application/index.d.ts.map +1 -0
  368. package/dist/webafx/application/index.js +13 -0
  369. package/dist/webafx/application/index.js.map +1 -0
  370. package/dist/webafx/application/logger.d.ts +2 -0
  371. package/dist/webafx/application/logger.d.ts.map +1 -0
  372. package/dist/webafx/application/logger.js +2 -0
  373. package/dist/webafx/application/logger.js.map +1 -0
  374. package/dist/webafx/application/plugin.d.ts +73 -0
  375. package/dist/webafx/application/plugin.d.ts.map +1 -0
  376. package/dist/webafx/application/plugin.js +90 -0
  377. package/dist/webafx/application/plugin.js.map +1 -0
  378. package/dist/webafx/application/rate-limiter.d.ts +35 -0
  379. package/dist/webafx/application/rate-limiter.d.ts.map +1 -0
  380. package/dist/webafx/application/rate-limiter.js +74 -0
  381. package/dist/webafx/application/rate-limiter.js.map +1 -0
  382. package/dist/webafx/application/request-context.d.ts +62 -0
  383. package/dist/webafx/application/request-context.d.ts.map +1 -0
  384. package/dist/webafx/application/request-context.js +54 -0
  385. package/dist/webafx/application/request-context.js.map +1 -0
  386. package/dist/webafx/application/request-id-middleware.d.ts +30 -0
  387. package/dist/webafx/application/request-id-middleware.d.ts.map +1 -0
  388. package/dist/webafx/application/request-id-middleware.js +57 -0
  389. package/dist/webafx/application/request-id-middleware.js.map +1 -0
  390. package/dist/webafx/application/route-builder.d.ts +231 -0
  391. package/dist/webafx/application/route-builder.d.ts.map +1 -0
  392. package/dist/webafx/application/route-builder.js +182 -0
  393. package/dist/webafx/application/route-builder.js.map +1 -0
  394. package/dist/webafx/application/service-container.d.ts +144 -0
  395. package/dist/webafx/application/service-container.d.ts.map +1 -0
  396. package/dist/webafx/application/service-container.js +192 -0
  397. package/dist/webafx/application/service-container.js.map +1 -0
  398. package/dist/webafx/application/services.d.ts +27 -0
  399. package/dist/webafx/application/services.d.ts.map +1 -0
  400. package/dist/webafx/application/services.js +33 -0
  401. package/dist/webafx/application/services.js.map +1 -0
  402. package/dist/webafx/application/structured-logger.d.ts +99 -0
  403. package/dist/webafx/application/structured-logger.d.ts.map +1 -0
  404. package/dist/webafx/application/structured-logger.js +132 -0
  405. package/dist/webafx/application/structured-logger.js.map +1 -0
  406. package/dist/webafx/application/type.d.ts +29 -0
  407. package/dist/webafx/application/type.d.ts.map +1 -0
  408. package/dist/webafx/application/type.js +2 -0
  409. package/dist/webafx/application/type.js.map +1 -0
  410. package/dist/webafx/application/web-application.d.ts +257 -0
  411. package/dist/webafx/application/web-application.d.ts.map +1 -0
  412. package/dist/webafx/application/web-application.js +611 -0
  413. package/dist/webafx/application/web-application.js.map +1 -0
  414. package/dist/webafx/errors/api-error.d.ts +21 -0
  415. package/dist/webafx/errors/api-error.d.ts.map +1 -0
  416. package/dist/webafx/errors/api-error.js +38 -0
  417. package/dist/webafx/errors/api-error.js.map +1 -0
  418. package/dist/webafx/errors/http-errors.d.ts +56 -0
  419. package/dist/webafx/errors/http-errors.d.ts.map +1 -0
  420. package/dist/webafx/errors/http-errors.js +74 -0
  421. package/dist/webafx/errors/http-errors.js.map +1 -0
  422. package/dist/webafx/errors/index.d.ts +4 -0
  423. package/dist/webafx/errors/index.d.ts.map +1 -0
  424. package/dist/webafx/errors/index.js +4 -0
  425. package/dist/webafx/errors/index.js.map +1 -0
  426. package/dist/webafx/errors/types.d.ts +42 -0
  427. package/dist/webafx/errors/types.d.ts.map +1 -0
  428. package/dist/webafx/errors/types.js +2 -0
  429. package/dist/webafx/errors/types.js.map +1 -0
  430. package/dist/webafx/index.d.ts +3 -0
  431. package/dist/webafx/index.d.ts.map +1 -0
  432. package/dist/webafx/index.js +3 -0
  433. package/dist/webafx/index.js.map +1 -0
  434. package/dist/webafx-auth/abstract-auth-provider.d.ts +178 -0
  435. package/dist/webafx-auth/abstract-auth-provider.d.ts.map +1 -0
  436. package/dist/webafx-auth/abstract-auth-provider.js +240 -0
  437. package/dist/webafx-auth/abstract-auth-provider.js.map +1 -0
  438. package/dist/webafx-auth/index.d.ts +27 -0
  439. package/dist/webafx-auth/index.d.ts.map +1 -0
  440. package/dist/webafx-auth/index.js +32 -0
  441. package/dist/webafx-auth/index.js.map +1 -0
  442. package/dist/webafx-auth/jwt-auth-provider.d.ts +100 -0
  443. package/dist/webafx-auth/jwt-auth-provider.d.ts.map +1 -0
  444. package/dist/webafx-auth/jwt-auth-provider.js +154 -0
  445. package/dist/webafx-auth/jwt-auth-provider.js.map +1 -0
  446. package/dist/webafx-auth/memory-auth-provider.d.ts +100 -0
  447. package/dist/webafx-auth/memory-auth-provider.d.ts.map +1 -0
  448. package/dist/webafx-auth/memory-auth-provider.js +122 -0
  449. package/dist/webafx-auth/memory-auth-provider.js.map +1 -0
  450. package/dist/webafx-auth/types.d.ts +333 -0
  451. package/dist/webafx-auth/types.d.ts.map +1 -0
  452. package/dist/webafx-auth/types.js +24 -0
  453. package/dist/webafx-auth/types.js.map +1 -0
  454. package/dist/webafx-cache/abstract-cache-provider.d.ts +185 -0
  455. package/dist/webafx-cache/abstract-cache-provider.d.ts.map +1 -0
  456. package/dist/webafx-cache/abstract-cache-provider.js +133 -0
  457. package/dist/webafx-cache/abstract-cache-provider.js.map +1 -0
  458. package/dist/webafx-cache/abstract-pubsub-provider.d.ts +170 -0
  459. package/dist/webafx-cache/abstract-pubsub-provider.d.ts.map +1 -0
  460. package/dist/webafx-cache/abstract-pubsub-provider.js +132 -0
  461. package/dist/webafx-cache/abstract-pubsub-provider.js.map +1 -0
  462. package/dist/webafx-cache/cache-plugin.d.ts +114 -0
  463. package/dist/webafx-cache/cache-plugin.d.ts.map +1 -0
  464. package/dist/webafx-cache/cache-plugin.js +176 -0
  465. package/dist/webafx-cache/cache-plugin.js.map +1 -0
  466. package/dist/webafx-cache/index.d.ts +33 -0
  467. package/dist/webafx-cache/index.d.ts.map +1 -0
  468. package/dist/webafx-cache/index.js +44 -0
  469. package/dist/webafx-cache/index.js.map +1 -0
  470. package/dist/webafx-cache/memory-cache-provider.d.ts +99 -0
  471. package/dist/webafx-cache/memory-cache-provider.d.ts.map +1 -0
  472. package/dist/webafx-cache/memory-cache-provider.js +251 -0
  473. package/dist/webafx-cache/memory-cache-provider.js.map +1 -0
  474. package/dist/webafx-cache/memory-pubsub-provider.d.ts +124 -0
  475. package/dist/webafx-cache/memory-pubsub-provider.d.ts.map +1 -0
  476. package/dist/webafx-cache/memory-pubsub-provider.js +195 -0
  477. package/dist/webafx-cache/memory-pubsub-provider.js.map +1 -0
  478. package/dist/webafx-cache/pubsub-plugin.d.ts +128 -0
  479. package/dist/webafx-cache/pubsub-plugin.d.ts.map +1 -0
  480. package/dist/webafx-cache/pubsub-plugin.js +182 -0
  481. package/dist/webafx-cache/pubsub-plugin.js.map +1 -0
  482. package/dist/webafx-cache/redis-cache-provider.d.ts +81 -0
  483. package/dist/webafx-cache/redis-cache-provider.d.ts.map +1 -0
  484. package/dist/webafx-cache/redis-cache-provider.js +209 -0
  485. package/dist/webafx-cache/redis-cache-provider.js.map +1 -0
  486. package/dist/webafx-cache/redis-pubsub-provider.d.ts +164 -0
  487. package/dist/webafx-cache/redis-pubsub-provider.d.ts.map +1 -0
  488. package/dist/webafx-cache/redis-pubsub-provider.js +329 -0
  489. package/dist/webafx-cache/redis-pubsub-provider.js.map +1 -0
  490. package/dist/webafx-cache/types.d.ts +206 -0
  491. package/dist/webafx-cache/types.d.ts.map +1 -0
  492. package/dist/webafx-cache/types.js +27 -0
  493. package/dist/webafx-cache/types.js.map +1 -0
  494. package/dist/webafx-i18n/i18n-plugin.d.ts +29 -0
  495. package/dist/webafx-i18n/i18n-plugin.d.ts.map +1 -0
  496. package/dist/webafx-i18n/i18n-plugin.js +145 -0
  497. package/dist/webafx-i18n/i18n-plugin.js.map +1 -0
  498. package/dist/webafx-i18n/index.d.ts +12 -0
  499. package/dist/webafx-i18n/index.d.ts.map +1 -0
  500. package/dist/webafx-i18n/index.js +12 -0
  501. package/dist/webafx-i18n/index.js.map +1 -0
  502. package/dist/webafx-i18n/locale-resolver.d.ts +33 -0
  503. package/dist/webafx-i18n/locale-resolver.d.ts.map +1 -0
  504. package/dist/webafx-i18n/locale-resolver.js +67 -0
  505. package/dist/webafx-i18n/locale-resolver.js.map +1 -0
  506. package/dist/webafx-i18n/postgresql-source.d.ts +101 -0
  507. package/dist/webafx-i18n/postgresql-source.d.ts.map +1 -0
  508. package/dist/webafx-i18n/postgresql-source.js +101 -0
  509. package/dist/webafx-i18n/postgresql-source.js.map +1 -0
  510. package/dist/webafx-i18n/types.d.ts +70 -0
  511. package/dist/webafx-i18n/types.d.ts.map +1 -0
  512. package/dist/webafx-i18n/types.js +2 -0
  513. package/dist/webafx-i18n/types.js.map +1 -0
  514. package/dist/webafx-mailer/abstract-mail-provider.d.ts +55 -0
  515. package/dist/webafx-mailer/abstract-mail-provider.d.ts.map +1 -0
  516. package/dist/webafx-mailer/abstract-mail-provider.js +37 -0
  517. package/dist/webafx-mailer/abstract-mail-provider.js.map +1 -0
  518. package/dist/webafx-mailer/index.d.ts +24 -0
  519. package/dist/webafx-mailer/index.d.ts.map +1 -0
  520. package/dist/webafx-mailer/index.js +34 -0
  521. package/dist/webafx-mailer/index.js.map +1 -0
  522. package/dist/webafx-mailer/mail-plugin.d.ts +98 -0
  523. package/dist/webafx-mailer/mail-plugin.d.ts.map +1 -0
  524. package/dist/webafx-mailer/mail-plugin.js +155 -0
  525. package/dist/webafx-mailer/mail-plugin.js.map +1 -0
  526. package/dist/webafx-mailer/memory-mail-provider.d.ts +85 -0
  527. package/dist/webafx-mailer/memory-mail-provider.d.ts.map +1 -0
  528. package/dist/webafx-mailer/memory-mail-provider.js +111 -0
  529. package/dist/webafx-mailer/memory-mail-provider.js.map +1 -0
  530. package/dist/webafx-mailer/smtp-mail-provider.d.ts +65 -0
  531. package/dist/webafx-mailer/smtp-mail-provider.d.ts.map +1 -0
  532. package/dist/webafx-mailer/smtp-mail-provider.js +113 -0
  533. package/dist/webafx-mailer/smtp-mail-provider.js.map +1 -0
  534. package/dist/webafx-mailer/types.d.ts +136 -0
  535. package/dist/webafx-mailer/types.d.ts.map +1 -0
  536. package/dist/webafx-mailer/types.js +13 -0
  537. package/dist/webafx-mailer/types.js.map +1 -0
  538. package/package.json +159 -0
@@ -0,0 +1,144 @@
1
+ import { QueryBuilder } from '../expression/index.js';
2
+ import { Database } from './database.js';
3
+ import { DataServiceBase } from './dataservice-base.js';
4
+ /**
5
+ * Function type for building query expressions with type-safe column references.
6
+ * Accepts a QueryBuilder instance and configures the query conditions.
7
+ *
8
+ * @template T - The type representing the table/relation structure for type-safe column access
9
+ * @export
10
+ */
11
+ export type ExpressionBuilder<T = any> = (q: QueryBuilder<T>) => void;
12
+ /**
13
+ * Promise type alias for a set of partial records from a relation.
14
+ * Used as the return type for query methods that return multiple records.
15
+ *
16
+ * @template RecordType - The type of records in the result set
17
+ * @export
18
+ */
19
+ export type PromiseOfRecordSet<RecordType> = Promise<Partial<RecordType>[]>;
20
+ /**
21
+ * Promise type alias for a single partial record from a relation.
22
+ * Used as the return type for query methods that return a single record.
23
+ *
24
+ * @template RecordType - The type of the record to return
25
+ * @export
26
+ */
27
+ export type PromiseOfRecord<RecordType> = Promise<Partial<RecordType>>;
28
+ /**
29
+ * Abstract base class for read-only data services that query a single database relation.
30
+ * Provides common query patterns like findById, findByExpression, and findAll.
31
+ *
32
+ * Uses the expression builder from @blendsdk/expression for type-safe query construction
33
+ * and delegates execution to the FromStatement builder.
34
+ *
35
+ * To create a concrete data service, either extend this class or use the
36
+ * `createQueryService()` factory function.
37
+ *
38
+ * @export
39
+ * @abstract
40
+ * @class QueryDataService
41
+ * @extends {DataServiceBase}
42
+ * @template RelationType - The type representing the database relation/table structure
43
+ *
44
+ * @example
45
+ * // Using the factory function
46
+ * const UserService = createQueryService<User>('users', 'id');
47
+ * const service = new UserService(db);
48
+ * const user = await service.findById(123);
49
+ *
50
+ * @example
51
+ * // Extending the class
52
+ * class UserService extends QueryDataService<User> {
53
+ * constructor(db: Database) {
54
+ * super('users', 'id', db);
55
+ * }
56
+ * }
57
+ */
58
+ export declare abstract class QueryDataService<RelationType> extends DataServiceBase {
59
+ /**
60
+ * The name of the database relation (table or view) this service queries.
61
+ *
62
+ * @type {string}
63
+ * @memberof QueryDataService
64
+ */
65
+ relation: string;
66
+ /**
67
+ * The name of the primary key column used for findById queries.
68
+ *
69
+ * @type {string}
70
+ * @memberof QueryDataService
71
+ */
72
+ idColumn: string;
73
+ /**
74
+ * Creates an instance of QueryDataService.
75
+ *
76
+ * @param {string} relation - The name of the database relation (table/view) to query
77
+ * @param {string} idColumn - The name of the primary key column
78
+ * @param {Database} db - The database instance to execute queries against
79
+ * @memberof QueryDataService
80
+ */
81
+ constructor(relation: string, idColumn: string, db: Database);
82
+ /**
83
+ * Finds a single record by its primary key value.
84
+ * Constructs a WHERE clause matching the idColumn to the provided value.
85
+ *
86
+ * @template IdType - The type of the primary key value
87
+ * @param {IdType} id - The primary key value to search for
88
+ * @returns {PromiseOfRecord<RelationType | null>} The matching record, or null if not found
89
+ * @memberof QueryDataService
90
+ */
91
+ findById<IdType>(id: IdType): PromiseOfRecord<RelationType | null>;
92
+ /**
93
+ * Finds a single record matching a custom expression.
94
+ * Returns the first matching record, or null if no records match.
95
+ *
96
+ * @param {ExpressionBuilder<RelationType>} builder - Expression builder function to construct the WHERE clause
97
+ * @returns {PromiseOfRecord<RelationType | null>} The first matching record, or null if not found
98
+ * @memberof QueryDataService
99
+ *
100
+ * @example
101
+ * const user = await service.findByExpression(q =>
102
+ * q.where('email').equals('alice@example.com')
103
+ * );
104
+ */
105
+ findByExpression(builder: ExpressionBuilder<RelationType>): PromiseOfRecord<RelationType | null>;
106
+ /**
107
+ * Finds all records matching a custom expression.
108
+ * Returns an empty array if no records match.
109
+ *
110
+ * @param {ExpressionBuilder<RelationType>} builder - Expression builder function to construct the WHERE clause
111
+ * @returns {PromiseOfRecordSet<RelationType>} Array of matching records
112
+ * @memberof QueryDataService
113
+ *
114
+ * @example
115
+ * const activeUsers = await service.findAllByExpression(q =>
116
+ * q.where('active').equals(true)
117
+ * );
118
+ */
119
+ findAllByExpression(builder: ExpressionBuilder<RelationType>): PromiseOfRecordSet<RelationType>;
120
+ /**
121
+ * Finds all records in the relation without any filtering.
122
+ * Returns an empty array if the relation is empty.
123
+ *
124
+ * @returns {PromiseOfRecordSet<RelationType>} Array of all records in the relation
125
+ * @memberof QueryDataService
126
+ */
127
+ findAll(): PromiseOfRecordSet<RelationType>;
128
+ }
129
+ /**
130
+ * Factory function that creates a concrete QueryDataService class for a specific relation.
131
+ * The returned class can be instantiated with just a Database instance.
132
+ *
133
+ * @template RelationType - The type representing the relation/table structure
134
+ * @param {string} relationName - The name of the relation/table
135
+ * @param {string} idColumn - The name of the primary key column
136
+ * @returns A concrete QueryDataService class bound to the specified relation
137
+ *
138
+ * @example
139
+ * const UserService = createQueryService<User>('users', 'id');
140
+ * const service = new UserService(db);
141
+ * const user = await service.findById(123);
142
+ */
143
+ export declare function createQueryService<RelationType>(relationName: string, idColumn: string): new (db: Database) => QueryDataService<RelationType>;
144
+ //# sourceMappingURL=query-dataservice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-dataservice.d.ts","sourceRoot":"","sources":["../src/query-dataservice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,CAAC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,CAAC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,8BAAsB,gBAAgB,CAAC,YAAY,CAAE,SAAQ,eAAe;IAC1E;;;;;OAKG;IACI,QAAQ,EAAE,MAAM,CAAC;IAExB;;;;;OAKG;IACI,QAAQ,EAAE,MAAM,CAAC;IAExB;;;;;;;OAOG;gBACS,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ;IAM5D;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe,CAAC,YAAY,GAAG,IAAI,CAAC;IAMlE;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,YAAY,GAAG,IAAI,CAAC;IAMhG;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAAC,GAAG,kBAAkB,CAAC,YAAY,CAAC;IAM/F;;;;;;OAMG;IACH,OAAO,IAAI,kBAAkB,CAAC,YAAY,CAAC;CAG5C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAC7C,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GACf,KAAK,EAAE,EAAE,QAAQ,KAAK,gBAAgB,CAAC,YAAY,CAAC,CAOtD"}
@@ -0,0 +1,144 @@
1
+ import { query } from '../expression/index.js';
2
+ import { DataServiceBase } from './dataservice-base.js';
3
+ /**
4
+ * Abstract base class for read-only data services that query a single database relation.
5
+ * Provides common query patterns like findById, findByExpression, and findAll.
6
+ *
7
+ * Uses the expression builder from @blendsdk/expression for type-safe query construction
8
+ * and delegates execution to the FromStatement builder.
9
+ *
10
+ * To create a concrete data service, either extend this class or use the
11
+ * `createQueryService()` factory function.
12
+ *
13
+ * @export
14
+ * @abstract
15
+ * @class QueryDataService
16
+ * @extends {DataServiceBase}
17
+ * @template RelationType - The type representing the database relation/table structure
18
+ *
19
+ * @example
20
+ * // Using the factory function
21
+ * const UserService = createQueryService<User>('users', 'id');
22
+ * const service = new UserService(db);
23
+ * const user = await service.findById(123);
24
+ *
25
+ * @example
26
+ * // Extending the class
27
+ * class UserService extends QueryDataService<User> {
28
+ * constructor(db: Database) {
29
+ * super('users', 'id', db);
30
+ * }
31
+ * }
32
+ */
33
+ export class QueryDataService extends DataServiceBase {
34
+ /**
35
+ * The name of the database relation (table or view) this service queries.
36
+ *
37
+ * @type {string}
38
+ * @memberof QueryDataService
39
+ */
40
+ relation;
41
+ /**
42
+ * The name of the primary key column used for findById queries.
43
+ *
44
+ * @type {string}
45
+ * @memberof QueryDataService
46
+ */
47
+ idColumn;
48
+ /**
49
+ * Creates an instance of QueryDataService.
50
+ *
51
+ * @param {string} relation - The name of the database relation (table/view) to query
52
+ * @param {string} idColumn - The name of the primary key column
53
+ * @param {Database} db - The database instance to execute queries against
54
+ * @memberof QueryDataService
55
+ */
56
+ constructor(relation, idColumn, db) {
57
+ super(db);
58
+ this.relation = relation;
59
+ this.idColumn = idColumn;
60
+ }
61
+ /**
62
+ * Finds a single record by its primary key value.
63
+ * Constructs a WHERE clause matching the idColumn to the provided value.
64
+ *
65
+ * @template IdType - The type of the primary key value
66
+ * @param {IdType} id - The primary key value to search for
67
+ * @returns {PromiseOfRecord<RelationType | null>} The matching record, or null if not found
68
+ * @memberof QueryDataService
69
+ */
70
+ findById(id) {
71
+ const qb = query();
72
+ qb.where(this.idColumn).equals(id);
73
+ return this.db.from(this.relation).select().byExpression(qb.compile()).executeReturnSingle();
74
+ }
75
+ /**
76
+ * Finds a single record matching a custom expression.
77
+ * Returns the first matching record, or null if no records match.
78
+ *
79
+ * @param {ExpressionBuilder<RelationType>} builder - Expression builder function to construct the WHERE clause
80
+ * @returns {PromiseOfRecord<RelationType | null>} The first matching record, or null if not found
81
+ * @memberof QueryDataService
82
+ *
83
+ * @example
84
+ * const user = await service.findByExpression(q =>
85
+ * q.where('email').equals('alice@example.com')
86
+ * );
87
+ */
88
+ findByExpression(builder) {
89
+ const qb = query();
90
+ builder(qb);
91
+ return this.db.from(this.relation).select().byExpression(qb.compile()).executeReturnSingle();
92
+ }
93
+ /**
94
+ * Finds all records matching a custom expression.
95
+ * Returns an empty array if no records match.
96
+ *
97
+ * @param {ExpressionBuilder<RelationType>} builder - Expression builder function to construct the WHERE clause
98
+ * @returns {PromiseOfRecordSet<RelationType>} Array of matching records
99
+ * @memberof QueryDataService
100
+ *
101
+ * @example
102
+ * const activeUsers = await service.findAllByExpression(q =>
103
+ * q.where('active').equals(true)
104
+ * );
105
+ */
106
+ findAllByExpression(builder) {
107
+ const qb = query();
108
+ builder(qb);
109
+ return this.db.from(this.relation).select().byExpression(qb.compile()).executeReturnAll();
110
+ }
111
+ /**
112
+ * Finds all records in the relation without any filtering.
113
+ * Returns an empty array if the relation is empty.
114
+ *
115
+ * @returns {PromiseOfRecordSet<RelationType>} Array of all records in the relation
116
+ * @memberof QueryDataService
117
+ */
118
+ findAll() {
119
+ return this.db.from(this.relation).select().executeReturnAll();
120
+ }
121
+ }
122
+ /**
123
+ * Factory function that creates a concrete QueryDataService class for a specific relation.
124
+ * The returned class can be instantiated with just a Database instance.
125
+ *
126
+ * @template RelationType - The type representing the relation/table structure
127
+ * @param {string} relationName - The name of the relation/table
128
+ * @param {string} idColumn - The name of the primary key column
129
+ * @returns A concrete QueryDataService class bound to the specified relation
130
+ *
131
+ * @example
132
+ * const UserService = createQueryService<User>('users', 'id');
133
+ * const service = new UserService(db);
134
+ * const user = await service.findById(123);
135
+ */
136
+ export function createQueryService(relationName, idColumn) {
137
+ class ConcreteQueryDataService extends QueryDataService {
138
+ constructor(db) {
139
+ super(relationName, idColumn, db);
140
+ }
141
+ }
142
+ return ConcreteQueryDataService;
143
+ }
144
+ //# sourceMappingURL=query-dataservice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-dataservice.js","sourceRoot":"","sources":["../src/query-dataservice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgB,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AA6BxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,OAAgB,gBAA+B,SAAQ,eAAe;IAC1E;;;;;OAKG;IACI,QAAQ,CAAS;IAExB;;;;;OAKG;IACI,QAAQ,CAAS;IAExB;;;;;;;OAOG;IACH,YAAY,QAAgB,EAAE,QAAgB,EAAE,EAAY;QAC1D,KAAK,CAAC,EAAE,CAAC,CAAC;QACV,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAS,EAAU;QACzB,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;QACnB,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,mBAAmB,EAAE,CAAC;IAC/F,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,gBAAgB,CAAC,OAAwC;QACvD,MAAM,EAAE,GAAG,KAAK,EAAgB,CAAC;QACjC,OAAO,CAAC,EAAE,CAAC,CAAC;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,mBAAmB,EAAE,CAAC;IAC/F,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,OAAwC;QAC1D,MAAM,EAAE,GAAG,KAAK,EAAgB,CAAC;QACjC,OAAO,CAAC,EAAE,CAAC,CAAC;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC5F,CAAC;IAED;;;;;;OAMG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,EAAE,CAAC,IAAI,CAAe,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC/E,CAAC;CACF;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,kBAAkB,CAChC,YAAoB,EACpB,QAAgB;IAEhB,MAAM,wBAAyB,SAAQ,gBAA8B;QACnE,YAAY,EAAY;YACtB,KAAK,CAAC,YAAY,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACpC,CAAC;KACF;IACD,OAAO,wBAAwB,CAAC;AAClC,CAAC"}
@@ -0,0 +1,133 @@
1
+ import { Database, QueryResult } from './database.js';
2
+ /**
3
+ * Abstract base class for all SQL statement builders.
4
+ * Provides common functionality for building and executing database queries,
5
+ * including parameter handling, query execution, and result processing.
6
+ *
7
+ * This class implements the builder pattern, allowing for fluent method chaining
8
+ * when constructing database queries. Concrete implementations must provide
9
+ * the specific query building logic for their statement type.
10
+ *
11
+ * @export
12
+ * @abstract
13
+ * @class Statement
14
+ * @template TableType - The type representing the table structure this statement operates on
15
+ */
16
+ export declare abstract class Statement<TableType = any> {
17
+ protected db: Database;
18
+ /**
19
+ * Handler function to transform parameters before query execution.
20
+ * Set via the beforeQuery() method to enable parameter preprocessing.
21
+ *
22
+ * @protected
23
+ * @type {((params: any) => any) | null}
24
+ * @memberof Statement
25
+ */
26
+ protected _beforeQuery: ((params: any) => any) | null;
27
+ /**
28
+ * Handler function to transform result rows after query execution.
29
+ * Set via the afterQuery() method to enable result postprocessing
30
+ * (e.g., data transformation, filtering, or augmenting returned records).
31
+ *
32
+ * @protected
33
+ * @type {((rows: any) => any) | null}
34
+ * @memberof Statement
35
+ */
36
+ protected _afterQuery: ((rows: any) => any) | null;
37
+ /**
38
+ * Creates an instance of Statement.
39
+ * Initializes the statement with a database connection and sets up
40
+ * parameter transformation handlers to null.
41
+ *
42
+ * @param {Database} db - The database instance to execute queries against
43
+ * @memberof Statement
44
+ */
45
+ constructor(db: Database);
46
+ /**
47
+ * Builds the SQL query string for this statement.
48
+ * Must be implemented by concrete statement classes to generate
49
+ * the appropriate SQL syntax for their operation type.
50
+ *
51
+ * @protected
52
+ * @abstract
53
+ * @return {string} The SQL query string
54
+ * @memberof Statement
55
+ */
56
+ protected abstract buildQuery(): string;
57
+ /**
58
+ * Builds the parameter object for this statement's query.
59
+ * Must be implemented by concrete statement classes to provide
60
+ * the parameters needed for their specific query.
61
+ *
62
+ * @protected
63
+ * @abstract
64
+ * @return {any} The parameters object for the query
65
+ * @memberof Statement
66
+ */
67
+ protected abstract buildParameters(): any;
68
+ /**
69
+ * Executes the statement and returns the query result.
70
+ * Builds the query and parameters, applies any registered parameter handlers,
71
+ * and executes the query through the database connection.
72
+ *
73
+ * @template R - The type of QueryResult expected, defaults to QueryResult<any>
74
+ * @return {Promise<R | null>} Promise resolving to the query result or null
75
+ * @memberof Statement
76
+ */
77
+ execute<R extends QueryResult<any> = QueryResult<any>>(): Promise<R | null>;
78
+ /**
79
+ * Executes the statement and returns the first record from the result.
80
+ * Useful for queries expected to return a single row, such as SELECT with LIMIT 1
81
+ * or queries filtering by unique identifiers.
82
+ *
83
+ * @return {Promise<Partial<TableType> | null>} Promise resolving to the first record or null if no records found
84
+ * @memberof Statement
85
+ */
86
+ executeReturnSingle(): Promise<Partial<TableType> | null>;
87
+ /**
88
+ * Executes the statement and returns all records from the result.
89
+ * Returns an empty array if no records are found.
90
+ *
91
+ * @return {Promise<Partial<TableType>[]>} Promise resolving to an array of all records
92
+ * @memberof Statement
93
+ */
94
+ executeReturnAll(): Promise<Partial<TableType>[]>;
95
+ /**
96
+ * Executes the statement and returns the number of affected rows.
97
+ * Useful for INSERT, UPDATE, and DELETE operations where you need to know
98
+ * how many rows were modified.
99
+ *
100
+ * @return {Promise<number>} Promise resolving to the count of affected rows
101
+ * @memberof Statement
102
+ */
103
+ executeReturnCount(): Promise<number>;
104
+ /**
105
+ * Registers a handler to transform parameters before query execution.
106
+ * The handler receives the parameters object and must return a transformed version.
107
+ * Useful for parameter validation, sanitization, or transformation before the query runs.
108
+ *
109
+ * @template T - The type of the parameters object
110
+ * @param {(params: T) => T} handler - The transformation function to apply before query execution
111
+ * @return {this} The statement instance for method chaining
112
+ * @memberof Statement
113
+ */
114
+ beforeQuery<T>(handler: (params: T) => T): this;
115
+ /**
116
+ * Registers a handler to transform result rows after query execution.
117
+ * The handler receives the query result rows array and must return a transformed version.
118
+ * Useful for data transformation, field mapping, or post-processing of returned records.
119
+ *
120
+ * @template T - The type of the result rows array
121
+ * @param {(rows: T) => T} handler - The transformation function to apply to result rows
122
+ * @return {this} The statement instance for method chaining
123
+ * @memberof Statement
124
+ *
125
+ * @example
126
+ * // Convert all date strings to Date objects
127
+ * statement.afterQuery((rows) =>
128
+ * rows.map(row => ({ ...row, created_at: new Date(row.created_at) }))
129
+ * )
130
+ */
131
+ afterQuery<T>(handler: (rows: T) => T): this;
132
+ }
133
+ //# sourceMappingURL=statement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statement.d.ts","sourceRoot":"","sources":["../src/statement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAuB,WAAW,EAAE,MAAM,eAAe,CAAC;AAE3E;;;;;;;;;;;;;GAaG;AACH,8BAAsB,SAAS,CAAC,SAAS,GAAG,GAAG;IA8BjC,SAAS,CAAC,EAAE,EAAE,QAAQ;IA7BlC;;;;;;;OAOG;IACH,SAAS,CAAC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC;IAEtD;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC;IAEnD;;;;;;;OAOG;gBACmB,EAAE,EAAE,QAAQ;IAKlC;;;;;;;;;OASG;IACH,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,MAAM;IAEvC;;;;;;;;;OASG;IACH,SAAS,CAAC,QAAQ,CAAC,eAAe,IAAI,GAAG;IAEzC;;;;;;;;OAQG;IACH,OAAO,CAAC,CAAC,SAAS,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAgB3E;;;;;;;OAOG;IACG,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAK/D;;;;;;OAMG;IACG,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;IAKvD;;;;;;;OAOG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAK3C;;;;;;;;;OASG;IACH,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI;IAK/C;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI;CAI7C"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Abstract base class for all SQL statement builders.
3
+ * Provides common functionality for building and executing database queries,
4
+ * including parameter handling, query execution, and result processing.
5
+ *
6
+ * This class implements the builder pattern, allowing for fluent method chaining
7
+ * when constructing database queries. Concrete implementations must provide
8
+ * the specific query building logic for their statement type.
9
+ *
10
+ * @export
11
+ * @abstract
12
+ * @class Statement
13
+ * @template TableType - The type representing the table structure this statement operates on
14
+ */
15
+ export class Statement {
16
+ db;
17
+ /**
18
+ * Handler function to transform parameters before query execution.
19
+ * Set via the beforeQuery() method to enable parameter preprocessing.
20
+ *
21
+ * @protected
22
+ * @type {((params: any) => any) | null}
23
+ * @memberof Statement
24
+ */
25
+ _beforeQuery;
26
+ /**
27
+ * Handler function to transform result rows after query execution.
28
+ * Set via the afterQuery() method to enable result postprocessing
29
+ * (e.g., data transformation, filtering, or augmenting returned records).
30
+ *
31
+ * @protected
32
+ * @type {((rows: any) => any) | null}
33
+ * @memberof Statement
34
+ */
35
+ _afterQuery;
36
+ /**
37
+ * Creates an instance of Statement.
38
+ * Initializes the statement with a database connection and sets up
39
+ * parameter transformation handlers to null.
40
+ *
41
+ * @param {Database} db - The database instance to execute queries against
42
+ * @memberof Statement
43
+ */
44
+ constructor(db) {
45
+ this.db = db;
46
+ this._beforeQuery = null;
47
+ this._afterQuery = null;
48
+ }
49
+ /**
50
+ * Executes the statement and returns the query result.
51
+ * Builds the query and parameters, applies any registered parameter handlers,
52
+ * and executes the query through the database connection.
53
+ *
54
+ * @template R - The type of QueryResult expected, defaults to QueryResult<any>
55
+ * @return {Promise<R | null>} Promise resolving to the query result or null
56
+ * @memberof Statement
57
+ */
58
+ execute() {
59
+ const options = {};
60
+ if (this._beforeQuery) {
61
+ options.beforeQuery = this._beforeQuery;
62
+ }
63
+ if (this._afterQuery) {
64
+ options.afterQuery = this._afterQuery;
65
+ }
66
+ return this.db.executeQuery(this.buildQuery(), this.buildParameters(), options);
67
+ }
68
+ /**
69
+ * Executes the statement and returns the first record from the result.
70
+ * Useful for queries expected to return a single row, such as SELECT with LIMIT 1
71
+ * or queries filtering by unique identifiers.
72
+ *
73
+ * @return {Promise<Partial<TableType> | null>} Promise resolving to the first record or null if no records found
74
+ * @memberof Statement
75
+ */
76
+ async executeReturnSingle() {
77
+ const result = await this.execute();
78
+ return result?.records[0] || null;
79
+ }
80
+ /**
81
+ * Executes the statement and returns all records from the result.
82
+ * Returns an empty array if no records are found.
83
+ *
84
+ * @return {Promise<Partial<TableType>[]>} Promise resolving to an array of all records
85
+ * @memberof Statement
86
+ */
87
+ async executeReturnAll() {
88
+ const result = await this.execute();
89
+ return (result?.records || []);
90
+ }
91
+ /**
92
+ * Executes the statement and returns the number of affected rows.
93
+ * Useful for INSERT, UPDATE, and DELETE operations where you need to know
94
+ * how many rows were modified.
95
+ *
96
+ * @return {Promise<number>} Promise resolving to the count of affected rows
97
+ * @memberof Statement
98
+ */
99
+ async executeReturnCount() {
100
+ const result = await this.execute();
101
+ return result?.rowCount || 0;
102
+ }
103
+ /**
104
+ * Registers a handler to transform parameters before query execution.
105
+ * The handler receives the parameters object and must return a transformed version.
106
+ * Useful for parameter validation, sanitization, or transformation before the query runs.
107
+ *
108
+ * @template T - The type of the parameters object
109
+ * @param {(params: T) => T} handler - The transformation function to apply before query execution
110
+ * @return {this} The statement instance for method chaining
111
+ * @memberof Statement
112
+ */
113
+ beforeQuery(handler) {
114
+ this._beforeQuery = handler;
115
+ return this;
116
+ }
117
+ /**
118
+ * Registers a handler to transform result rows after query execution.
119
+ * The handler receives the query result rows array and must return a transformed version.
120
+ * Useful for data transformation, field mapping, or post-processing of returned records.
121
+ *
122
+ * @template T - The type of the result rows array
123
+ * @param {(rows: T) => T} handler - The transformation function to apply to result rows
124
+ * @return {this} The statement instance for method chaining
125
+ * @memberof Statement
126
+ *
127
+ * @example
128
+ * // Convert all date strings to Date objects
129
+ * statement.afterQuery((rows) =>
130
+ * rows.map(row => ({ ...row, created_at: new Date(row.created_at) }))
131
+ * )
132
+ */
133
+ afterQuery(handler) {
134
+ this._afterQuery = handler;
135
+ return this;
136
+ }
137
+ }
138
+ //# sourceMappingURL=statement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statement.js","sourceRoot":"","sources":["../src/statement.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAgB,SAAS;IA8BP;IA7BtB;;;;;;;OAOG;IACO,YAAY,CAAgC;IAEtD;;;;;;;;OAQG;IACO,WAAW,CAA8B;IAEnD;;;;;;;OAOG;IACH,YAAsB,EAAY;QAAZ,OAAE,GAAF,EAAE,CAAU;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IA0BD;;;;;;;;OAQG;IACH,OAAO;QACL,MAAM,OAAO,GAAwB,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;QAC1C,CAAC;QACD,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC;QACxC,CAAC;QAED,OAAO,IAAI,CAAC,EAAE,CAAC,YAAY,CACzB,IAAI,CAAC,UAAU,EAAE,EACjB,IAAI,CAAC,eAAe,EAAE,EACtB,OAAO,CACa,CAAC;IACzB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,mBAAmB;QACvB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACpC,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IACpC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,gBAAgB;QACpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACpC,OAAO,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,CAAyB,CAAC;IACzD,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,kBAAkB;QACtB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACpC,OAAO,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;;;;OASG;IACH,WAAW,CAAI,OAAyB;QACtC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAI,OAAuB;QACnC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -0,0 +1,48 @@
1
+ import { FilterableStatement } from './filterable-statement.js';
2
+ import { Database } from './database.js';
3
+ /**
4
+ * Abstract statement builder for UPDATE operations.
5
+ * Extends FilterableStatement to provide functionality for updating existing records in database tables.
6
+ * Concrete database implementations must extend this class to provide database-specific
7
+ * UPDATE query construction and parameter handling.
8
+ *
9
+ * This class provides a fluent interface for building UPDATE statements with support
10
+ * for filtering which records to update and RETURNING clauses to retrieve updated data.
11
+ *
12
+ * @export
13
+ * @abstract
14
+ * @class UpdateStatement
15
+ * @extends {FilterableStatement<TableType, FilterType>}
16
+ * @template TableType - The type representing the table structure for updates
17
+ * @template FilterType - The type representing the filter criteria structure
18
+ */
19
+ export declare abstract class UpdateStatement<TableType, FilterType> extends FilterableStatement<TableType, FilterType> {
20
+ /**
21
+ * Creates an instance of UpdateStatement.
22
+ * Initializes the statement with a table name and database connection.
23
+ *
24
+ * @param {string} tableName - The name of the table to update
25
+ * @param {Database} db - The database instance to execute queries against
26
+ * @memberof UpdateStatement
27
+ */
28
+ constructor(tableName: string, db: Database);
29
+ /**
30
+ * Sets the values to be updated in the table.
31
+ * Accepts a partial object where keys represent column names and values
32
+ * represent the new data. Only the specified columns will be updated.
33
+ *
34
+ * @param {Partial<TableType>} values - Object containing column names and new values
35
+ * @return {this} The statement instance for method chaining
36
+ * @memberof UpdateStatement
37
+ *
38
+ * @example
39
+ * // Update user fields
40
+ * statement.values({
41
+ * name: 'Jane Doe',
42
+ * email: 'jane@example.com',
43
+ * updated_at: new Date()
44
+ * })
45
+ */
46
+ values(values: Partial<TableType>): this;
47
+ }
48
+ //# sourceMappingURL=update-statement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-statement.d.ts","sourceRoot":"","sources":["../src/update-statement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,8BAAsB,eAAe,CAAC,SAAS,EAAE,UAAU,CAAE,SAAQ,mBAAmB,CACtF,SAAS,EACT,UAAU,CACX;IACC;;;;;;;OAOG;gBACS,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ;IAI3C;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI;CAIzC"}