orcaq 1.0.32 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (628) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/4by6-f6q.js +982 -0
  3. package/.output/public/_nuxt/8Ppmjv9D.js +1 -0
  4. package/.output/public/_nuxt/B1qjkRVO.js +1 -0
  5. package/.output/public/_nuxt/B3KEisfc.js +1 -0
  6. package/.output/public/_nuxt/B4ebLeWY.js +9 -0
  7. package/.output/public/_nuxt/{IitECNfD.js → B6hH0qos.js} +1 -1
  8. package/.output/public/_nuxt/{BUDtG__q.js → B7HEMfgt.js} +1 -1
  9. package/.output/public/_nuxt/B84SvUzr.js +1 -0
  10. package/.output/public/_nuxt/BDXvbRNW.js +1 -0
  11. package/.output/public/_nuxt/BGRcizqy.js +1 -0
  12. package/.output/public/_nuxt/{ClYziJpO.js → BGVGiigU.js} +1 -1
  13. package/.output/public/_nuxt/{ZdjmUBoX.js → BJYf67_H.js} +1 -1
  14. package/.output/public/_nuxt/BOK5ZFNK.js +1 -0
  15. package/.output/public/_nuxt/BPY2ud8g.js +1 -0
  16. package/.output/public/_nuxt/BSONoRG4.js +2 -0
  17. package/.output/public/_nuxt/BT53m-su.js +1 -0
  18. package/.output/public/_nuxt/BTJSh8in.js +2 -0
  19. package/.output/public/_nuxt/BVpt8J3a.js +1 -0
  20. package/.output/public/_nuxt/{BhUkpIlA.js → BdDEVolW.js} +1 -1
  21. package/.output/public/_nuxt/{C27bL9Es.js → BeNILdbT.js} +1 -1
  22. package/.output/public/_nuxt/{Dnx67EG9.js → BmU9CNkM.js} +1 -1
  23. package/.output/public/_nuxt/{DLHYqHwF.js → BnFDcr74.js} +1 -1
  24. package/.output/public/_nuxt/{sE-55p4e.js → BprXyYdv.js} +1 -1
  25. package/.output/public/_nuxt/{BCcTASq_.js → Bq7otXBA.js} +1 -1
  26. package/.output/public/_nuxt/{B_PBOfFN.js → BqyO8OjC.js} +93 -93
  27. package/.output/public/_nuxt/Bs1og3h1.js +10 -0
  28. package/.output/public/_nuxt/Bs2DgR_z.js +1 -0
  29. package/.output/public/_nuxt/{BsoQBloB.js → BvUhrUEH.js} +1 -1
  30. package/.output/public/_nuxt/{DkggUtNN.js → BxDrCsPf.js} +1 -1
  31. package/.output/public/_nuxt/BxrwrGYE.js +1 -0
  32. package/.output/public/_nuxt/By0aUn7N.js +1 -0
  33. package/.output/public/_nuxt/{C07rlnlv.js → ByOuUnNS.js} +1 -1
  34. package/.output/public/_nuxt/C177_GoB.js +1 -0
  35. package/.output/public/_nuxt/{DcfsxCxL.js → C1jMZ4hc.js} +1 -1
  36. package/.output/public/_nuxt/C5bgdIOp.js +1 -0
  37. package/.output/public/_nuxt/C69a9jD3.js +67 -0
  38. package/.output/public/_nuxt/C8AyZ3_X.js +2 -0
  39. package/.output/public/_nuxt/C8KplD68.js +1 -0
  40. package/.output/public/_nuxt/CA99KAte.js +3 -0
  41. package/.output/public/_nuxt/{CvTHaPAO.js → CE8aasoy.js} +1 -1
  42. package/.output/public/_nuxt/{DkY69STm.js → CEvNlevo.js} +1 -1
  43. package/.output/public/_nuxt/{B8JnYxjr.js → CKqvNpN3.js} +1 -1
  44. package/.output/public/_nuxt/CNF1h1lI.js +1 -0
  45. package/.output/public/_nuxt/COAycMg4.js +1 -0
  46. package/.output/public/_nuxt/CR6_eO9a.js +6 -0
  47. package/.output/public/_nuxt/{D4jn2f-6.js → CREZ9f0O.js} +4 -4
  48. package/.output/public/_nuxt/CS5ItJPR.js +39 -0
  49. package/.output/public/_nuxt/CcK14gfI.js +1 -0
  50. package/.output/public/_nuxt/{DnxDSFih.js → Ci43mke5.js} +3 -3
  51. package/.output/public/_nuxt/CjouDEjz.js +1 -0
  52. package/.output/public/_nuxt/Cp5lMcfd.js +1 -0
  53. package/.output/public/_nuxt/CpYiq1Wv.js +1 -0
  54. package/.output/public/_nuxt/{DVxTxYP4.js → CrLqg4B0.js} +1 -1
  55. package/.output/public/_nuxt/{BJxYuvXF.js → CvcedJeQ.js} +1 -1
  56. package/.output/public/_nuxt/{FIJP2AmN.js → Cvq07PgE.js} +1 -1
  57. package/.output/public/_nuxt/CwmbX4-U.js +1 -0
  58. package/.output/public/_nuxt/{B27ECqWz.js → Cx6s86aR.js} +1 -1
  59. package/.output/public/_nuxt/{DDYV6jDr.js → CybtvDjH.js} +1 -1
  60. package/.output/public/_nuxt/CzB2y8br.js +18 -0
  61. package/.output/public/_nuxt/{-p9JbKy8.js → D-YUpbah.js} +3 -3
  62. package/.output/public/_nuxt/D60Pzl_V.js +1 -0
  63. package/.output/public/_nuxt/D9BYd7AV.js +1 -0
  64. package/.output/public/_nuxt/D9dEqMyH.js +152 -0
  65. package/.output/public/_nuxt/DCJ49Fnq.js +1 -0
  66. package/.output/public/_nuxt/{gO22NLpn.js → DESYlybj.js} +1 -1
  67. package/.output/public/_nuxt/DFM-aCBX.js +1 -0
  68. package/.output/public/_nuxt/{DRKnK1N_.js → DHnNoguE.js} +1 -1
  69. package/.output/public/_nuxt/{ChkFTcxr.js → DJqZzQsX.js} +1 -1
  70. package/.output/public/_nuxt/DNNdcUH4.js +1 -0
  71. package/.output/public/_nuxt/{LFK46Fls.js → DNdM2ZyK.js} +1 -1
  72. package/.output/public/_nuxt/{CVliJ52o.js → DQT4eICL.js} +1 -1
  73. package/.output/public/_nuxt/{CffFK_qY.js → DWBoXz89.js} +1 -1
  74. package/.output/public/_nuxt/DXp9fCib.js +20 -0
  75. package/.output/public/_nuxt/{ACOLmAuq.js → DaKikgWm.js} +1 -1
  76. package/.output/public/_nuxt/{B9zSkyFO.js → DaMyovpr.js} +1 -1
  77. package/.output/public/_nuxt/DeBdxlx0.js +1 -0
  78. package/.output/public/_nuxt/{trZyeId5.js → DhKwXzSk.js} +1 -1
  79. package/.output/public/_nuxt/{C6Vqzp-9.js → DkadXn5U.js} +1 -1
  80. package/.output/public/_nuxt/Dkikh2OC.js +22 -0
  81. package/.output/public/_nuxt/DlOyXrKK.js +1 -0
  82. package/.output/public/_nuxt/{UqWhjgOc.js → Dpl6-lqE.js} +1 -1
  83. package/.output/public/_nuxt/DqA_edEU.js +1 -0
  84. package/.output/public/_nuxt/DqxL2Lpl.js +1 -0
  85. package/.output/public/_nuxt/Dt3rfvTn.js +1 -0
  86. package/.output/public/_nuxt/Dt5h0Tys.js +1 -0
  87. package/.output/public/_nuxt/DwrSZ8Vj.js +1 -0
  88. package/.output/public/_nuxt/DwyFZZT6.js +1 -0
  89. package/.output/public/_nuxt/EM8J-XL1.js +7 -0
  90. package/.output/public/_nuxt/ESKvsKwc.js +1 -0
  91. package/.output/public/_nuxt/{CWGdTiOD.js → F5lCgNdb.js} +1 -1
  92. package/.output/public/_nuxt/H5m89x1B.js +1 -0
  93. package/.output/public/_nuxt/{CwdIiq6J.js → PUe8M07P.js} +2 -2
  94. package/.output/public/_nuxt/{Cjgqfl1g.js → TEF-nDfP.js} +1 -1
  95. package/.output/public/_nuxt/{DNZpxuwM.js → TuKV3Ilv.js} +1 -1
  96. package/.output/public/_nuxt/V5LvXMJl.js +1 -0
  97. package/.output/public/_nuxt/{c_huf6xz.js → YJvNy3iu.js} +27 -27
  98. package/.output/public/_nuxt/{C7C8tPlA.js → ZObQcd0X.js} +1 -1
  99. package/.output/public/_nuxt/{CHOD7i6O.js → b_MfGg1c.js} +1 -1
  100. package/.output/public/_nuxt/builds/latest.json +1 -1
  101. package/.output/public/_nuxt/builds/meta/455d4da4-6357-4478-8703-78a79ccbbc0f.json +1 -0
  102. package/.output/public/_nuxt/entry.qdzR7QFr.css +1 -0
  103. package/.output/public/_nuxt/fpuEgQ7C.js +12 -0
  104. package/.output/public/_nuxt/jU7fkvuR.js +1 -0
  105. package/.output/public/_nuxt/{CSTzT9hP.js → lHkFwi3L.js} +1 -1
  106. package/.output/public/_nuxt/{BQOaPJzs.js → minLMBmY.js} +1 -1
  107. package/.output/public/_nuxt/pQ8l8BR2.js +1 -0
  108. package/.output/public/_nuxt/xYXqL1eV.js +1 -0
  109. package/.output/public/_nuxt/xxfb8w7n.js +1 -0
  110. package/.output/server/chunks/_/create-adapter.mjs +36 -7
  111. package/.output/server/chunks/_/create-adapter.mjs.map +1 -1
  112. package/.output/server/chunks/_/database-error.mjs +10 -0
  113. package/.output/server/chunks/_/database-error.mjs.map +1 -1
  114. package/.output/server/chunks/_/database-roles.factory.mjs +126 -22
  115. package/.output/server/chunks/_/database-roles.factory.mjs.map +1 -1
  116. package/.output/server/chunks/_/db-connection.mjs +721 -81
  117. package/.output/server/chunks/_/db-connection.mjs.map +1 -1
  118. package/.output/server/chunks/_/functions.factory.mjs +97 -6
  119. package/.output/server/chunks/_/functions.factory.mjs.map +1 -1
  120. package/.output/server/chunks/_/instance-insights.factory.mjs +106 -7
  121. package/.output/server/chunks/_/instance-insights.factory.mjs.map +1 -1
  122. package/.output/server/chunks/_/metadata.factory.mjs +912 -43
  123. package/.output/server/chunks/_/metadata.factory.mjs.map +1 -1
  124. package/.output/server/chunks/_/native-backup-jobs.mjs +1302 -0
  125. package/.output/server/chunks/_/native-backup-jobs.mjs.map +1 -0
  126. package/.output/server/chunks/_/query.factory.mjs +536 -14
  127. package/.output/server/chunks/_/query.factory.mjs.map +1 -1
  128. package/.output/server/chunks/_/schemaMeta.type.mjs +13 -0
  129. package/.output/server/chunks/_/schemaMeta.type.mjs.map +1 -0
  130. package/.output/server/chunks/_/tables.factory.mjs +905 -37
  131. package/.output/server/chunks/_/tables.factory.mjs.map +1 -1
  132. package/.output/server/chunks/_/type-alias.constants.mjs +242 -0
  133. package/.output/server/chunks/_/type-alias.constants.mjs.map +1 -0
  134. package/.output/server/chunks/_/views.factory.mjs +106 -8
  135. package/.output/server/chunks/_/views.factory.mjs.map +1 -1
  136. package/.output/server/chunks/build/client.manifest.mjs +676 -672
  137. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  138. package/.output/server/chunks/nitro/nitro.mjs +1046 -751
  139. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  140. package/.output/server/chunks/routes/api/ai/agent.mjs +30 -79
  141. package/.output/server/chunks/routes/api/ai/agent.mjs.map +1 -1
  142. package/.output/server/chunks/routes/api/database-export/export-database.mjs +26 -124
  143. package/.output/server/chunks/routes/api/database-export/export-database.mjs.map +1 -1
  144. package/.output/server/chunks/routes/api/database-export/jobs/_jobId/download.get.mjs +52 -0
  145. package/.output/server/chunks/routes/api/database-export/jobs/_jobId/download.get.mjs.map +1 -0
  146. package/.output/server/chunks/routes/api/database-export/jobs/_jobId_.get.mjs +43 -0
  147. package/.output/server/chunks/routes/api/database-export/jobs/_jobId_.get.mjs.map +1 -0
  148. package/.output/server/chunks/routes/api/database-import/import-database.mjs +69 -134
  149. package/.output/server/chunks/routes/api/database-import/import-database.mjs.map +1 -1
  150. package/.output/server/chunks/routes/api/database-import/jobs/_jobId_.get.mjs +43 -0
  151. package/.output/server/chunks/routes/api/database-import/jobs/_jobId_.get.mjs.map +1 -0
  152. package/.output/server/chunks/routes/api/database-roles/create-role.mjs +2 -0
  153. package/.output/server/chunks/routes/api/database-roles/create-role.mjs.map +1 -1
  154. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs +2 -0
  155. package/.output/server/chunks/routes/api/database-roles/delete-role.mjs.map +1 -1
  156. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs +2 -0
  157. package/.output/server/chunks/routes/api/database-roles/get-databases-with-permissions.mjs.map +1 -1
  158. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs +2 -0
  159. package/.output/server/chunks/routes/api/database-roles/get-databases.mjs.map +1 -1
  160. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs +2 -0
  161. package/.output/server/chunks/routes/api/database-roles/get-permissions.mjs.map +1 -1
  162. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs +2 -0
  163. package/.output/server/chunks/routes/api/database-roles/get-role-inheritance.mjs.map +1 -1
  164. package/.output/server/chunks/routes/api/database-roles/get-role.mjs +2 -0
  165. package/.output/server/chunks/routes/api/database-roles/get-role.mjs.map +1 -1
  166. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs +2 -0
  167. package/.output/server/chunks/routes/api/database-roles/get-roles.mjs.map +1 -1
  168. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs +2 -0
  169. package/.output/server/chunks/routes/api/database-roles/get-schema-objects.mjs.map +1 -1
  170. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs +2 -0
  171. package/.output/server/chunks/routes/api/database-roles/get-schemas.mjs.map +1 -1
  172. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs +2 -0
  173. package/.output/server/chunks/routes/api/database-roles/grant-bulk-permissions.mjs.map +1 -1
  174. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs +2 -0
  175. package/.output/server/chunks/routes/api/database-roles/grant-permission.mjs.map +1 -1
  176. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs +2 -0
  177. package/.output/server/chunks/routes/api/database-roles/revoke-permission.mjs.map +1 -1
  178. package/.output/server/chunks/routes/api/functions/definition.post.mjs +3 -1
  179. package/.output/server/chunks/routes/api/functions/definition.post.mjs.map +1 -1
  180. package/.output/server/chunks/routes/api/functions/delete.post.mjs +3 -1
  181. package/.output/server/chunks/routes/api/functions/delete.post.mjs.map +1 -1
  182. package/.output/server/chunks/routes/api/functions/overview.post.mjs +3 -1
  183. package/.output/server/chunks/routes/api/functions/overview.post.mjs.map +1 -1
  184. package/.output/server/chunks/routes/api/functions/rename.post.mjs +3 -1
  185. package/.output/server/chunks/routes/api/functions/rename.post.mjs.map +1 -1
  186. package/.output/server/chunks/routes/api/functions/signature.post.mjs +3 -1
  187. package/.output/server/chunks/routes/api/functions/signature.post.mjs.map +1 -1
  188. package/.output/server/chunks/routes/api/functions/update.post.mjs +24 -6
  189. package/.output/server/chunks/routes/api/functions/update.post.mjs.map +1 -1
  190. package/.output/server/chunks/routes/api/index.post.mjs +63 -0
  191. package/.output/server/chunks/routes/api/index.post.mjs.map +1 -0
  192. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs +2 -0
  193. package/.output/server/chunks/routes/api/instance-insights/cancel-query.post.mjs.map +1 -1
  194. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs +2 -0
  195. package/.output/server/chunks/routes/api/instance-insights/configuration.post.mjs.map +1 -1
  196. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs +2 -0
  197. package/.output/server/chunks/routes/api/instance-insights/dashboard.post.mjs.map +1 -1
  198. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs +2 -0
  199. package/.output/server/chunks/routes/api/instance-insights/drop-slot.post.mjs.map +1 -1
  200. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs +2 -0
  201. package/.output/server/chunks/routes/api/instance-insights/replication.post.mjs.map +1 -1
  202. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs +2 -0
  203. package/.output/server/chunks/routes/api/instance-insights/state.post.mjs.map +1 -1
  204. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs +2 -0
  205. package/.output/server/chunks/routes/api/instance-insights/terminate-connection.post.mjs.map +1 -1
  206. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs +2 -0
  207. package/.output/server/chunks/routes/api/instance-insights/toggle-slot-status.post.mjs.map +1 -1
  208. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs +10 -4
  209. package/.output/server/chunks/routes/api/managment-connection/health-check.mjs.map +1 -1
  210. package/.output/server/chunks/routes/api/metadata/erd.post.mjs +4 -0
  211. package/.output/server/chunks/routes/api/metadata/erd.post.mjs.map +1 -1
  212. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs +4 -0
  213. package/.output/server/chunks/routes/api/metadata/meta-data.post.mjs.map +1 -1
  214. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs +4 -0
  215. package/.output/server/chunks/routes/api/metadata/reverse-schemas.post.mjs.map +1 -1
  216. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs +80 -7
  217. package/.output/server/chunks/routes/api/metrics/monitor.post.mjs.map +1 -1
  218. package/.output/server/chunks/routes/api/query/execute.post.mjs +3 -1
  219. package/.output/server/chunks/routes/api/query/execute.post.mjs.map +1 -1
  220. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs +3 -1
  221. package/.output/server/chunks/routes/api/query/raw-execute-stream.post.mjs.map +1 -1
  222. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs +3 -1
  223. package/.output/server/chunks/routes/api/query/raw-execute.post.mjs.map +1 -1
  224. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs +3 -1
  225. package/.output/server/chunks/routes/api/tables/bulk-delete.post.mjs.map +1 -1
  226. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs +3 -1
  227. package/.output/server/chunks/routes/api/tables/bulk-update.post.mjs.map +1 -1
  228. package/.output/server/chunks/routes/api/tables/ddl.post.mjs +3 -1
  229. package/.output/server/chunks/routes/api/tables/ddl.post.mjs.map +1 -1
  230. package/.output/server/chunks/routes/api/tables/export.post.mjs +4 -2
  231. package/.output/server/chunks/routes/api/tables/export.post.mjs.map +1 -1
  232. package/.output/server/chunks/routes/api/tables/indexes.post.mjs +3 -1
  233. package/.output/server/chunks/routes/api/tables/indexes.post.mjs.map +1 -1
  234. package/.output/server/chunks/routes/api/tables/meta.post.mjs +3 -1
  235. package/.output/server/chunks/routes/api/tables/meta.post.mjs.map +1 -1
  236. package/.output/server/chunks/routes/api/tables/overview.post.mjs +3 -1
  237. package/.output/server/chunks/routes/api/tables/overview.post.mjs.map +1 -1
  238. package/.output/server/chunks/routes/api/tables/rls.post.mjs +3 -1
  239. package/.output/server/chunks/routes/api/tables/rls.post.mjs.map +1 -1
  240. package/.output/server/chunks/routes/api/tables/rules.post.mjs +3 -1
  241. package/.output/server/chunks/routes/api/tables/rules.post.mjs.map +1 -1
  242. package/.output/server/chunks/routes/api/tables/size.post.mjs +3 -1
  243. package/.output/server/chunks/routes/api/tables/size.post.mjs.map +1 -1
  244. package/.output/server/chunks/routes/api/tables/structure.post.mjs +3 -1
  245. package/.output/server/chunks/routes/api/tables/structure.post.mjs.map +1 -1
  246. package/.output/server/chunks/routes/api/tables/triggers.post.mjs +3 -1
  247. package/.output/server/chunks/routes/api/tables/triggers.post.mjs.map +1 -1
  248. package/.output/server/chunks/routes/api/views/definition.post.mjs +2 -0
  249. package/.output/server/chunks/routes/api/views/definition.post.mjs.map +1 -1
  250. package/.output/server/chunks/routes/api/views/dependencies.post.mjs +2 -0
  251. package/.output/server/chunks/routes/api/views/dependencies.post.mjs.map +1 -1
  252. package/.output/server/chunks/routes/api/views/explain.post.mjs +2 -0
  253. package/.output/server/chunks/routes/api/views/explain.post.mjs.map +1 -1
  254. package/.output/server/chunks/routes/api/views/indexes.post.mjs +2 -0
  255. package/.output/server/chunks/routes/api/views/indexes.post.mjs.map +1 -1
  256. package/.output/server/chunks/routes/api/views/meta.post.mjs +2 -0
  257. package/.output/server/chunks/routes/api/views/meta.post.mjs.map +1 -1
  258. package/.output/server/chunks/routes/api/views/overview.post.mjs +2 -0
  259. package/.output/server/chunks/routes/api/views/overview.post.mjs.map +1 -1
  260. package/.output/server/chunks/routes/renderer.mjs +1 -1
  261. package/.output/server/index.mjs +1 -1
  262. package/.output/server/node_modules/aws-ssl-profiles/lib/index.js +13 -0
  263. package/.output/server/node_modules/aws-ssl-profiles/lib/profiles/ca/defaults.js +2888 -0
  264. package/.output/server/node_modules/aws-ssl-profiles/lib/profiles/ca/proxies.js +111 -0
  265. package/.output/server/node_modules/aws-ssl-profiles/package.json +52 -0
  266. package/.output/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  267. package/.output/server/node_modules/better-sqlite3/lib/database.js +90 -0
  268. package/.output/server/node_modules/better-sqlite3/lib/index.js +3 -0
  269. package/.output/server/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
  270. package/.output/server/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
  271. package/.output/server/node_modules/better-sqlite3/lib/methods/function.js +31 -0
  272. package/.output/server/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
  273. package/.output/server/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
  274. package/.output/server/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
  275. package/.output/server/node_modules/better-sqlite3/lib/methods/table.js +189 -0
  276. package/.output/server/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
  277. package/.output/server/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
  278. package/.output/server/node_modules/better-sqlite3/lib/sqlite-error.js +20 -0
  279. package/.output/server/node_modules/better-sqlite3/lib/util.js +12 -0
  280. package/.output/server/node_modules/better-sqlite3/package.json +59 -0
  281. package/.output/server/node_modules/cpu-features/build/Release/cpufeatures.node +0 -0
  282. package/.output/server/node_modules/cpu-features/lib/index.js +5 -0
  283. package/.output/server/node_modules/cpu-features/package.json +40 -0
  284. package/.output/server/node_modules/denque/index.js +481 -0
  285. package/.output/server/node_modules/denque/package.json +58 -0
  286. package/.output/server/node_modules/generate-function/index.js +181 -0
  287. package/.output/server/node_modules/generate-function/package.json +32 -0
  288. package/.output/server/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
  289. package/.output/server/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
  290. package/.output/server/node_modules/iconv-lite/encodings/index.js +23 -0
  291. package/.output/server/node_modules/iconv-lite/encodings/internal.js +218 -0
  292. package/.output/server/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
  293. package/.output/server/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  294. package/.output/server/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
  295. package/.output/server/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  296. package/.output/server/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  297. package/.output/server/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  298. package/.output/server/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  299. package/.output/server/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  300. package/.output/server/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  301. package/.output/server/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  302. package/.output/server/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  303. package/.output/server/node_modules/iconv-lite/encodings/utf16.js +187 -0
  304. package/.output/server/node_modules/iconv-lite/encodings/utf32.js +307 -0
  305. package/.output/server/node_modules/iconv-lite/encodings/utf7.js +283 -0
  306. package/.output/server/node_modules/iconv-lite/lib/bom-handling.js +48 -0
  307. package/.output/server/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
  308. package/.output/server/node_modules/iconv-lite/lib/index.js +182 -0
  309. package/.output/server/node_modules/iconv-lite/lib/streams.js +105 -0
  310. package/.output/server/node_modules/iconv-lite/package.json +70 -0
  311. package/.output/server/node_modules/is-property/is-property.js +5 -0
  312. package/.output/server/node_modules/is-property/package.json +36 -0
  313. package/.output/server/node_modules/long/package.json +58 -0
  314. package/.output/server/node_modules/long/umd/index.js +1622 -0
  315. package/.output/server/node_modules/long/umd/package.json +3 -0
  316. package/.output/server/node_modules/lru.min/lib/index.js +248 -0
  317. package/.output/server/node_modules/lru.min/package.json +87 -0
  318. package/.output/server/node_modules/mysql2/index.js +77 -0
  319. package/.output/server/node_modules/mysql2/lib/auth_41.js +95 -0
  320. package/.output/server/node_modules/mysql2/lib/auth_plugins/caching_sha2_password.js +115 -0
  321. package/.output/server/node_modules/mysql2/lib/auth_plugins/index.js +8 -0
  322. package/.output/server/node_modules/mysql2/lib/auth_plugins/mysql_clear_password.js +17 -0
  323. package/.output/server/node_modules/mysql2/lib/auth_plugins/mysql_native_password.js +34 -0
  324. package/.output/server/node_modules/mysql2/lib/auth_plugins/sha256_password.js +74 -0
  325. package/.output/server/node_modules/mysql2/lib/base/connection.js +1139 -0
  326. package/.output/server/node_modules/mysql2/lib/base/pool.js +343 -0
  327. package/.output/server/node_modules/mysql2/lib/commands/auth_switch.js +151 -0
  328. package/.output/server/node_modules/mysql2/lib/commands/binlog_dump.js +109 -0
  329. package/.output/server/node_modules/mysql2/lib/commands/change_user.js +68 -0
  330. package/.output/server/node_modules/mysql2/lib/commands/client_handshake.js +386 -0
  331. package/.output/server/node_modules/mysql2/lib/commands/close_statement.js +18 -0
  332. package/.output/server/node_modules/mysql2/lib/commands/command.js +54 -0
  333. package/.output/server/node_modules/mysql2/lib/commands/execute.js +116 -0
  334. package/.output/server/node_modules/mysql2/lib/commands/index.js +29 -0
  335. package/.output/server/node_modules/mysql2/lib/commands/ping.js +36 -0
  336. package/.output/server/node_modules/mysql2/lib/commands/prepare.js +143 -0
  337. package/.output/server/node_modules/mysql2/lib/commands/query.js +365 -0
  338. package/.output/server/node_modules/mysql2/lib/commands/quit.js +29 -0
  339. package/.output/server/node_modules/mysql2/lib/commands/register_slave.js +27 -0
  340. package/.output/server/node_modules/mysql2/lib/commands/reset_connection.js +29 -0
  341. package/.output/server/node_modules/mysql2/lib/commands/server_handshake.js +205 -0
  342. package/.output/server/node_modules/mysql2/lib/compressed_protocol.js +153 -0
  343. package/.output/server/node_modules/mysql2/lib/connection.js +12 -0
  344. package/.output/server/node_modules/mysql2/lib/connection_config.js +299 -0
  345. package/.output/server/node_modules/mysql2/lib/constants/charset_encodings.js +317 -0
  346. package/.output/server/node_modules/mysql2/lib/constants/charsets.js +317 -0
  347. package/.output/server/node_modules/mysql2/lib/constants/client.js +39 -0
  348. package/.output/server/node_modules/mysql2/lib/constants/commands.js +37 -0
  349. package/.output/server/node_modules/mysql2/lib/constants/cursor.js +9 -0
  350. package/.output/server/node_modules/mysql2/lib/constants/encoding_charset.js +50 -0
  351. package/.output/server/node_modules/mysql2/lib/constants/errors.js +3973 -0
  352. package/.output/server/node_modules/mysql2/lib/constants/field_flags.js +20 -0
  353. package/.output/server/node_modules/mysql2/lib/constants/server_status.js +44 -0
  354. package/.output/server/node_modules/mysql2/lib/constants/session_track.js +11 -0
  355. package/.output/server/node_modules/mysql2/lib/constants/ssl_profiles.js +11 -0
  356. package/.output/server/node_modules/mysql2/lib/constants/types.js +64 -0
  357. package/.output/server/node_modules/mysql2/lib/create_connection.js +10 -0
  358. package/.output/server/node_modules/mysql2/lib/create_pool.js +10 -0
  359. package/.output/server/node_modules/mysql2/lib/create_pool_cluster.js +9 -0
  360. package/.output/server/node_modules/mysql2/lib/helpers.js +83 -0
  361. package/.output/server/node_modules/mysql2/lib/packet_parser.js +195 -0
  362. package/.output/server/node_modules/mysql2/lib/packets/auth_next_factor.js +35 -0
  363. package/.output/server/node_modules/mysql2/lib/packets/auth_switch_request.js +38 -0
  364. package/.output/server/node_modules/mysql2/lib/packets/auth_switch_request_more_data.js +33 -0
  365. package/.output/server/node_modules/mysql2/lib/packets/auth_switch_response.js +30 -0
  366. package/.output/server/node_modules/mysql2/lib/packets/binary_row.js +95 -0
  367. package/.output/server/node_modules/mysql2/lib/packets/binlog_dump.js +33 -0
  368. package/.output/server/node_modules/mysql2/lib/packets/binlog_query_statusvars.js +115 -0
  369. package/.output/server/node_modules/mysql2/lib/packets/change_user.js +97 -0
  370. package/.output/server/node_modules/mysql2/lib/packets/close_statement.js +21 -0
  371. package/.output/server/node_modules/mysql2/lib/packets/column_definition.js +291 -0
  372. package/.output/server/node_modules/mysql2/lib/packets/encode_parameter.js +69 -0
  373. package/.output/server/node_modules/mysql2/lib/packets/execute.js +177 -0
  374. package/.output/server/node_modules/mysql2/lib/packets/handshake.js +112 -0
  375. package/.output/server/node_modules/mysql2/lib/packets/handshake_response.js +173 -0
  376. package/.output/server/node_modules/mysql2/lib/packets/index.js +154 -0
  377. package/.output/server/node_modules/mysql2/lib/packets/packet.js +978 -0
  378. package/.output/server/node_modules/mysql2/lib/packets/prepare_statement.js +27 -0
  379. package/.output/server/node_modules/mysql2/lib/packets/prepared_statement_header.js +16 -0
  380. package/.output/server/node_modules/mysql2/lib/packets/query.js +102 -0
  381. package/.output/server/node_modules/mysql2/lib/packets/register_slave.js +46 -0
  382. package/.output/server/node_modules/mysql2/lib/packets/reset_connection.js +17 -0
  383. package/.output/server/node_modules/mysql2/lib/packets/resultset_header.js +124 -0
  384. package/.output/server/node_modules/mysql2/lib/packets/ssl_request.js +25 -0
  385. package/.output/server/node_modules/mysql2/lib/packets/text_row.js +47 -0
  386. package/.output/server/node_modules/mysql2/lib/parsers/binary_parser.js +235 -0
  387. package/.output/server/node_modules/mysql2/lib/parsers/parser_cache.js +68 -0
  388. package/.output/server/node_modules/mysql2/lib/parsers/static_binary_parser.js +213 -0
  389. package/.output/server/node_modules/mysql2/lib/parsers/static_text_parser.js +152 -0
  390. package/.output/server/node_modules/mysql2/lib/parsers/string.js +50 -0
  391. package/.output/server/node_modules/mysql2/lib/parsers/text_parser.js +214 -0
  392. package/.output/server/node_modules/mysql2/lib/pool.js +12 -0
  393. package/.output/server/node_modules/mysql2/lib/pool_cluster.js +375 -0
  394. package/.output/server/node_modules/mysql2/lib/pool_config.js +34 -0
  395. package/.output/server/node_modules/mysql2/lib/pool_connection.js +81 -0
  396. package/.output/server/node_modules/mysql2/lib/promise/capture_local_err.js +25 -0
  397. package/.output/server/node_modules/mysql2/lib/promise/connection.js +237 -0
  398. package/.output/server/node_modules/mysql2/lib/promise/inherit_events.js +27 -0
  399. package/.output/server/node_modules/mysql2/lib/promise/make_done_cb.js +16 -0
  400. package/.output/server/node_modules/mysql2/lib/promise/pool.js +118 -0
  401. package/.output/server/node_modules/mysql2/lib/promise/pool_cluster.js +59 -0
  402. package/.output/server/node_modules/mysql2/lib/promise/pool_connection.js +19 -0
  403. package/.output/server/node_modules/mysql2/lib/promise/prepared_statement_info.js +35 -0
  404. package/.output/server/node_modules/mysql2/lib/server.js +37 -0
  405. package/.output/server/node_modules/mysql2/lib/tracing.js +81 -0
  406. package/.output/server/node_modules/mysql2/package.json +95 -0
  407. package/.output/server/node_modules/mysql2/promise.js +209 -0
  408. package/.output/server/node_modules/named-placeholders/index.js +179 -0
  409. package/.output/server/node_modules/named-placeholders/package.json +36 -0
  410. package/.output/server/node_modules/oracledb/index.js +27 -0
  411. package/.output/server/node_modules/oracledb/lib/aqDeqOptions.js +186 -0
  412. package/.output/server/node_modules/oracledb/lib/aqEnqOptions.js +81 -0
  413. package/.output/server/node_modules/oracledb/lib/aqMessage.js +149 -0
  414. package/.output/server/node_modules/oracledb/lib/aqQueue.js +293 -0
  415. package/.output/server/node_modules/oracledb/lib/connection.js +1842 -0
  416. package/.output/server/node_modules/oracledb/lib/constants.js +210 -0
  417. package/.output/server/node_modules/oracledb/lib/dbObject.js +606 -0
  418. package/.output/server/node_modules/oracledb/lib/errors.js +1046 -0
  419. package/.output/server/node_modules/oracledb/lib/future.js +53 -0
  420. package/.output/server/node_modules/oracledb/lib/impl/aqDeqOptions.js +206 -0
  421. package/.output/server/node_modules/oracledb/lib/impl/aqEnqOptions.js +89 -0
  422. package/.output/server/node_modules/oracledb/lib/impl/aqMessage.js +134 -0
  423. package/.output/server/node_modules/oracledb/lib/impl/aqQueue.js +82 -0
  424. package/.output/server/node_modules/oracledb/lib/impl/base.js +45 -0
  425. package/.output/server/node_modules/oracledb/lib/impl/connection.js +671 -0
  426. package/.output/server/node_modules/oracledb/lib/impl/datahandlers/buffer.js +1214 -0
  427. package/.output/server/node_modules/oracledb/lib/impl/datahandlers/constants.js +110 -0
  428. package/.output/server/node_modules/oracledb/lib/impl/datahandlers/oson.js +852 -0
  429. package/.output/server/node_modules/oracledb/lib/impl/datahandlers/vector.js +197 -0
  430. package/.output/server/node_modules/oracledb/lib/impl/dbObject.js +159 -0
  431. package/.output/server/node_modules/oracledb/lib/impl/index.js +59 -0
  432. package/.output/server/node_modules/oracledb/lib/impl/lob.js +113 -0
  433. package/.output/server/node_modules/oracledb/lib/impl/pool.js +230 -0
  434. package/.output/server/node_modules/oracledb/lib/impl/resultset.js +307 -0
  435. package/.output/server/node_modules/oracledb/lib/impl/sodaCollection.js +175 -0
  436. package/.output/server/node_modules/oracledb/lib/impl/sodaDatabase.js +82 -0
  437. package/.output/server/node_modules/oracledb/lib/impl/sodaDocCursor.js +64 -0
  438. package/.output/server/node_modules/oracledb/lib/impl/sodaDocument.js +89 -0
  439. package/.output/server/node_modules/oracledb/lib/impl/sodaOperation.js +110 -0
  440. package/.output/server/node_modules/oracledb/lib/lob.js +315 -0
  441. package/.output/server/node_modules/oracledb/lib/oracledb.js +1716 -0
  442. package/.output/server/node_modules/oracledb/lib/pool.js +873 -0
  443. package/.output/server/node_modules/oracledb/lib/poolStatistics.js +143 -0
  444. package/.output/server/node_modules/oracledb/lib/queryStream.js +119 -0
  445. package/.output/server/node_modules/oracledb/lib/resultset.js +368 -0
  446. package/.output/server/node_modules/oracledb/lib/settings.js +221 -0
  447. package/.output/server/node_modules/oracledb/lib/sodaCollection.js +284 -0
  448. package/.output/server/node_modules/oracledb/lib/sodaDatabase.js +176 -0
  449. package/.output/server/node_modules/oracledb/lib/sodaDocCursor.js +82 -0
  450. package/.output/server/node_modules/oracledb/lib/sodaDocument.js +125 -0
  451. package/.output/server/node_modules/oracledb/lib/sodaOperation.js +236 -0
  452. package/.output/server/node_modules/oracledb/lib/thin/aq.js +475 -0
  453. package/.output/server/node_modules/oracledb/lib/thin/connection.js +1504 -0
  454. package/.output/server/node_modules/oracledb/lib/thin/dbObject.js +737 -0
  455. package/.output/server/node_modules/oracledb/lib/thin/index.js +40 -0
  456. package/.output/server/node_modules/oracledb/lib/thin/lob.js +380 -0
  457. package/.output/server/node_modules/oracledb/lib/thin/pool.js +738 -0
  458. package/.output/server/node_modules/oracledb/lib/thin/protocol/capabilities.js +145 -0
  459. package/.output/server/node_modules/oracledb/lib/thin/protocol/constants.js +872 -0
  460. package/.output/server/node_modules/oracledb/lib/thin/protocol/encryptDecrypt.js +197 -0
  461. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/aqArray.js +238 -0
  462. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/aqBase.js +305 -0
  463. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/aqDeq.js +164 -0
  464. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/aqEnq.js +135 -0
  465. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/auth.js +376 -0
  466. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/base.js +568 -0
  467. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/commit.js +56 -0
  468. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/dataType.js +401 -0
  469. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/execute.js +358 -0
  470. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/fastAuth.js +83 -0
  471. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/fetch.js +64 -0
  472. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/index.js +59 -0
  473. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/lobOp.js +195 -0
  474. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/logOff.js +52 -0
  475. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/ping.js +56 -0
  476. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/protocol.js +97 -0
  477. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/rollback.js +56 -0
  478. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/sessionRelease.js +60 -0
  479. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/transactionChangeState.js +99 -0
  480. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/transactionSwitch.js +147 -0
  481. package/.output/server/node_modules/oracledb/lib/thin/protocol/messages/withData.js +920 -0
  482. package/.output/server/node_modules/oracledb/lib/thin/protocol/packet.js +631 -0
  483. package/.output/server/node_modules/oracledb/lib/thin/protocol/protocol.js +240 -0
  484. package/.output/server/node_modules/oracledb/lib/thin/protocol/utils.js +82 -0
  485. package/.output/server/node_modules/oracledb/lib/thin/resultSet.js +122 -0
  486. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/ANO.js +438 -0
  487. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/connStrategy.js +316 -0
  488. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/constants.js +210 -0
  489. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/ezConnectResolver.js +466 -0
  490. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/navNodes.js +904 -0
  491. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/networkSession.js +733 -0
  492. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/ntTcp.js +609 -0
  493. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/nvStrToNvPair.js +780 -0
  494. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/packet.js +439 -0
  495. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/paramParser.js +239 -0
  496. package/.output/server/node_modules/oracledb/lib/thin/sqlnet/sessionAtts.js +198 -0
  497. package/.output/server/node_modules/oracledb/lib/thin/statement.js +573 -0
  498. package/.output/server/node_modules/oracledb/lib/thin/statementCache.js +195 -0
  499. package/.output/server/node_modules/oracledb/lib/thin/util.js +254 -0
  500. package/.output/server/node_modules/oracledb/lib/traceHandler.js +133 -0
  501. package/.output/server/node_modules/oracledb/lib/transformer.js +279 -0
  502. package/.output/server/node_modules/oracledb/lib/types.js +592 -0
  503. package/.output/server/node_modules/oracledb/lib/util.js +648 -0
  504. package/.output/server/node_modules/oracledb/lib/version.js +36 -0
  505. package/.output/server/node_modules/oracledb/package.json +48 -0
  506. package/.output/server/node_modules/sql-escaper/lib/index.js +398 -0
  507. package/.output/server/node_modules/sql-escaper/package.json +81 -0
  508. package/.output/server/node_modules/sqlite3/build/Release/node_sqlite3.node +0 -0
  509. package/.output/server/node_modules/ssh2/lib/protocol/crypto/build/Release/sshcrypto.node +0 -0
  510. package/.output/server/package.json +14 -18
  511. package/package.json +2 -2
  512. package/.output/public/_nuxt/019vQzZn.js +0 -1
  513. package/.output/public/_nuxt/0lRW_xjL.js +0 -1
  514. package/.output/public/_nuxt/B6EI6PpE.js +0 -1
  515. package/.output/public/_nuxt/B9Mt45db.js +0 -1
  516. package/.output/public/_nuxt/BKltSiU0.js +0 -1
  517. package/.output/public/_nuxt/BM4vnZvX.js +0 -732
  518. package/.output/public/_nuxt/BNYR501z.js +0 -1
  519. package/.output/public/_nuxt/BVLVn__t.js +0 -9
  520. package/.output/public/_nuxt/BY1l0S_M.js +0 -1
  521. package/.output/public/_nuxt/BaseCodeEditor.SAr2eD8R.css +0 -1
  522. package/.output/public/_nuxt/BcvJQkv0.js +0 -1
  523. package/.output/public/_nuxt/BdN9B2_l.js +0 -160
  524. package/.output/public/_nuxt/BflvengI.js +0 -1
  525. package/.output/public/_nuxt/BgolbRTO.js +0 -1
  526. package/.output/public/_nuxt/BwISH3M4.js +0 -1
  527. package/.output/public/_nuxt/C-M4q4KX.js +0 -1
  528. package/.output/public/_nuxt/C2Ziircr.js +0 -1
  529. package/.output/public/_nuxt/C3NWXcpd.js +0 -39
  530. package/.output/public/_nuxt/C5p44jKD.js +0 -1
  531. package/.output/public/_nuxt/C617vhDd.js +0 -1
  532. package/.output/public/_nuxt/C8S0o4Gy.js +0 -1
  533. package/.output/public/_nuxt/CNlsVoWh.js +0 -1
  534. package/.output/public/_nuxt/CWkPMmwS.js +0 -2
  535. package/.output/public/_nuxt/Cgy4ijjN.js +0 -67
  536. package/.output/public/_nuxt/ClBBUcFW.js +0 -1
  537. package/.output/public/_nuxt/CuRyxljq.js +0 -1
  538. package/.output/public/_nuxt/Cx4Bnfq1.js +0 -2
  539. package/.output/public/_nuxt/D-H6_V16.js +0 -1
  540. package/.output/public/_nuxt/D-SDqguC.js +0 -1
  541. package/.output/public/_nuxt/D-XwprNU.js +0 -6
  542. package/.output/public/_nuxt/D3G5Xy_-.js +0 -1
  543. package/.output/public/_nuxt/D9o5Pdvp.js +0 -1
  544. package/.output/public/_nuxt/DFArp87o.js +0 -1
  545. package/.output/public/_nuxt/DFZIXzfU.js +0 -1
  546. package/.output/public/_nuxt/DHRNt0p9.js +0 -1
  547. package/.output/public/_nuxt/DLKku6fV.js +0 -1
  548. package/.output/public/_nuxt/DWgjNKGq.js +0 -152
  549. package/.output/public/_nuxt/DYm57BZk.js +0 -2
  550. package/.output/public/_nuxt/DaQw8gVp.js +0 -1
  551. package/.output/public/_nuxt/DgnsV5Qb.js +0 -1
  552. package/.output/public/_nuxt/Do5Fyo7J.js +0 -1
  553. package/.output/public/_nuxt/Dqirx7MF.js +0 -1
  554. package/.output/public/_nuxt/GoTwJjoS.js +0 -39
  555. package/.output/public/_nuxt/Hs25HoUO.js +0 -22
  556. package/.output/public/_nuxt/J2CvNR3L.js +0 -1
  557. package/.output/public/_nuxt/LK6Q8l0D.js +0 -1
  558. package/.output/public/_nuxt/Oh9SO2qg.js +0 -1
  559. package/.output/public/_nuxt/P_8UoGnr.js +0 -72
  560. package/.output/public/_nuxt/V5yaR3hv.js +0 -2
  561. package/.output/public/_nuxt/XWTuAj6n.js +0 -1
  562. package/.output/public/_nuxt/XqwbcqcW.js +0 -1
  563. package/.output/public/_nuxt/Yzrsuije.js +0 -1
  564. package/.output/public/_nuxt/_8UrUcVF.js +0 -1
  565. package/.output/public/_nuxt/builds/meta/27a307c3-bfc5-4ccd-94b8-387eb94981bb.json +0 -1
  566. package/.output/public/_nuxt/cKBf5-av.js +0 -1
  567. package/.output/public/_nuxt/entry.DeK5kcSi.css +0 -1
  568. package/.output/public/_nuxt/kc-op4gz.js +0 -12
  569. package/.output/public/_nuxt/kehy-5uo.js +0 -1
  570. package/.output/public/_nuxt/lSaGvORn.js +0 -10
  571. package/.output/public/_nuxt/lY3EyFEK.js +0 -1
  572. package/.output/public/_nuxt/tMhdAKU2.js +0 -3
  573. package/.output/public/_nuxt/uyCIL8xw.js +0 -1
  574. package/.output/server/node_modules/cross-spawn/index.js +0 -39
  575. package/.output/server/node_modules/cross-spawn/lib/enoent.js +0 -59
  576. package/.output/server/node_modules/cross-spawn/lib/parse.js +0 -91
  577. package/.output/server/node_modules/cross-spawn/lib/util/escape.js +0 -47
  578. package/.output/server/node_modules/cross-spawn/lib/util/readShebang.js +0 -23
  579. package/.output/server/node_modules/cross-spawn/lib/util/resolveCommand.js +0 -52
  580. package/.output/server/node_modules/cross-spawn/package.json +0 -73
  581. package/.output/server/node_modules/execa/index.js +0 -268
  582. package/.output/server/node_modules/execa/lib/command.js +0 -52
  583. package/.output/server/node_modules/execa/lib/error.js +0 -88
  584. package/.output/server/node_modules/execa/lib/kill.js +0 -115
  585. package/.output/server/node_modules/execa/lib/promise.js +0 -46
  586. package/.output/server/node_modules/execa/lib/stdio.js +0 -52
  587. package/.output/server/node_modules/execa/lib/stream.js +0 -97
  588. package/.output/server/node_modules/execa/package.json +0 -74
  589. package/.output/server/node_modules/get-stream/buffer-stream.js +0 -52
  590. package/.output/server/node_modules/get-stream/index.js +0 -61
  591. package/.output/server/node_modules/get-stream/package.json +0 -47
  592. package/.output/server/node_modules/human-signals/build/src/core.js +0 -273
  593. package/.output/server/node_modules/human-signals/build/src/main.js +0 -71
  594. package/.output/server/node_modules/human-signals/build/src/realtime.js +0 -19
  595. package/.output/server/node_modules/human-signals/build/src/signals.js +0 -35
  596. package/.output/server/node_modules/human-signals/package.json +0 -64
  597. package/.output/server/node_modules/is-stream/index.js +0 -28
  598. package/.output/server/node_modules/is-stream/package.json +0 -42
  599. package/.output/server/node_modules/isexe/index.js +0 -57
  600. package/.output/server/node_modules/isexe/mode.js +0 -41
  601. package/.output/server/node_modules/isexe/package.json +0 -31
  602. package/.output/server/node_modules/isexe/windows.js +0 -42
  603. package/.output/server/node_modules/merge-stream/index.js +0 -41
  604. package/.output/server/node_modules/merge-stream/package.json +0 -19
  605. package/.output/server/node_modules/mimic-fn/index.js +0 -13
  606. package/.output/server/node_modules/mimic-fn/package.json +0 -42
  607. package/.output/server/node_modules/npm-run-path/index.js +0 -47
  608. package/.output/server/node_modules/npm-run-path/package.json +0 -44
  609. package/.output/server/node_modules/onetime/index.js +0 -44
  610. package/.output/server/node_modules/onetime/package.json +0 -43
  611. package/.output/server/node_modules/path-key/index.js +0 -16
  612. package/.output/server/node_modules/path-key/package.json +0 -39
  613. package/.output/server/node_modules/pg-dump-restore/lib/common.js +0 -33
  614. package/.output/server/node_modules/pg-dump-restore/lib/index.js +0 -9
  615. package/.output/server/node_modules/pg-dump-restore/lib/pg-dump.js +0 -95
  616. package/.output/server/node_modules/pg-dump-restore/lib/pg-restore.js +0 -87
  617. package/.output/server/node_modules/pg-dump-restore/package.json +0 -66
  618. package/.output/server/node_modules/shebang-command/index.js +0 -19
  619. package/.output/server/node_modules/shebang-command/package.json +0 -34
  620. package/.output/server/node_modules/shebang-regex/index.js +0 -2
  621. package/.output/server/node_modules/shebang-regex/package.json +0 -35
  622. package/.output/server/node_modules/signal-exit/index.js +0 -202
  623. package/.output/server/node_modules/signal-exit/package.json +0 -38
  624. package/.output/server/node_modules/signal-exit/signals.js +0 -53
  625. package/.output/server/node_modules/strip-final-newline/index.js +0 -16
  626. package/.output/server/node_modules/strip-final-newline/package.json +0 -40
  627. package/.output/server/node_modules/which/package.json +0 -43
  628. package/.output/server/node_modules/which/which.js +0 -125
@@ -0,0 +1,1842 @@
1
+ // Copyright (c) 2016, 2025, Oracle and/or its affiliates.
2
+
3
+ //-----------------------------------------------------------------------------
4
+ //
5
+ // This software is dual-licensed to you under the Universal Permissive License
6
+ // (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
7
+ // 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
8
+ // either license.
9
+ //
10
+ // If you elect to accept the software under the Apache License, Version 2.0,
11
+ // the following applies:
12
+ //
13
+ // Licensed under the Apache License, Version 2.0 (the "License");
14
+ // you may not use this file except in compliance with the License.
15
+ // You may obtain a copy of the License at
16
+ //
17
+ // https://www.apache.org/licenses/LICENSE-2.0
18
+ //
19
+ // Unless required by applicable law or agreed to in writing, software
20
+ // distributed under the License is distributed on an "AS IS" BASIS,
21
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ // See the License for the specific language governing permissions and
23
+ // limitations under the License.
24
+ //
25
+ //-----------------------------------------------------------------------------
26
+
27
+ 'use strict';
28
+
29
+ const AqQueue = require('./aqQueue.js');
30
+ const BaseDbObject = require('./dbObject.js');
31
+ const { Buffer } = require('buffer');
32
+ const Lob = require('./lob.js');
33
+ const ResultSet = require('./resultset.js');
34
+ const SodaDatabase = require('./sodaDatabase.js');
35
+ const EventEmitter = require('events');
36
+ const QueryStream = require('./queryStream.js');
37
+ const errors = require('./errors.js');
38
+ const nodbUtil = require('./util.js');
39
+ const impl = require('./impl');
40
+ const process = require('process');
41
+ const util = require('util');
42
+ const constants = require('./constants.js');
43
+ const settings = require('./settings.js');
44
+ const transformer = require('./transformer.js');
45
+ const types = require('./types.js');
46
+ const oson = require('./impl/datahandlers/oson.js');
47
+
48
+ // global mapping of subscriptions; these cannot be tied to a particular
49
+ // connection or pool since subscriptions can be created with one connection
50
+ // and destroyed with another!
51
+ const _subscriptions = new Map();
52
+
53
+ // default closure for NUMBER type.
54
+ const defaultNumberConverter = (v) => (v === null) ? null : parseFloat(v);
55
+
56
+ //---------------------------------------------------------------------------
57
+ // _determineDbObjTypeConverter()
58
+ //
59
+ // Determines the converter associated with each DB type and its metadata.
60
+ // This function is called once during metadata construction and the
61
+ // converters are invoked when retriving DBObject values.
62
+ //---------------------------------------------------------------------------
63
+ function _determineDbObjTypeConverter(metadata, options) {
64
+ // clear any previous converter functions that may have been
65
+ // retained
66
+ delete metadata.converter;
67
+
68
+ // If a DBfetch type handler is specified, update converter,
69
+ // if available.
70
+ if (options.dbObjectTypeHandler) {
71
+ const result = options.dbObjectTypeHandler(metadata);
72
+ if (result !== undefined) {
73
+ errors.assert(typeof result === 'object',
74
+ errors.ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE);
75
+ if (result.converter !== undefined) {
76
+ errors.assert(typeof result.converter === 'function',
77
+ errors.ERR_DB_FETCH_TYPE_HANDLER_CONVERTER);
78
+ }
79
+ if ([types.DB_TYPE_CLOB, types.DB_TYPE_NCLOB, types.DB_TYPE_BLOB,
80
+ types.DB_TYPE_BFILE].includes(metadata.type)) {
81
+ // converters for LOB's are not supported.
82
+ return errors.throwErr(errors.ERR_NOT_IMPLEMENTED,
83
+ 'DbObjConverter for LOBs');
84
+ }
85
+ metadata.converter = result.converter;
86
+ }
87
+ }
88
+ if (metadata.type === types.DB_TYPE_NUMBER && !metadata.converter) {
89
+ // set default converter for NUMBER type as they are returned as strings
90
+ // from DB.
91
+ metadata.converter = defaultNumberConverter;
92
+ }
93
+ }
94
+
95
+ // define class
96
+ class Connection extends EventEmitter {
97
+
98
+ constructor() {
99
+ super();
100
+ this._dbObjectClasses = new Map();
101
+ this._closing = false;
102
+ }
103
+
104
+ //---------------------------------------------------------------------------
105
+ // _addDefaultsToExecOpts()
106
+ //
107
+ // Add values to the execute options from the global settings, if needed.
108
+ //---------------------------------------------------------------------------
109
+ _addDefaultsToExecOpts(options) {
110
+ options.connection = this;
111
+ if (options.keepInStmtCache === undefined)
112
+ options.keepInStmtCache = true;
113
+ if (options.suspendOnSuccess === undefined)
114
+ options.suspendOnSuccess = false;
115
+ settings.addToOptions(options,
116
+ "autoCommit",
117
+ "dbObjectAsPojo",
118
+ "fetchArraySize",
119
+ "fetchTypeHandler",
120
+ "maxRows",
121
+ "outFormat",
122
+ "prefetchRows");
123
+ }
124
+
125
+ //---------------------------------------------------------------------------
126
+ // _buildDbObjectClass()
127
+ //
128
+ // Builds and returns a database object class given the object type
129
+ // information supplied by the implementation.
130
+ //---------------------------------------------------------------------------
131
+ _buildDbObjectClass(objType) {
132
+ const DbObject = function(initialValue) {
133
+ this._impl = new impl.DbObjectImpl(objType);
134
+ if (this.isCollection) {
135
+ const proxy = new Proxy(this, BaseDbObject._collectionProxyHandler);
136
+ if (initialValue !== undefined) {
137
+ for (let i = 0; i < initialValue.length; i++) {
138
+ this.append(initialValue[i]);
139
+ }
140
+ }
141
+ return (proxy);
142
+ } else if (initialValue !== undefined) {
143
+ for (const attr of objType.attributes) {
144
+ const value = initialValue[attr.name];
145
+ if (value !== undefined) {
146
+ this._setAttrValue(attr, value);
147
+ }
148
+ }
149
+ }
150
+ };
151
+ DbObject.prototype = Object.create(BaseDbObject.prototype);
152
+ DbObject.prototype.constructor = DbObject;
153
+ DbObject.prototype._objType = objType;
154
+ if (objType.elementTypeClass) {
155
+ const cls = this._getDbObjectClass(objType.elementTypeClass);
156
+ objType.elementTypeClass = cls;
157
+ }
158
+ const options = {dbObjectTypeHandler: settings.dbObjectTypeHandler};
159
+ if (objType.isCollection) {
160
+ nodbUtil.addTypeProperties(objType, "elementType");
161
+ objType.elementTypeInfo.type = objType.elementType;
162
+ _determineDbObjTypeConverter(objType.elementTypeInfo, options);
163
+ }
164
+ if (objType.attributes) {
165
+ const props = {};
166
+ for (const attr of objType.attributes) {
167
+ if (attr.typeClass) {
168
+ attr.typeClass = this._getDbObjectClass(attr.typeClass);
169
+ }
170
+ nodbUtil.addTypeProperties(attr, "type");
171
+ const prop = {
172
+ get() {
173
+ return this._getAttrValue(attr);
174
+ },
175
+ set(value) {
176
+ this._setAttrValue(attr, value);
177
+ }
178
+ };
179
+ props[attr.name] = prop;
180
+
181
+ // calculate for each attribute metadata as converters might change
182
+ // based on precision, scale, maxSize,..
183
+ _determineDbObjTypeConverter(attr, options);
184
+ }
185
+ Object.defineProperties(DbObject.prototype, props);
186
+ }
187
+ DbObject.toString = function() {
188
+ return ('DbObjectClass [' + objType.fqn + ']');
189
+ };
190
+ return (DbObject);
191
+ }
192
+
193
+ //---------------------------------------------------------------------------
194
+ // _getDbObjectClass()
195
+ //
196
+ // Returns the database object class given the object type information
197
+ // supplied by the implementation. The cache is searched first to see if an
198
+ // object class has already been built.
199
+ //---------------------------------------------------------------------------
200
+ _getDbObjectClass(objType) {
201
+ if (objType.prototype instanceof BaseDbObject)
202
+ return objType;
203
+ let cls = this._dbObjectClasses.get(objType);
204
+ if (!cls) {
205
+ cls = this._buildDbObjectClass(objType);
206
+ cls._connection = this;
207
+ cls._objType = objType;
208
+ objType._connection = this._impl;
209
+ this._dbObjectClasses.set(objType, cls);
210
+ }
211
+ return (cls);
212
+ }
213
+
214
+ //---------------------------------------------------------------------------
215
+ // _getDbObjectClassForName()
216
+ //
217
+ // Returns the database object class given the name of the database object
218
+ // type. The cache is searched first to see if an object class has already
219
+ // been built.
220
+ //---------------------------------------------------------------------------
221
+ async _getDbObjectClassForName(name) {
222
+ let cls = this._dbObjectClasses.get(name);
223
+ if (!cls) {
224
+ const objType = await this._impl.getDbObjectClass(name);
225
+ cls = this._getDbObjectClass(objType);
226
+ this._dbObjectClasses.set(name, cls);
227
+ }
228
+ return cls;
229
+ }
230
+
231
+ //---------------------------------------------------------------------------
232
+ // _isBindDir()
233
+ //
234
+ // Returns a boolean indicating if the supplied value is a valid bind
235
+ // direction.
236
+ //---------------------------------------------------------------------------
237
+ _isBindDir(value) {
238
+ return (
239
+ value === constants.BIND_IN ||
240
+ value === constants.BIND_OUT ||
241
+ value === constants.BIND_INOUT
242
+ );
243
+ }
244
+
245
+ //---------------------------------------------------------------------------
246
+ // _isBindValue()
247
+ //
248
+ // Returns a boolean indicating if the supplied value is one that can be
249
+ // bound.
250
+ //---------------------------------------------------------------------------
251
+ _isBindValue(value) {
252
+ return (
253
+ value === null ||
254
+ value === undefined ||
255
+ typeof value === 'number' ||
256
+ typeof value === 'string' ||
257
+ typeof value === 'boolean' ||
258
+ typeof value === 'bigint' ||
259
+ Array.isArray(value) ||
260
+ nodbUtil.isVectorValue(value) ||
261
+ Buffer.isBuffer(value) ||
262
+ util.types.isDate(value) ||
263
+ value instanceof Lob ||
264
+ value instanceof ResultSet ||
265
+ value instanceof BaseDbObject
266
+ );
267
+ }
268
+
269
+ //---------------------------------------------------------------------------
270
+ // _processBindUnit()
271
+ //
272
+ // Processes a bind unit (object) supplied by the user and returns the value
273
+ // stored in it (if one is).
274
+ //---------------------------------------------------------------------------
275
+ async _processBindUnit(bindInfo, bindUnit, inExecuteMany) {
276
+ let okBindUnit = false;
277
+
278
+ // get and validate bind direction; if not specified, IN is assumed
279
+ if (bindUnit.dir === undefined) {
280
+ bindInfo.dir = constants.BIND_IN;
281
+ } else {
282
+ errors.assert(this._isBindDir(bindUnit.dir),
283
+ errors.ERR_INVALID_BIND_DIRECTION);
284
+ bindInfo.dir = bindUnit.dir;
285
+ okBindUnit = true;
286
+ }
287
+
288
+ // get and validate bind type; it must be one of the integer constants
289
+ // identifying types, a string identifying an object type or a constructor
290
+ // function identifying an object type
291
+ if (bindUnit.type !== undefined) {
292
+ if (typeof bindUnit.type === 'string') {
293
+ bindInfo.type = types.DB_TYPE_OBJECT;
294
+ bindInfo.typeClass = await this._getDbObjectClassForName(bindUnit.type);
295
+ bindInfo.objType = bindInfo.typeClass._objType;
296
+ } else if (bindUnit.type.prototype instanceof BaseDbObject) {
297
+ bindInfo.type = types.DB_TYPE_OBJECT;
298
+ bindInfo.typeClass = bindUnit.type;
299
+ bindInfo.objType = bindInfo.typeClass._objType;
300
+ } else {
301
+ errors.assert(bindUnit.type instanceof types.DbType,
302
+ errors.ERR_INVALID_BIND_DATA_TYPE, 2);
303
+ bindInfo.type = bindUnit.type;
304
+ }
305
+ okBindUnit = true;
306
+
307
+ // when calling executeMany(), bind type is mandatory
308
+ } else if (inExecuteMany) {
309
+ if (bindInfo.name)
310
+ errors.throwErr(errors.ERR_MISSING_TYPE_BY_NAME, bindInfo.name);
311
+ errors.throwErr(errors.ERR_MISSING_TYPE_BY_POS, bindInfo.pos);
312
+ }
313
+
314
+ // get and validate the maximum size for strings/buffers; this value is
315
+ // used for IN/OUT and OUT binds in execute() and at all times for
316
+ // executeMany()
317
+ if (bindInfo.dir !== constants.BIND_IN || inExecuteMany) {
318
+ if (bindUnit.maxSize !== undefined) {
319
+ errors.assertParamPropValue(Number.isInteger(bindUnit.maxSize) &&
320
+ bindUnit.maxSize > 0, 2, "maxSize");
321
+ bindInfo.maxSize = bindUnit.maxSize;
322
+ bindInfo.checkSize = true;
323
+ okBindUnit = true;
324
+ } else if (inExecuteMany) {
325
+ if (bindInfo.type === types.DB_TYPE_VARCHAR ||
326
+ bindInfo.type === types.DB_TYPE_RAW) {
327
+ if (bindInfo.name)
328
+ errors.throwErr(errors.ERR_MISSING_MAX_SIZE_BY_NAME, bindInfo.name);
329
+ errors.throwErr(errors.ERR_MISSING_MAX_SIZE_BY_POS, bindInfo.pos);
330
+ }
331
+ } else {
332
+ bindInfo.maxSize = constants.DEFAULT_MAX_SIZE_FOR_OUT_BINDS;
333
+ }
334
+ }
335
+
336
+ // get max array size (for array binds, not possible in executeMany())
337
+ bindInfo.isArray = false;
338
+ if (!inExecuteMany) {
339
+ if (bindUnit.maxArraySize !== undefined) {
340
+ errors.assertParamPropValue(Number.isInteger(bindUnit.maxArraySize) &&
341
+ bindUnit.maxArraySize > 0, 2, "maxArraySize");
342
+ bindInfo.maxArraySize = bindUnit.maxArraySize;
343
+ bindInfo.isArray = true;
344
+ }
345
+ }
346
+
347
+ // get the value, if specified (not used in executeMany())
348
+ if (!inExecuteMany && bindUnit.val !== undefined) {
349
+ return bindUnit.val;
350
+ }
351
+
352
+ if (!okBindUnit)
353
+ errors.throwErr(errors.ERR_INVALID_BIND_UNIT);
354
+ }
355
+
356
+ //---------------------------------------------------------------------------
357
+ // _processBindValue()
358
+ //
359
+ // Processes the bind value supplied by the caller. This performs all checks
360
+ // on the value and normalizes it for use by the implementation class. If no
361
+ // bind info has been defined yet, the value defines that.
362
+ //---------------------------------------------------------------------------
363
+ async _processBindValue(bindInfo, value, options) {
364
+ const transformed = transformer.transformValueIn(bindInfo, value, options);
365
+ if (bindInfo.isArray) {
366
+ bindInfo.values = transformed.concat(bindInfo.values.slice(transformed.length));
367
+ } else {
368
+ bindInfo.values[options.pos] = transformed;
369
+ }
370
+ if (bindInfo.type === types.DB_TYPE_OBJECT &&
371
+ bindInfo.typeClass === undefined) {
372
+ bindInfo.typeClass = await this._getDbObjectClass(value._objType);
373
+ bindInfo.objType = bindInfo.typeClass._objType;
374
+ }
375
+ }
376
+
377
+ //---------------------------------------------------------------------------
378
+ // _processExecuteBind()
379
+ //
380
+ // Processes a single execute bind supplied by the caller. This performs all
381
+ // checks on the bind and normalizes it for use by the implementation class.
382
+ //---------------------------------------------------------------------------
383
+ async _processExecuteBind(bindInfo, bindData) {
384
+
385
+ // setup defaults
386
+ bindInfo.isArray = false;
387
+
388
+ // if bind data is a value that can be bound directly, use it; otherwise,
389
+ // scan the bind unit for bind information and its value
390
+ let bindValue;
391
+ if (this._isBindValue(bindData)) {
392
+ bindInfo.dir = constants.BIND_IN;
393
+ bindValue = bindData;
394
+ } else {
395
+ bindValue = await this._processBindUnit(bindInfo, bindData, false);
396
+ }
397
+
398
+ // for IN and IN/OUT binds, process the value
399
+ if (bindInfo.dir !== constants.BIND_OUT) {
400
+ const options = {pos: 0, allowArray: true};
401
+ await this._processBindValue(bindInfo, bindValue, options);
402
+ }
403
+
404
+ // if only null values were found (or an OUT bind was specified), type
405
+ // information may not be set, so complete bind information as a string
406
+ // and set the maxSize to 1 if it has not already been set
407
+ if (bindInfo.type === undefined) {
408
+ bindInfo.type = types.DB_TYPE_VARCHAR;
409
+ if (bindInfo.maxSize === undefined)
410
+ bindInfo.maxSize = 1;
411
+ }
412
+
413
+ // check valid bind type for array binds
414
+ if (bindInfo.isArray &&
415
+ bindInfo.type !== types.DB_TYPE_VARCHAR &&
416
+ bindInfo.type !== types.DB_TYPE_NVARCHAR &&
417
+ bindInfo.type !== types.DB_TYPE_CHAR &&
418
+ bindInfo.type !== types.DB_TYPE_NCHAR &&
419
+ bindInfo.type !== types.DB_TYPE_NUMBER &&
420
+ bindInfo.type !== types.DB_TYPE_BINARY_FLOAT &&
421
+ bindInfo.type !== types.DB_TYPE_BINARY_DOUBLE &&
422
+ bindInfo.type !== types.DB_TYPE_DATE &&
423
+ bindInfo.type !== types.DB_TYPE_TIMESTAMP &&
424
+ bindInfo.type !== types.DB_TYPE_TIMESTAMP_LTZ &&
425
+ bindInfo.type !== types.DB_TYPE_TIMESTAMP_TZ &&
426
+ bindInfo.type !== types.DB_TYPE_RAW &&
427
+ bindInfo.type !== types.DB_TYPE_INTERVAL_YM &&
428
+ bindInfo.type !== types.DB_TYPE_INTERVAL_DS) {
429
+ errors.throwErr(errors.ERR_INVALID_TYPE_FOR_ARRAY_BIND);
430
+ }
431
+
432
+ }
433
+
434
+ //---------------------------------------------------------------------------
435
+ // _processExecuteBinds()
436
+ //
437
+ // Processes the binds supplied by the caller. This performs all checks on
438
+ // the binds and normalizes them for use by the implementation class.
439
+ //---------------------------------------------------------------------------
440
+ async _processExecuteBinds(binds) {
441
+ const normBinds = [];
442
+ if (Array.isArray(binds)) {
443
+ for (let i = 0; i < binds.length; i++) {
444
+ const bindInfo = normBinds[i] = {pos: i + 1, values: []};
445
+ await this._processExecuteBind(bindInfo, binds[i]);
446
+ }
447
+ } else {
448
+ errors.assertParamValue(nodbUtil.isObject(binds), 2);
449
+ const bindNames = Object.getOwnPropertyNames(binds);
450
+ for (let i = 0; i < bindNames.length; i++) {
451
+ const bindInfo = normBinds[i] = {name: bindNames[i], values: []};
452
+ await this._processExecuteBind(bindInfo, binds[bindNames[i]]);
453
+ }
454
+ }
455
+ return normBinds;
456
+ }
457
+
458
+ //---------------------------------------------------------------------------
459
+ // _processExecuteManyBinds()
460
+ //
461
+ // Processes the binds supplied by the caller. This performs all checks on
462
+ // the binds and normalizes them for use by the implementation class.
463
+ //---------------------------------------------------------------------------
464
+ async _processExecuteManyBinds(binds, bindDefs) {
465
+ const normBinds = [];
466
+ let byPosition;
467
+
468
+ // transform bindDefs into normalized binds, if available
469
+ if (bindDefs !== undefined) {
470
+ if (Array.isArray(bindDefs)) {
471
+ byPosition = true;
472
+ for (let i = 0; i < bindDefs.length; i++) {
473
+ const bindInfo = normBinds[i] = {pos: i + 1, values: []};
474
+ await this._processBindUnit(bindInfo, bindDefs[i], true);
475
+ }
476
+ } else {
477
+ byPosition = false;
478
+ const bindNames = Object.getOwnPropertyNames(bindDefs);
479
+ for (let i = 0; i < bindNames.length; i++) {
480
+ const bindInfo = normBinds[i] = {name: bindNames[i], values: []};
481
+ await this._processBindUnit(bindInfo, bindDefs[bindNames[i]], true);
482
+ }
483
+ }
484
+
485
+ // otherwise, use the first row to determine the binds to use
486
+ } else {
487
+ const row = binds[0];
488
+ errors.assertParamValue(nodbUtil.isObjectOrArray(row), 2);
489
+ if (Array.isArray(row)) {
490
+ byPosition = true;
491
+ for (let i = 0; i < row.length; i++) {
492
+ normBinds[i] = {pos: i + 1};
493
+ }
494
+ } else {
495
+ byPosition = false;
496
+ const bindNames = Object.getOwnPropertyNames(row);
497
+ for (let i = 0; i < bindNames.length; i++) {
498
+ normBinds[i] = {name: bindNames[i]};
499
+ }
500
+ }
501
+ for (let i = 0; i < normBinds.length; i++) {
502
+ normBinds[i].dir = constants.BIND_IN;
503
+ normBinds[i].isArray = false;
504
+ normBinds[i].values = [];
505
+ }
506
+ }
507
+
508
+ // process each of the rows
509
+ for (let i = 0; i < binds.length; i++) {
510
+ const row = binds[i];
511
+ const options = {pos: i, allowArray: false};
512
+ errors.assert((byPosition && Array.isArray(row)) ||
513
+ (!byPosition && nodbUtil.isObject(row)), errors.ERR_MIXED_BIND);
514
+ for (let j = 0; j < normBinds.length; j++) {
515
+ const bindInfo = normBinds[j];
516
+ const value = (byPosition) ? row[j] : row[bindInfo.name];
517
+ await this._processBindValue(bindInfo, value, options);
518
+ }
519
+ }
520
+
521
+ // set bind type and size to a string of size 1 if no bind type was
522
+ // specified (and all values are null)
523
+ for (let i = 0; i < normBinds.length; i++) {
524
+ const bindInfo = normBinds[i];
525
+ if (bindInfo.type === undefined) {
526
+ bindInfo.type = types.DB_TYPE_VARCHAR;
527
+ bindInfo.maxSize = 1;
528
+ }
529
+ }
530
+
531
+ return normBinds;
532
+ }
533
+
534
+ //---------------------------------------------------------------------------
535
+ // _transformOutBind()
536
+ //
537
+ // Transform an output bind value from an implementation value to a user
538
+ // facing value (for result sets and LOBs). DML returning output variables
539
+ // are always an array of values.
540
+ //---------------------------------------------------------------------------
541
+ _transformOutBind(val, options) {
542
+ let outVal = val;
543
+ if (Array.isArray(val)) {
544
+ outVal = [];
545
+ for (let i = 0; i < val.length; i++)
546
+ outVal.push(this._transformOutBind(val[i], options));
547
+ } else if (val instanceof impl.ResultSetImpl) {
548
+ outVal = new ResultSet();
549
+ outVal._setup(this, val);
550
+ } else if (val instanceof impl.LobImpl) {
551
+ outVal = new Lob();
552
+ outVal._setup(val, true);
553
+ } else if (val instanceof impl.DbObjectImpl) {
554
+ const cls = this._dbObjectClasses.get(val._objType);
555
+ outVal = Object.create(cls.prototype);
556
+ outVal._impl = val;
557
+ if (options.dbObjectAsPojo) {
558
+ outVal = outVal._toPojo();
559
+ } else if (outVal.isCollection) {
560
+ outVal = new Proxy(outVal, BaseDbObject._collectionProxyHandler);
561
+ }
562
+ }
563
+ return outVal;
564
+ }
565
+
566
+ //---------------------------------------------------------------------------
567
+ // _verifyExecOpts
568
+ //
569
+ // Verify that the value passed by the user for binds is acceptable. Perform
570
+ // any transformations necessary.
571
+ //---------------------------------------------------------------------------
572
+ _verifyExecOpts(options, inExecuteMany) {
573
+
574
+ // define normalized options (value returned to caller)
575
+ const outOptions = {};
576
+
577
+ // handle common options
578
+ errors.assertParamValue(nodbUtil.isObject(options), 3);
579
+
580
+ // autoCommit must be a boolean value
581
+ if (options.autoCommit !== undefined) {
582
+ errors.assertParamPropValue(typeof options.autoCommit === 'boolean', 3,
583
+ "autoCommit");
584
+ outOptions.autoCommit = options.autoCommit;
585
+ }
586
+
587
+ // dbObjectAsPojo must be a boolean value
588
+ if (options.dbObjectAsPojo !== undefined) {
589
+ errors.assertParamPropValue(typeof options.dbObjectAsPojo === 'boolean',
590
+ 3, "dbObjectAsPojo");
591
+ outOptions.dbObjectAsPojo = options.dbObjectAsPojo;
592
+ }
593
+
594
+ // keepInStmtCache must be a boolean value
595
+ if (options.keepInStmtCache !== undefined) {
596
+ errors.assertParamPropValue(typeof options.keepInStmtCache === 'boolean',
597
+ 3, "keepInStmtCache");
598
+ outOptions.keepInStmtCache = options.keepInStmtCache;
599
+ }
600
+
601
+ if (options.suspendOnSuccess !== undefined) {
602
+ errors.assertParamPropBool(options, 2, "suspendOnSucess");
603
+ outOptions.suspendOnSuccess = options.suspendOnSuccess;
604
+ }
605
+
606
+ // handle options specific to executeMany()
607
+ if (inExecuteMany) {
608
+
609
+ // bindDefs must be an object or array
610
+ if (options.bindDefs !== undefined) {
611
+ errors.assertParamPropValue(nodbUtil.isObjectOrArray(options.bindDefs),
612
+ 3, "bindDefs");
613
+ outOptions.bindDefs = options.bindDefs;
614
+ }
615
+
616
+ // batchErrors must be a boolean value
617
+ if (options.batchErrors !== undefined) {
618
+ errors.assertParamPropValue(typeof options.batchErrors === 'boolean',
619
+ 3, "batchErrors");
620
+ outOptions.batchErrors = options.batchErrors;
621
+ }
622
+
623
+ // dmlRowCounts must be a boolean value
624
+ if (options.dmlRowCounts !== undefined) {
625
+ errors.assertParamPropValue(typeof options.dmlRowCounts === 'boolean',
626
+ 3, "dmlRowCounts");
627
+ outOptions.dmlRowCounts = options.dmlRowCounts;
628
+ }
629
+
630
+ // handle options specific to execute()
631
+ } else {
632
+
633
+ // fetchArraySize must be a positive integer
634
+ errors.assertParamPropUnsignedIntNonZero(options, 3, "fetchArraySize");
635
+ outOptions.fetchArraySize = options.fetchArraySize;
636
+
637
+ // fetchInfo must be an object with keys containing an object with a
638
+ // "type" property; these are converted to an array of objects for ease
639
+ // of processing by the implementation
640
+ if (options.fetchInfo !== undefined) {
641
+ errors.assertParamPropValue(nodbUtil.isObject(options.fetchInfo), 3,
642
+ "fetchInfo");
643
+ const names = Object.getOwnPropertyNames(options.fetchInfo);
644
+ const map = new Map(settings.fetchTypeMap);
645
+ for (const name of names) {
646
+ const info = options.fetchInfo[name];
647
+ if (info.type === undefined)
648
+ errors.throwErr(errors.ERR_NO_TYPE_FOR_CONVERSION);
649
+ if (info.type !== constants.DEFAULT &&
650
+ info.type !== types.DB_TYPE_VARCHAR &&
651
+ info.type !== types.DB_TYPE_RAW) {
652
+ errors.throwErr(errors.ERR_INVALID_TYPE_FOR_CONVERSION);
653
+ }
654
+ map.set(name, info.type);
655
+ }
656
+ outOptions.fetchTypeMap = map;
657
+ }
658
+
659
+ // fetchTypeHandler must be a function which is called for each column to
660
+ // be fetched and accepts the metadata for a column
661
+ if (options.fetchTypeHandler !== undefined) {
662
+ const type = (typeof options.fetchTypeHandler);
663
+ errors.assertParamPropValue(type === 'function', 3, "fetchTypeHandler");
664
+ outOptions.fetchTypeHandler = options.fetchTypeHandler;
665
+ }
666
+
667
+ // maxRows must be a positive integer (or 0)
668
+ if (options.maxRows !== undefined) {
669
+ errors.assertParamPropValue(Number.isInteger(options.maxRows) &&
670
+ options.maxRows >= 0, 3, "maxRows");
671
+ outOptions.maxRows = options.maxRows;
672
+ }
673
+
674
+ // outFormat must be one of the two possible constants
675
+ if (options.outFormat !== undefined) {
676
+ errors.assertParamPropValue(
677
+ options.outFormat === constants.OUT_FORMAT_ARRAY ||
678
+ options.outFormat === constants.OUT_FORMAT_OBJECT, 3, "outFormat");
679
+ outOptions.outFormat = options.outFormat;
680
+ }
681
+
682
+ // prefetchRows must be a positive integer (or 0)
683
+ if (options.prefetchRows !== undefined) {
684
+ errors.assertParamPropValue(Number.isInteger(options.prefetchRows) &&
685
+ options.prefetchRows >= 0, 3, "prefetchRows");
686
+ outOptions.prefetchRows = options.prefetchRows;
687
+ }
688
+
689
+ // resultSet must be a boolean value
690
+ if (options.resultSet !== undefined) {
691
+ errors.assertParamPropValue(typeof options.resultSet === 'boolean', 3,
692
+ "resultSet");
693
+ outOptions.resultSet = options.resultSet;
694
+ }
695
+
696
+ }
697
+
698
+ return outOptions;
699
+ }
700
+
701
+ //---------------------------------------------------------------------------
702
+ // action
703
+ //
704
+ // Property for end-to-end tracing attribute.
705
+ //---------------------------------------------------------------------------
706
+ get action() {
707
+ return null;
708
+ }
709
+
710
+ set action(value) {
711
+ errors.assertPropValue(typeof value === 'string', "action");
712
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
713
+ this._impl.setAction(value);
714
+ }
715
+
716
+ //---------------------------------------------------------------------------
717
+ // beginSessionlessTransaction()
718
+ //
719
+ // Begin a new sessionless transaction with provided transactionId.
720
+ // If transactionId wasn't provided a random-generated transactionId will be
721
+ // used and returned.
722
+ //---------------------------------------------------------------------------
723
+ async beginSessionlessTransaction(options = {}) {
724
+ errors.assertArgCount(arguments, 0, 1);
725
+ errors.assertParamValue(nodbUtil.isObject(options), 1);
726
+ if (options.transactionId !== undefined)
727
+ errors.assertParamPropValue(
728
+ nodbUtil.isTransactionId(options.transactionId), 1, 'transactionId');
729
+ errors.assertParamPropUnsignedIntNonZero(options, 1, 'timeout');
730
+ errors.assertParamPropBool(options, 1, 'deferRoundTrip');
731
+ const normalizedTransactionId =
732
+ nodbUtil.normalizeTransactionId(options.transactionId);
733
+ const {timeout = 60, deferRoundTrip = false} = options;
734
+ await this._impl.startSessionlessTransaction(normalizedTransactionId,
735
+ timeout, constants.TPC_BEGIN_NEW, deferRoundTrip);
736
+ return normalizedTransactionId;
737
+ }
738
+
739
+ //---------------------------------------------------------------------------
740
+ // breakExecution()
741
+ //
742
+ // Breaks execution of a running statement.
743
+ //---------------------------------------------------------------------------
744
+ async breakExecution() {
745
+ errors.assertArgCount(arguments, 0, 0);
746
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
747
+ await this._impl.breakExecution();
748
+ }
749
+
750
+ //---------------------------------------------------------------------------
751
+ // callTimeout
752
+ //
753
+ // Property for round-trip timeouts.
754
+ //---------------------------------------------------------------------------
755
+ get callTimeout() {
756
+ if (this._impl)
757
+ return this._impl.getCallTimeout();
758
+ return undefined;
759
+ }
760
+
761
+ set callTimeout(value) {
762
+ errors.assertPropValue(Number.isInteger(value) && value >= 0,
763
+ "callTimeout");
764
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
765
+ this._impl.setCallTimeout(value);
766
+ }
767
+
768
+ //---------------------------------------------------------------------------
769
+ // changePassword()
770
+ //
771
+ // Changes the password of the specified user.
772
+ //---------------------------------------------------------------------------
773
+ async changePassword(user, password, newPassword) {
774
+ errors.assertArgCount(arguments, 3, 3);
775
+ errors.assertParamValue(typeof user === 'string', 1);
776
+ errors.assertParamValue(typeof password === 'string', 2);
777
+ errors.assertParamValue(typeof newPassword === 'string', 3);
778
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
779
+ await this._impl.changePassword(user, password, newPassword);
780
+ }
781
+
782
+ //---------------------------------------------------------------------------
783
+ // clientId
784
+ //
785
+ // Property for end-to-end tracing attribute.
786
+ //---------------------------------------------------------------------------
787
+ get clientId() {
788
+ return null;
789
+ }
790
+
791
+ set clientId(value) {
792
+ errors.assertPropValue(typeof value === 'string', "clientId");
793
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
794
+ this._impl.setClientId(value);
795
+ }
796
+
797
+ //---------------------------------------------------------------------------
798
+ // clientInfo
799
+ //
800
+ // Property for end-to-end tracing attribute.
801
+ //---------------------------------------------------------------------------
802
+ get clientInfo() {
803
+ return null;
804
+ }
805
+
806
+ set clientInfo(value) {
807
+ errors.assertPropValue(typeof value === 'string', "clientInfo");
808
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
809
+ this._impl.setClientInfo(value);
810
+ }
811
+
812
+ //---------------------------------------------------------------------------
813
+ // close()
814
+ //
815
+ // Closes the connection and makes it unusable for further work.
816
+ //---------------------------------------------------------------------------
817
+ async close(a1) {
818
+ let options = {};
819
+
820
+ errors.assertArgCount(arguments, 0, 1);
821
+ if (arguments.length == 1) {
822
+ errors.assertParamValue(nodbUtil.isObject(a1), 1);
823
+ options = a1;
824
+ errors.assertParamPropBool(options, 1, "drop");
825
+ }
826
+ errors.assert(this._impl && !this._closing, errors.ERR_INVALID_CONNECTION);
827
+
828
+ this._closing = true;
829
+ try {
830
+ // If connection is part of a pool, notify the pool of its availability
831
+ if (this._pool) {
832
+ await this._pool._release(this._impl, options);
833
+ } else {
834
+ await this._impl.close(options);
835
+ }
836
+ } finally {
837
+ this._closing = false;
838
+ }
839
+
840
+ delete this._impl;
841
+ if (!this.thin) {
842
+ for (const cls of this._dbObjectClasses.values()) {
843
+ cls._objType.refCleanup();
844
+ }
845
+ }
846
+ this._dbObjectClasses.clear();
847
+ }
848
+
849
+ //---------------------------------------------------------------------------
850
+ // commit()
851
+ //
852
+ // Commits the current transaction.
853
+ //---------------------------------------------------------------------------
854
+ async commit() {
855
+ errors.assertArgCount(arguments, 0, 0);
856
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
857
+ await this._impl.commit();
858
+ }
859
+
860
+ //---------------------------------------------------------------------------
861
+ // createLob()
862
+ //
863
+ // Creates a temporary LOB and returns it to the caller.
864
+ //---------------------------------------------------------------------------
865
+ async createLob(type) {
866
+ errors.assertArgCount(arguments, 1, 1);
867
+ errors.assertParamValue(type === types.DB_TYPE_CLOB ||
868
+ type === types.DB_TYPE_BLOB ||
869
+ type === types.DB_TYPE_NCLOB, 1);
870
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
871
+ const lob = new Lob();
872
+ lob._setup(await this._impl.createLob(type), false);
873
+ return lob;
874
+ }
875
+
876
+ //---------------------------------------------------------------------------
877
+ // currentSchema
878
+ //
879
+ // Property for identifying the current schema to use in the database.
880
+ //---------------------------------------------------------------------------
881
+ get currentSchema() {
882
+ if (this._impl)
883
+ return this._impl.getCurrentSchema();
884
+ return undefined;
885
+ }
886
+
887
+ set currentSchema(value) {
888
+ errors.assertPropValue(typeof value === 'string', "currentSchema");
889
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
890
+ this._impl.setCurrentSchema(value);
891
+ }
892
+
893
+ //---------------------------------------------------------------------------
894
+ // dbOp
895
+ //
896
+ // Property for end-to-end tracing attribute.
897
+ //---------------------------------------------------------------------------
898
+ get dbOp() {
899
+ return null;
900
+ }
901
+
902
+ set dbOp(value) {
903
+ errors.assertPropValue(typeof value === 'string', "dbOp");
904
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
905
+ this._impl.setDbOp(value);
906
+ }
907
+
908
+ //---------------------------------------------------------------------------
909
+ // thin()
910
+ //
911
+ // return true, if driver mode is thin while acquiring connection
912
+ // return false, if driver mode is thick while acquiring connection
913
+ //---------------------------------------------------------------------------
914
+ get thin() {
915
+ return settings.thin;
916
+ }
917
+
918
+ //---------------------------------------------------------------------------
919
+ // ecid
920
+ //
921
+ // Property for end-to-end tracing attribute.
922
+ //---------------------------------------------------------------------------
923
+ get ecid() {
924
+ return null;
925
+ }
926
+
927
+ set ecid(value) {
928
+ errors.assertPropValue(typeof value === 'string', "ecid");
929
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
930
+ this._impl.setECID(value);
931
+ }
932
+
933
+ //---------------------------------------------------------------------------
934
+ // decode()
935
+ //
936
+ // Decodes OSON Buffer to JS data type.
937
+ //---------------------------------------------------------------------------
938
+ decodeOSON(buf) {
939
+ errors.assertArgCount(arguments, 1, 1);
940
+ errors.assertParamValue(Buffer.isBuffer(buf), 1);
941
+ const decoder = new oson.OsonDecoder(buf);
942
+ return decoder.decode();
943
+ }
944
+
945
+
946
+ //---------------------------------------------------------------------------
947
+ // encode()
948
+ //
949
+ // Encodes the JS value into OSON bytes.
950
+ //---------------------------------------------------------------------------
951
+ encodeOSON(value) {
952
+ const encoder = new oson.OsonEncoder();
953
+ return encoder.encode(transformer.transformJsonValue(value), this._impl._osonMaxFieldNameSize);
954
+ }
955
+
956
+ //---------------------------------------------------------------------------
957
+ // execute()
958
+ //
959
+ // Executes a SQL statement and returns the results.
960
+ //---------------------------------------------------------------------------
961
+ async execute(sql, a2, a3) {
962
+ const numIters = 1;
963
+ let binds = [];
964
+ let options = {};
965
+
966
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
967
+
968
+ // process arguments
969
+ if (nodbUtil.isObject(sql) && typeof sql.statement === 'string') {
970
+ errors.assertArgCount(arguments, 1, 2);
971
+ if (sql.values) {
972
+ if (this._impl._callLevelTraceData) {
973
+ this._impl._callLevelTraceData.values = sql.values;
974
+ }
975
+ binds = await this._processExecuteBinds(sql.values);
976
+ }
977
+ sql = sql.statement;
978
+ if (arguments.length == 2) {
979
+ options = this._verifyExecOpts(a2, false);
980
+ }
981
+ } else {
982
+ errors.assertArgCount(arguments, 1, 3);
983
+ errors.assertParamValue(typeof sql === 'string', 1);
984
+ if (arguments.length >= 2) {
985
+ if (this._impl._callLevelTraceData) {
986
+ this._impl._callLevelTraceData.values = a2;
987
+ }
988
+ binds = await this._processExecuteBinds(a2);
989
+ }
990
+ if (arguments.length == 3) {
991
+ options = this._verifyExecOpts(a3, false);
992
+ }
993
+ }
994
+ this._addDefaultsToExecOpts(options);
995
+
996
+ // perform actual execute
997
+ let result;
998
+ try {
999
+ if (this._impl._callLevelTraceData) {
1000
+ this._impl._callLevelTraceData.statement = sql;
1001
+ }
1002
+ result = await this._impl.execute(sql, numIters, binds, options, false);
1003
+ } catch (err) {
1004
+ if (err.errorNum === 1406)
1005
+ errors.throwErr(errors.ERR_INSUFFICIENT_BUFFER_FOR_BINDS);
1006
+ throw err;
1007
+ }
1008
+
1009
+ // convert ORA errors to NJS
1010
+ if (result.warning) {
1011
+ result.warning = errors.transformErr(result.warning);
1012
+ }
1013
+
1014
+ // process queries; if a result set is not desired, fetch all of the rows
1015
+ // from the result set and then destroy the result set
1016
+ if (result.resultSet !== undefined) {
1017
+ const resultSet = new ResultSet();
1018
+ resultSet._setup(this, result.resultSet);
1019
+ result.metaData = resultSet._impl.metaData;
1020
+ if (options.resultSet) {
1021
+ result.resultSet = resultSet;
1022
+ } else {
1023
+ result.rows = await resultSet._getAllRows();
1024
+ delete result.resultSet;
1025
+ }
1026
+ }
1027
+
1028
+ // process output binds
1029
+ if (result.outBinds !== undefined) {
1030
+ for (const [key, value] of Object.entries(result.outBinds)) {
1031
+ const val = this._transformOutBind(value, options);
1032
+ result.outBinds[key] = val;
1033
+ }
1034
+ }
1035
+
1036
+ // process implicit results; ensure all implicit results have their fetch
1037
+ // array size fixed, or, if a result set is not requested, that all rows
1038
+ // are fetched
1039
+ if (result.implicitResults) {
1040
+ for (const [key, impl] of Object.entries(result.implicitResults)) {
1041
+ const resultSet = new ResultSet();
1042
+ resultSet._setup(this, impl);
1043
+ if (options.resultSet) {
1044
+ result.implicitResults[key] = resultSet;
1045
+ } else {
1046
+ result.implicitResults[key] = await resultSet._getAllRows();
1047
+ }
1048
+ }
1049
+ }
1050
+
1051
+ return (result);
1052
+ }
1053
+
1054
+ //---------------------------------------------------------------------------
1055
+ // executeMany()
1056
+ //
1057
+ // Executes a SQL statement multiple times and returns the results.
1058
+ //---------------------------------------------------------------------------
1059
+ async executeMany(sql, bindsOrNumIters, a3) {
1060
+ let options = {};
1061
+ let binds = [];
1062
+ let numIters;
1063
+
1064
+ errors.assertArgCount(arguments, 2, 3);
1065
+ errors.assertParamValue(typeof sql === 'string', 1);
1066
+ if (arguments.length == 3) {
1067
+ options = this._verifyExecOpts(a3, true);
1068
+ }
1069
+ this._addDefaultsToExecOpts(options);
1070
+ if (typeof bindsOrNumIters === 'number') {
1071
+ errors.assertParamValue(Number.isInteger(bindsOrNumIters) &&
1072
+ bindsOrNumIters > 0, 2);
1073
+ numIters = bindsOrNumIters;
1074
+ if (options.bindDefs !== undefined) {
1075
+ binds = await this._processExecuteManyBinds([], options.bindDefs);
1076
+ }
1077
+ } else {
1078
+ errors.assertParamValue(Array.isArray(bindsOrNumIters) &&
1079
+ bindsOrNumIters.length > 0, 2);
1080
+ numIters = bindsOrNumIters.length;
1081
+ binds = await this._processExecuteManyBinds(bindsOrNumIters,
1082
+ options.bindDefs);
1083
+ }
1084
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1085
+
1086
+ const result = await this._impl.execute(sql, numIters, binds, options,
1087
+ true);
1088
+
1089
+ // convert ORA warnings to NJS
1090
+ if (result.warning) {
1091
+ result.warning = errors.transformErr(result.warning);
1092
+ }
1093
+
1094
+ // process output binds
1095
+ if (result.outBinds !== undefined) {
1096
+ for (let i = 0; i < result.outBinds.length; i++) {
1097
+ const outBind = result.outBinds[i];
1098
+ for (const [key, value] of Object.entries(outBind)) {
1099
+ outBind[key] = this._transformOutBind(value, options);
1100
+ }
1101
+ }
1102
+ }
1103
+
1104
+ return result;
1105
+ }
1106
+
1107
+ //---------------------------------------------------------------------------
1108
+ // externalName
1109
+ //
1110
+ // Property for identifying the external name to use in TPC logging.
1111
+ //---------------------------------------------------------------------------
1112
+ get externalName() {
1113
+ if (this._impl)
1114
+ return this._impl.getExternalName();
1115
+ return undefined;
1116
+ }
1117
+
1118
+ set externalName(value) {
1119
+ errors.assertPropValue(typeof value === 'string', "externalName");
1120
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1121
+ this._impl.setExternalName(value);
1122
+ }
1123
+
1124
+ //---------------------------------------------------------------------------
1125
+ // dbDomain (READONLY)
1126
+ //
1127
+ // Property for identifying the dbDomain of the Oracle Database.
1128
+ //---------------------------------------------------------------------------
1129
+ get dbDomain() {
1130
+ return this._impl && this._impl.getDbDomain();
1131
+ }
1132
+
1133
+ //---------------------------------------------------------------------------
1134
+ // dbName (READONLY)
1135
+ //
1136
+ // Property for identifying the dbName of the Oracle Database.
1137
+ //---------------------------------------------------------------------------
1138
+ get dbName() {
1139
+ return this._impl && this._impl.getDbName();
1140
+ }
1141
+
1142
+ //---------------------------------------------------------------------------
1143
+ // hostName (READONLY)
1144
+ //
1145
+ // Property for identifying the hostName of the Oracle Database.
1146
+ //---------------------------------------------------------------------------
1147
+ get hostName() {
1148
+ return this._impl && this._impl.getHostName();
1149
+ }
1150
+
1151
+ //---------------------------------------------------------------------------
1152
+ // port (READONLY)
1153
+ //
1154
+ // Property for identifying the port to which client is connected.
1155
+ //---------------------------------------------------------------------------
1156
+ get port() {
1157
+ return this._impl && this._impl.getPort();
1158
+ }
1159
+
1160
+ //---------------------------------------------------------------------------
1161
+ // protocol (READONLY)
1162
+ //
1163
+ // Property for identifying the protocol used to connect to Oracle Database.
1164
+ //---------------------------------------------------------------------------
1165
+ get protocol() {
1166
+ return this._impl && this._impl.getProtocol();
1167
+ }
1168
+
1169
+ //---------------------------------------------------------------------------
1170
+ // connectString (READONLY)
1171
+ //
1172
+ // User provided connectString to connect to Oracle Database.
1173
+ //---------------------------------------------------------------------------
1174
+ get connectString() {
1175
+ return this._impl && this._impl._connectString;
1176
+ }
1177
+
1178
+ //---------------------------------------------------------------------------
1179
+ // user
1180
+ //
1181
+ // User property provided to connect to Oracle Database.
1182
+ //---------------------------------------------------------------------------
1183
+ get user() {
1184
+ if (this.currentSchema.length) {
1185
+ return this.currentSchema;
1186
+ }
1187
+ return this._impl && this._impl._user;
1188
+ }
1189
+
1190
+ //---------------------------------------------------------------------------
1191
+ // connectTraceConfig
1192
+ //
1193
+ // Property for getting the connection related config.
1194
+ //---------------------------------------------------------------------------
1195
+ get connectTraceConfig() {
1196
+ return this._impl && this._impl._getConnectTraceConfig();
1197
+ }
1198
+
1199
+ //---------------------------------------------------------------------------
1200
+ // getDbObjectClass()
1201
+ //
1202
+ // Returns a database object class given its name. The cache is searched
1203
+ // first, but if not found, the database is queried and the result is cached
1204
+ // using the type information (as well as the name for easier lookup later).
1205
+ //---------------------------------------------------------------------------
1206
+ async getDbObjectClass(name) {
1207
+ errors.assertArgCount(arguments, 1, 1);
1208
+ errors.assertParamValue(typeof name === 'string', 1);
1209
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1210
+ return await this._getDbObjectClassForName(name);
1211
+ }
1212
+
1213
+ //---------------------------------------------------------------------------
1214
+ // getQueue()
1215
+ //
1216
+ // Returns a queue with the specified name.
1217
+ //---------------------------------------------------------------------------
1218
+ async getQueue(name, a2) {
1219
+ let options = {};
1220
+
1221
+ errors.assertArgCount(arguments, 1, 2);
1222
+ errors.assertParamValue(typeof name === 'string', 1);
1223
+ if (arguments.length == 2) {
1224
+ errors.assertParamValue(nodbUtil.isObject(a2), 2);
1225
+ options = {...a2};
1226
+ }
1227
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1228
+ const queue = new AqQueue();
1229
+ await queue.create(this, name, options);
1230
+ return queue;
1231
+ }
1232
+
1233
+ //---------------------------------------------------------------------------
1234
+ // getSodaDatabase()
1235
+ //
1236
+ // Returns a SodaDatabase object (high-level SODA object associated with
1237
+ // the current connection).
1238
+ //---------------------------------------------------------------------------
1239
+ getSodaDatabase() {
1240
+ errors.assertArgCount(arguments, 0, 0);
1241
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1242
+ const sodaDb = new SodaDatabase();
1243
+ sodaDb._impl = this._impl.getSodaDatabase();
1244
+ return sodaDb;
1245
+ }
1246
+
1247
+ //---------------------------------------------------------------------------
1248
+ // getStatementInfo()
1249
+ //
1250
+ // Returns information about the statement.
1251
+ //---------------------------------------------------------------------------
1252
+ async getStatementInfo(sql) {
1253
+ errors.assertArgCount(arguments, 1, 1);
1254
+ errors.assertParamValue(typeof sql === 'string', 1);
1255
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1256
+ const info = await this._impl.getStatementInfo(sql);
1257
+ if (info.metaData) {
1258
+ for (let i = 0; i < info.metaData.length; i++) {
1259
+ const m = info.metaData[i];
1260
+ nodbUtil.addTypeProperties(m, "dbType");
1261
+ m.fetchType = types.DB_TYPE_FETCH_TYPE_MAP.get(m.dbType);
1262
+ }
1263
+ }
1264
+ return info;
1265
+ }
1266
+
1267
+ //---------------------------------------------------------------------------
1268
+ // instanceName
1269
+ //
1270
+ // Returns the Oracle Database instance name associated with the connection.
1271
+ // This is the equivalent of the SQL expression:
1272
+ // sys_context('userenv', 'instance_name')
1273
+ //---------------------------------------------------------------------------
1274
+ get instanceName() {
1275
+ if (this._impl)
1276
+ return this._impl.getInstanceName();
1277
+ return undefined;
1278
+ }
1279
+
1280
+ //---------------------------------------------------------------------------
1281
+ // internalName
1282
+ //
1283
+ // Property for identifying the internal name to use in TPC logging.
1284
+ //---------------------------------------------------------------------------
1285
+ get internalName() {
1286
+ if (this._impl)
1287
+ return this._impl.getInternalName();
1288
+ return undefined;
1289
+ }
1290
+
1291
+ set internalName(value) {
1292
+ errors.assertPropValue(typeof value === 'string', "internalName");
1293
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1294
+ this._impl.setInternalName(value);
1295
+ }
1296
+
1297
+ //---------------------------------------------------------------------------
1298
+ // ltxid
1299
+ //
1300
+ // Property for identifying the logical transaction ID to avoid duplicate
1301
+ // transactions. Used with Oracle Transaction Guard.
1302
+ //---------------------------------------------------------------------------
1303
+ get ltxid() {
1304
+ if (this._impl)
1305
+ return this._impl.getLTXID();
1306
+ return undefined;
1307
+ }
1308
+
1309
+ //--------------------------------------------------------------------------
1310
+ // isHealthy()
1311
+ //
1312
+ // Returns the health status of the connection. If this function returns
1313
+ // false, the caller should close the connection.
1314
+ //---------------------------------------------------------------------------
1315
+ isHealthy() {
1316
+ return (this._impl !== undefined && !this._closing &&
1317
+ this._impl.isHealthy());
1318
+ }
1319
+
1320
+ isCompressionEnabled() {
1321
+ return (this._impl && this._impl.isCompressionEnabled());
1322
+ }
1323
+
1324
+ //---------------------------------------------------------------------------
1325
+ // maxIdentifierLength
1326
+ //
1327
+ // Returns the maximum length of identifiers supported by the database to
1328
+ // which this connection has been established.
1329
+ //---------------------------------------------------------------------------
1330
+ get maxIdentifierLength() {
1331
+ return this._impl && this._impl.getMaxIdentifierLength();
1332
+ }
1333
+
1334
+ //---------------------------------------------------------------------------
1335
+ // maxOpenCursors
1336
+ //
1337
+ // Returns maximum number of cursors that can be opened in one session.
1338
+ //---------------------------------------------------------------------------
1339
+ get maxOpenCursors() {
1340
+ return this._impl && this._impl.getMaxOpenCursors();
1341
+ }
1342
+
1343
+ //---------------------------------------------------------------------------
1344
+ // warning
1345
+ //
1346
+ // Returns warningInfo.
1347
+ //---------------------------------------------------------------------------
1348
+ get warning() {
1349
+ let warning = this._impl.getWarning();
1350
+ if (warning) {
1351
+ // Make sure that warning code attribute is populated and ORA error
1352
+ // is converted to NJS, if required
1353
+ warning = errors.transformErr(warning);
1354
+ }
1355
+ return this._impl && warning;
1356
+ }
1357
+
1358
+ //---------------------------------------------------------------------------
1359
+ // module
1360
+ //
1361
+ // Property for end-to-end tracing attribute.
1362
+ //---------------------------------------------------------------------------
1363
+ get module() {
1364
+ return null;
1365
+ }
1366
+
1367
+ set module(value) {
1368
+ errors.assertPropValue(typeof value === 'string', "module");
1369
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1370
+ this._impl.setModule(value);
1371
+ }
1372
+
1373
+ //---------------------------------------------------------------------------
1374
+ // oracleServerVersion
1375
+ //
1376
+ // Returns an integer identifying the Oracle Server version.
1377
+ //---------------------------------------------------------------------------
1378
+ get oracleServerVersion() {
1379
+ if (this._impl)
1380
+ return this._impl.getOracleServerVersion();
1381
+ return undefined;
1382
+ }
1383
+
1384
+ //---------------------------------------------------------------------------
1385
+ // oracleServerVersionString
1386
+ //
1387
+ // Returns a string identifying the Oracle Server version.
1388
+ //---------------------------------------------------------------------------
1389
+ get oracleServerVersionString() {
1390
+ if (this._impl)
1391
+ return this._impl.getOracleServerVersionString();
1392
+ return undefined;
1393
+ }
1394
+
1395
+ //---------------------------------------------------------------------------
1396
+ // serviceName
1397
+ //
1398
+ // Returns the Oracle Database service name associated with the connection.
1399
+ //---------------------------------------------------------------------------
1400
+ get serviceName() {
1401
+ return this._impl && this._impl.getServiceName();
1402
+ }
1403
+
1404
+ //---------------------------------------------------------------------------
1405
+ // transactionInProgress
1406
+ //
1407
+ // Returns a boolean value based on the presence of an active transaction
1408
+ // on the connection
1409
+ //---------------------------------------------------------------------------
1410
+ get transactionInProgress() {
1411
+ return this._impl && this._impl.getTransactionInProgress();
1412
+ }
1413
+
1414
+ //---------------------------------------------------------------------------
1415
+ // ping()
1416
+ //
1417
+ // Sends a "ping" to the database to see if it is "alive".
1418
+ //---------------------------------------------------------------------------
1419
+ async ping() {
1420
+ errors.assertArgCount(arguments, 0, 0);
1421
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1422
+ await this._impl.ping();
1423
+ }
1424
+
1425
+ //--------------------------------------------------------------------------
1426
+ // queryStream()
1427
+ //
1428
+ // Similar to execute() except that it immediately returns a QueryStream
1429
+ // object.
1430
+ // ---------------------------------------------------------------------------
1431
+ queryStream(sql, binds, options) {
1432
+ errors.assertArgCount(arguments, 1, 3);
1433
+ errors.assertParamValue(typeof sql === 'string', 1);
1434
+ if (arguments.length == 3) {
1435
+ errors.assertParamValue(nodbUtil.isObject(options), 3);
1436
+ options = {...options};
1437
+ } else {
1438
+ options = {};
1439
+ }
1440
+ options.resultSet = true;
1441
+
1442
+ const stream = new QueryStream();
1443
+
1444
+ // calling execute() via nextTick to ensure that handlers are registered
1445
+ // prior to the events being emitted
1446
+ process.nextTick(async () => {
1447
+ try {
1448
+ const result = await this.execute(sql, binds || [], options);
1449
+ if (!result.resultSet)
1450
+ errors.throwErr(errors.ERR_NOT_A_QUERY);
1451
+ stream._open(result.resultSet);
1452
+ } catch (err) {
1453
+ stream.destroy(err);
1454
+ return;
1455
+ }
1456
+ });
1457
+
1458
+ return (stream);
1459
+ }
1460
+
1461
+ //---------------------------------------------------------------------------
1462
+ // resumeSessionlessTransaction()
1463
+ //
1464
+ // Resume an existing sessionlesss transaction using given transactionId
1465
+ //---------------------------------------------------------------------------
1466
+ async resumeSessionlessTransaction(transactionId, options = {}) {
1467
+ errors.assertArgCount(arguments, 1, 2);
1468
+ errors.assertParamValue(nodbUtil.isTransactionId(transactionId), 1);
1469
+ errors.assertParamValue(nodbUtil.isObject(options), 2);
1470
+ errors.assertParamPropUnsignedInt(options, 2, 'timeout');
1471
+ errors.assertParamPropBool(options, 2, 'deferRoundTrip');
1472
+ const normalizedTransactionId =
1473
+ nodbUtil.normalizeTransactionId(transactionId);
1474
+ const {timeout = 60, deferRoundTrip = false} = options;
1475
+ await this._impl.startSessionlessTransaction(normalizedTransactionId,
1476
+ timeout, constants.TPC_BEGIN_RESUME, deferRoundTrip);
1477
+ return normalizedTransactionId;
1478
+ }
1479
+
1480
+ //---------------------------------------------------------------------------
1481
+ // rollback()
1482
+ //
1483
+ // Rolls back the current transaction.
1484
+ //---------------------------------------------------------------------------
1485
+ async rollback() {
1486
+ errors.assertArgCount(arguments, 0, 0);
1487
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1488
+ await this._impl.rollback();
1489
+ }
1490
+
1491
+ //---------------------------------------------------------------------------
1492
+ // shutdown()
1493
+ // Shuts down the database instance.
1494
+ //---------------------------------------------------------------------------
1495
+ async shutdown(a1) {
1496
+ let mode = constants.SHUTDOWN_MODE_DEFAULT;
1497
+
1498
+ errors.assertArgCount(arguments, 0, 1);
1499
+ if (a1 !== undefined) {
1500
+ errors.assertParamValue(typeof mode === 'number', 1);
1501
+ mode = a1;
1502
+ }
1503
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1504
+
1505
+ await this._impl.shutdown(mode);
1506
+ }
1507
+
1508
+ //---------------------------------------------------------------------------
1509
+ // startup()
1510
+ // Starts up the database instance.
1511
+ //---------------------------------------------------------------------------
1512
+ async startup(a1) {
1513
+ let options = {};
1514
+
1515
+ errors.assertArgCount(arguments, 0, 1);
1516
+ if (arguments.length == 1) {
1517
+ errors.assertParamValue(typeof options === 'object', 1);
1518
+ options = a1;
1519
+ errors.assertParamPropBool(options, 1, "force");
1520
+ errors.assertParamPropBool(options, 1, "restrict");
1521
+ errors.assertParamPropString(options, 1, "pfile");
1522
+ }
1523
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1524
+
1525
+ await this._impl.startup(options);
1526
+ }
1527
+
1528
+ //---------------------------------------------------------------------------
1529
+ // stmtCacheSize
1530
+ //
1531
+ // Property for statement cache size.
1532
+ //---------------------------------------------------------------------------
1533
+ get stmtCacheSize() {
1534
+ if (this._impl)
1535
+ return this._impl.getStmtCacheSize();
1536
+ return undefined;
1537
+ }
1538
+
1539
+ set stmtCacheSize(value) {
1540
+ errors.assertPropValue(Number.isInteger(value) && value >= 0,
1541
+ "stmtCacheSize");
1542
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1543
+ this._impl.setStmtCacheSize(value);
1544
+ }
1545
+
1546
+ //---------------------------------------------------------------------------
1547
+ // subscribe()
1548
+ //
1549
+ // Creates a subscription which can be used to get notifications of database
1550
+ // changes or of AQ messages available to dequeue.
1551
+ //---------------------------------------------------------------------------
1552
+ async subscribe(name, options) {
1553
+ errors.assertArgCount(arguments, 2, 2);
1554
+ errors.assertParamValue(typeof name === 'string', 1);
1555
+ errors.assertParamValue(nodbUtil.isObject(options), 2);
1556
+ options = {name: name, ...options};
1557
+ errors.assertParamPropUnsignedInt(options, 2, "namespace");
1558
+ if (options.namespace === undefined)
1559
+ options.namespace = constants.SUBSCR_NAMESPACE_DBCHANGE;
1560
+ errors.assertParamPropString(options, 2, "ipAddress");
1561
+ errors.assertParamPropUnsignedInt(options, 2, "port");
1562
+ errors.assertParamPropUnsignedInt(options, 2, "timeout");
1563
+ errors.assertParamPropUnsignedInt(options, 2, "operations");
1564
+ errors.assertParamPropUnsignedInt(options, 2, "qos");
1565
+ errors.assertParamPropUnsignedInt(options, 2, "groupingClass");
1566
+ errors.assertParamPropUnsignedInt(options, 2, "groupingValue");
1567
+ errors.assertParamPropUnsignedInt(options, 2, "groupingType");
1568
+ errors.assertParamPropBool(options, 2, "clientInitiated");
1569
+ errors.assertParamPropFunction(options, 2, "callback");
1570
+ errors.assert(options.callback, errors.ERR_MISSING_SUBSCR_CALLBACK);
1571
+ if (options.namespace === constants.SUBSCR_NAMESPACE_DBCHANGE) {
1572
+ errors.assertParamPropString(options, 2, "sql");
1573
+ errors.assert(options.sql && options.sql.length > 0,
1574
+ errors.ERR_MISSING_SUBSCR_SQL);
1575
+ if (options.binds !== undefined) {
1576
+ options.binds = await this._processExecuteBinds(options.binds);
1577
+ }
1578
+ }
1579
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1580
+
1581
+ const inSubscr = _subscriptions.get(name);
1582
+ const outValue = await this._impl.subscribe(inSubscr, options);
1583
+ let subscription;
1584
+ if (options.namespace === constants.SUBSCR_NAMESPACE_DBCHANGE) {
1585
+ subscription = outValue.subscription;
1586
+ delete outValue.subscription;
1587
+ } else {
1588
+ subscription = outValue;
1589
+ }
1590
+ _subscriptions.set(name, subscription);
1591
+ return outValue;
1592
+ }
1593
+
1594
+ //---------------------------------------------------------------------------
1595
+ // suspendSessionlessTransaction()
1596
+ //
1597
+ // Suspend any active sessionless transaction immediately
1598
+ //---------------------------------------------------------------------------
1599
+ async suspendSessionlessTransaction() {
1600
+ errors.assertArgCount(arguments, 0, 0);
1601
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1602
+ await this._impl.suspendSessionlessTransaction();
1603
+ }
1604
+
1605
+ //---------------------------------------------------------------------------
1606
+ // tag
1607
+ //
1608
+ // Property for tag to associate with the connection.
1609
+ //---------------------------------------------------------------------------
1610
+ get tag() {
1611
+ if (this._impl)
1612
+ return this._impl.getTag();
1613
+ return undefined;
1614
+ }
1615
+
1616
+ set tag(value) {
1617
+ errors.assertPropValue(typeof value === 'string', "tag");
1618
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1619
+ this._impl.setTag(value);
1620
+ }
1621
+
1622
+ //---------------------------------------------------------------------------
1623
+ // tpcBegin()
1624
+ //
1625
+ // Starts a two-phase-commit transaction.
1626
+ //--------------------------------------------------------------------------
1627
+ async tpcBegin(xid, flag, timeout) {
1628
+ errors.assertArgCount(arguments, 1, 3);
1629
+ errors.assertParamValue(nodbUtil.isXid(xid), 1);
1630
+ const normalizedXid = nodbUtil.normalizeXid(xid);
1631
+ if (arguments.length < 3) {
1632
+ timeout = 60; // seconds
1633
+ } else {
1634
+ errors.assertParamValue(typeof timeout === 'number', 3);
1635
+ }
1636
+
1637
+ if (arguments.length < 2) {
1638
+ flag = constants.TPC_BEGIN_NEW;
1639
+ } else {
1640
+ errors.assertParamValue(typeof flag === 'number', 2);
1641
+ const options = [constants.TPC_BEGIN_NEW, constants.TPC_BEGIN_JOIN,
1642
+ constants.TPC_BEGIN_RESUME, constants.TPC_BEGIN_PROMOTE];
1643
+ if (options.indexOf(flag) < 0) {
1644
+ errors.throwErr(errors.ERR_INVALID_TPC_BEGIN_FLAGS);
1645
+ }
1646
+ }
1647
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1648
+ await this._impl.tpcBegin(normalizedXid, flag, timeout);
1649
+ }
1650
+
1651
+ //---------------------------------------------------------------------------
1652
+ // tpcCommit()
1653
+ //
1654
+ // Commits a two-phase-commit transaction.
1655
+ //---------------------------------------------------------------------------
1656
+ async tpcCommit(xid, onePhase) {
1657
+ errors.assertArgCount(arguments, 0, 2);
1658
+
1659
+ if (arguments.length < 2) {
1660
+ onePhase = false;
1661
+ } else {
1662
+ errors.assertParamValue(typeof onePhase === 'boolean', 2);
1663
+ }
1664
+ let normalizedXid;
1665
+ if (arguments.length >= 1) {
1666
+ errors.assertParamValue(nodbUtil.isXid(xid), 1);
1667
+ normalizedXid = nodbUtil.normalizeXid(xid);
1668
+ }
1669
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1670
+ await this._impl.tpcCommit(normalizedXid, onePhase);
1671
+ }
1672
+
1673
+ //---------------------------------------------------------------------------
1674
+ // tpcEnd()
1675
+ //
1676
+ // Ends a two-phase-commit transaction.
1677
+ //---------------------------------------------------------------------------
1678
+ async tpcEnd(xid, flag) {
1679
+ errors.assertArgCount(arguments, 0, 2);
1680
+
1681
+ if (arguments.length < 2) {
1682
+ flag = constants.TPC_END_NORMAL;
1683
+ } else {
1684
+ errors.assertParamValue(typeof flag === 'number', 2);
1685
+ const options = [constants.TPC_END_NORMAL, constants.TPC_END_SUSPEND];
1686
+ if (!options.includes(flag)) {
1687
+ errors.throwErr(errors.ERR_INVALID_TPC_END_FLAGS);
1688
+ }
1689
+ }
1690
+ let normalizedXid;
1691
+ if (arguments.length >= 1) {
1692
+ errors.assertParamValue(nodbUtil.isXid(xid), 1);
1693
+ normalizedXid = nodbUtil.normalizeXid(xid);
1694
+ }
1695
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1696
+
1697
+ await this._impl.tpcEnd(normalizedXid, flag);
1698
+ }
1699
+
1700
+ //---------------------------------------------------------------------------
1701
+ // tpcForget()
1702
+ //
1703
+ // Causes the server to forget a heuristically completed two-phase-commit
1704
+ // transaction.
1705
+ // ---------------------------------------------------------------------------
1706
+ async tpcForget(xid) {
1707
+ errors.assertArgCount(arguments, 1, 1);
1708
+ errors.assertParamValue(nodbUtil.isXid(xid), 1);
1709
+ const normalizedXid = nodbUtil.normalizeXid(xid);
1710
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1711
+
1712
+ await this._impl.tpcForget(normalizedXid);
1713
+ }
1714
+
1715
+ //---------------------------------------------------------------------------
1716
+ // tpcPrepare()
1717
+ //
1718
+ // Prepares a two-phase-commit transaction for commit.
1719
+ //---------------------------------------------------------------------------
1720
+ async tpcPrepare(xid) {
1721
+ errors.assertArgCount(arguments, 0, 1);
1722
+ let normalizedXid;
1723
+ if (arguments.length >= 1) {
1724
+ errors.assertParamValue(nodbUtil.isXid(xid), 1);
1725
+ normalizedXid = nodbUtil.normalizeXid(xid);
1726
+ }
1727
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1728
+
1729
+ return await this._impl.tpcPrepare(normalizedXid);
1730
+ }
1731
+
1732
+ //---------------------------------------------------------------------------
1733
+ // tpcRecover()
1734
+ //
1735
+ // Returns a list of pending two-phase-commit transactions.
1736
+ //---------------------------------------------------------------------------
1737
+ async tpcRecover(asString) {
1738
+ errors.assertArgCount(arguments, 0, 1);
1739
+
1740
+ if (arguments.length == 1) {
1741
+ errors.assertParamValue(typeof asString === 'boolean', 1);
1742
+ } else {
1743
+ asString = true;
1744
+ }
1745
+
1746
+ const sqlStr = `
1747
+ SELECT
1748
+ formatid as "formatId",
1749
+ UTL_RAW.CAST_TO_VARCHAR2(globalid) as "globalTransactionId",
1750
+ UTL_RAW.CAST_TO_VARCHAR2(branchid) as "branchQualifier"
1751
+ FROM DBA_PENDING_TRANSACTIONS`;
1752
+ const sqlBuf = `
1753
+ SELECT
1754
+ formatid as "formatId",
1755
+ globalid as "globalTransactionId",
1756
+ branchid as "branchQualifier"
1757
+ FROM DBA_PENDING_TRANSACTIONS`;
1758
+ const options = {
1759
+ outFormat: constants.OUT_FORMAT_OBJECT,
1760
+ resultSet: false
1761
+ };
1762
+
1763
+ const result = await this.execute(asString ? sqlStr : sqlBuf, {}, options);
1764
+ return result.rows;
1765
+ }
1766
+
1767
+ //---------------------------------------------------------------------------
1768
+ // tpcRollback()
1769
+ //
1770
+ // Rolls back the current changes in a two-phase-commit transaction.
1771
+ //---------------------------------------------------------------------------
1772
+ async tpcRollback(xid) {
1773
+ errors.assertArgCount(arguments, 0, 1);
1774
+ let normalizedXid;
1775
+ if (arguments.length == 1) {
1776
+ errors.assertParamValue(nodbUtil.isXid(xid), 1);
1777
+ normalizedXid = nodbUtil.normalizeXid(xid);
1778
+ }
1779
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1780
+
1781
+ await this._impl.tpcRollback(normalizedXid);
1782
+ }
1783
+
1784
+ //---------------------------------------------------------------------------
1785
+ // unsubscribe()
1786
+ //
1787
+ // Destroy a subscription which was earlier created using subscribe().
1788
+ //---------------------------------------------------------------------------
1789
+ async unsubscribe(name) {
1790
+ errors.assertArgCount(arguments, 1, 1);
1791
+ errors.assertParamValue(typeof name === 'string', 1);
1792
+ errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
1793
+ errors.assert(_subscriptions.has(name), errors.ERR_INVALID_SUBSCR);
1794
+ await this._impl.unsubscribe(_subscriptions.get(name));
1795
+
1796
+ // Delay decreasing the reference count
1797
+ // as NJS layer starts cleanup (uv_close) of async handle asynchronously.
1798
+ setTimeout(() => {
1799
+ _subscriptions.delete(name);
1800
+ }, 0);
1801
+ }
1802
+
1803
+ }
1804
+
1805
+ // adjust functions to support the old callback style and to serialize calls
1806
+ // that cannot take place concurrently
1807
+ // NOTE: breakExecution() should not be serialized
1808
+ Connection.prototype.break =
1809
+ nodbUtil.callbackify(nodbUtil.wrapFn(Connection.prototype.breakExecution));
1810
+ Connection.prototype.tpcRecover =
1811
+ nodbUtil.callbackify(nodbUtil.wrapFn(Connection.prototype.tpcRecover));
1812
+ nodbUtil.wrapFns(Connection.prototype,
1813
+ "beginSessionlessTransaction",
1814
+ "changePassword",
1815
+ "close",
1816
+ "commit",
1817
+ "createLob",
1818
+ "execute",
1819
+ "executeMany",
1820
+ "getDbObjectClass",
1821
+ "getQueue",
1822
+ "getStatementInfo",
1823
+ "ping",
1824
+ "resumeSessionlessTransaction",
1825
+ "rollback",
1826
+ "shutdown",
1827
+ "startup",
1828
+ "subscribe",
1829
+ "suspendSessionlessTransaction",
1830
+ "tpcBegin",
1831
+ "tpcCommit",
1832
+ "tpcEnd",
1833
+ "tpcForget",
1834
+ "tpcPrepare",
1835
+ "tpcRollback",
1836
+ "unsubscribe");
1837
+
1838
+ // add alias for release()
1839
+ Connection.prototype.release = Connection.prototype.close;
1840
+
1841
+ // export just the Connection class
1842
+ module.exports = Connection;