spindb 0.37.2 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (811) hide show
  1. package/dist/cli/bin.js +9 -0
  2. package/dist/cli/bin.js.map +1 -0
  3. package/dist/cli/commands/attach.js +102 -0
  4. package/dist/cli/commands/attach.js.map +1 -0
  5. package/dist/cli/commands/backup.js +197 -0
  6. package/dist/cli/commands/backup.js.map +1 -0
  7. package/dist/cli/commands/backups.js +190 -0
  8. package/dist/cli/commands/backups.js.map +1 -0
  9. package/dist/cli/commands/clone.js +119 -0
  10. package/dist/cli/commands/clone.js.map +1 -0
  11. package/dist/cli/commands/config.js +276 -0
  12. package/dist/cli/commands/config.js.map +1 -0
  13. package/dist/cli/commands/connect.js +559 -0
  14. package/dist/cli/commands/connect.js.map +1 -0
  15. package/dist/cli/commands/create.js +952 -0
  16. package/dist/cli/commands/create.js.map +1 -0
  17. package/dist/cli/commands/databases.js +485 -0
  18. package/dist/cli/commands/databases.js.map +1 -0
  19. package/dist/cli/commands/delete.js +106 -0
  20. package/dist/cli/commands/delete.js.map +1 -0
  21. package/dist/cli/commands/deps.js +238 -0
  22. package/dist/cli/commands/deps.js.map +1 -0
  23. package/dist/cli/commands/detach.js +81 -0
  24. package/dist/cli/commands/detach.js.map +1 -0
  25. package/dist/cli/commands/doctor.js +567 -0
  26. package/dist/cli/commands/doctor.js.map +1 -0
  27. package/dist/cli/commands/duckdb.js +207 -0
  28. package/dist/cli/commands/duckdb.js.map +1 -0
  29. package/dist/cli/commands/edit.js +524 -0
  30. package/dist/cli/commands/edit.js.map +1 -0
  31. package/dist/cli/commands/engines.js +1414 -0
  32. package/dist/cli/commands/engines.js.map +1 -0
  33. package/dist/cli/commands/export.js +383 -0
  34. package/dist/cli/commands/export.js.map +1 -0
  35. package/dist/cli/commands/info.js +270 -0
  36. package/dist/cli/commands/info.js.map +1 -0
  37. package/dist/cli/commands/list.js +215 -0
  38. package/dist/cli/commands/list.js.map +1 -0
  39. package/dist/cli/commands/logs.js +81 -0
  40. package/dist/cli/commands/logs.js.map +1 -0
  41. package/dist/cli/commands/menu/backup-handlers.js +1202 -0
  42. package/dist/cli/commands/menu/backup-handlers.js.map +1 -0
  43. package/dist/cli/commands/menu/container-handlers.js +1788 -0
  44. package/dist/cli/commands/menu/container-handlers.js.map +1 -0
  45. package/dist/cli/commands/menu/engine-handlers.js +235 -0
  46. package/dist/cli/commands/menu/engine-handlers.js.map +1 -0
  47. package/dist/cli/commands/menu/index.js +266 -0
  48. package/dist/cli/commands/menu/index.js.map +1 -0
  49. package/dist/cli/commands/menu/settings-handlers.js +320 -0
  50. package/dist/cli/commands/menu/settings-handlers.js.map +1 -0
  51. package/dist/cli/commands/menu/shared.js +13 -0
  52. package/dist/cli/commands/menu/shared.js.map +1 -0
  53. package/dist/cli/commands/menu/shell-handlers.js +1573 -0
  54. package/dist/cli/commands/menu/shell-handlers.js.map +1 -0
  55. package/dist/cli/commands/menu/sql-handlers.js +185 -0
  56. package/dist/cli/commands/menu/sql-handlers.js.map +1 -0
  57. package/dist/cli/commands/menu/update-handlers.js +322 -0
  58. package/dist/cli/commands/menu/update-handlers.js.map +1 -0
  59. package/dist/cli/commands/menu/validators.js +9 -0
  60. package/dist/cli/commands/menu/validators.js.map +1 -0
  61. package/dist/cli/commands/ports.js +166 -0
  62. package/dist/cli/commands/ports.js.map +1 -0
  63. package/dist/cli/commands/pull.js +166 -0
  64. package/dist/cli/commands/pull.js.map +1 -0
  65. package/dist/cli/commands/query.js +180 -0
  66. package/dist/cli/commands/query.js.map +1 -0
  67. package/dist/cli/commands/restore.js +428 -0
  68. package/dist/cli/commands/restore.js.map +1 -0
  69. package/dist/cli/commands/run.js +115 -0
  70. package/dist/cli/commands/run.js.map +1 -0
  71. package/dist/cli/commands/self-update.js +99 -0
  72. package/dist/cli/commands/self-update.js.map +1 -0
  73. package/dist/cli/commands/sqlite.js +207 -0
  74. package/dist/cli/commands/sqlite.js.map +1 -0
  75. package/dist/cli/commands/start.js +196 -0
  76. package/dist/cli/commands/start.js.map +1 -0
  77. package/dist/cli/commands/stop.js +182 -0
  78. package/dist/cli/commands/stop.js.map +1 -0
  79. package/dist/cli/commands/url.js +88 -0
  80. package/dist/cli/commands/url.js.map +1 -0
  81. package/dist/cli/commands/users.js +189 -0
  82. package/dist/cli/commands/users.js.map +1 -0
  83. package/dist/cli/commands/version.js +52 -0
  84. package/dist/cli/commands/version.js.map +1 -0
  85. package/dist/cli/commands/which.js +258 -0
  86. package/dist/cli/commands/which.js.map +1 -0
  87. package/dist/cli/constants.js +212 -0
  88. package/dist/cli/constants.js.map +1 -0
  89. package/dist/cli/helpers.js +1120 -0
  90. package/dist/cli/helpers.js.map +1 -0
  91. package/dist/cli/index.js +146 -0
  92. package/dist/cli/index.js.map +1 -0
  93. package/dist/cli/ui/prompts.js +1002 -0
  94. package/dist/cli/ui/prompts.js.map +1 -0
  95. package/dist/cli/ui/spinner.js +74 -0
  96. package/dist/cli/ui/spinner.js.map +1 -0
  97. package/dist/cli/ui/theme.js +99 -0
  98. package/dist/cli/ui/theme.js.map +1 -0
  99. package/dist/cli/utils/file-follower.js +79 -0
  100. package/dist/cli/utils/file-follower.js.map +1 -0
  101. package/dist/config/backup-formats.js +363 -0
  102. package/dist/config/backup-formats.js.map +1 -0
  103. package/dist/config/defaults.js +25 -0
  104. package/dist/config/defaults.js.map +1 -0
  105. package/dist/config/engine-defaults.js +303 -0
  106. package/dist/config/engine-defaults.js.map +1 -0
  107. package/dist/config/engines-registry.js +103 -0
  108. package/dist/config/engines-registry.js.map +1 -0
  109. package/dist/config/os-dependencies.js +767 -0
  110. package/dist/config/os-dependencies.js.map +1 -0
  111. package/dist/config/paths.js +156 -0
  112. package/dist/config/paths.js.map +1 -0
  113. package/dist/config/version.js +3 -0
  114. package/dist/config/version.js.map +1 -0
  115. package/dist/core/backup-restore.js +219 -0
  116. package/dist/core/backup-restore.js.map +1 -0
  117. package/dist/core/base-binary-manager.js +403 -0
  118. package/dist/core/base-binary-manager.js.map +1 -0
  119. package/dist/core/base-document-binary-manager.js +364 -0
  120. package/dist/core/base-document-binary-manager.js.map +1 -0
  121. package/dist/core/base-embedded-binary-manager.js +364 -0
  122. package/dist/core/base-embedded-binary-manager.js.map +1 -0
  123. package/dist/core/base-server-binary-manager.js +368 -0
  124. package/dist/core/base-server-binary-manager.js.map +1 -0
  125. package/dist/core/config-manager.js +495 -0
  126. package/dist/core/config-manager.js.map +1 -0
  127. package/dist/core/container-manager.js +609 -0
  128. package/dist/core/container-manager.js.map +1 -0
  129. package/dist/core/credential-generator.js +67 -0
  130. package/dist/core/credential-generator.js.map +1 -0
  131. package/dist/core/credential-manager.js +211 -0
  132. package/dist/core/credential-manager.js.map +1 -0
  133. package/dist/core/dblab-utils.js +105 -0
  134. package/dist/core/dblab-utils.js.map +1 -0
  135. package/dist/core/dependency-manager.js +359 -0
  136. package/dist/core/dependency-manager.js.map +1 -0
  137. package/dist/core/docker-exporter.js +1077 -0
  138. package/dist/core/docker-exporter.js.map +1 -0
  139. package/dist/core/error-handler.js +295 -0
  140. package/dist/core/error-handler.js.map +1 -0
  141. package/dist/core/fs-error-utils.js +74 -0
  142. package/dist/core/fs-error-utils.js.map +1 -0
  143. package/dist/core/homebrew-version-manager.js +280 -0
  144. package/dist/core/homebrew-version-manager.js.map +1 -0
  145. package/dist/core/hostdb-client.js +252 -0
  146. package/dist/core/hostdb-client.js.map +1 -0
  147. package/dist/core/hostdb-metadata.js +243 -0
  148. package/dist/core/hostdb-metadata.js.map +1 -0
  149. package/dist/core/hostdb-releases-factory.js +161 -0
  150. package/dist/core/hostdb-releases-factory.js.map +1 -0
  151. package/dist/core/library-env.js +88 -0
  152. package/dist/core/library-env.js.map +1 -0
  153. package/dist/core/pgweb-utils.js +53 -0
  154. package/dist/core/pgweb-utils.js.map +1 -0
  155. package/dist/core/platform-service.js +632 -0
  156. package/dist/core/platform-service.js.map +1 -0
  157. package/dist/core/port-manager.js +136 -0
  158. package/dist/core/port-manager.js.map +1 -0
  159. package/dist/core/process-manager.js +445 -0
  160. package/dist/core/process-manager.js.map +1 -0
  161. package/dist/core/pull-manager.js +418 -0
  162. package/dist/core/pull-manager.js.map +1 -0
  163. package/dist/core/query-parser.js +449 -0
  164. package/dist/core/query-parser.js.map +1 -0
  165. package/dist/core/spawn-utils.js +90 -0
  166. package/dist/core/spawn-utils.js.map +1 -0
  167. package/dist/core/start-with-retry.js +90 -0
  168. package/dist/core/start-with-retry.js.map +1 -0
  169. package/dist/core/test-cleanup.js +85 -0
  170. package/dist/core/test-cleanup.js.map +1 -0
  171. package/dist/core/tls-generator.js +84 -0
  172. package/dist/core/tls-generator.js.map +1 -0
  173. package/dist/core/transaction-manager.js +139 -0
  174. package/dist/core/transaction-manager.js.map +1 -0
  175. package/dist/core/update-manager.js +241 -0
  176. package/dist/core/update-manager.js.map +1 -0
  177. package/dist/core/version-migration.js +260 -0
  178. package/dist/core/version-migration.js.map +1 -0
  179. package/dist/core/version-utils.js +91 -0
  180. package/dist/core/version-utils.js.map +1 -0
  181. package/dist/engines/base-engine.js +179 -0
  182. package/dist/engines/base-engine.js.map +1 -0
  183. package/dist/engines/clickhouse/backup.js +289 -0
  184. package/dist/engines/clickhouse/backup.js.map +1 -0
  185. package/dist/engines/clickhouse/binary-manager.js +145 -0
  186. package/dist/engines/clickhouse/binary-manager.js.map +1 -0
  187. package/dist/engines/clickhouse/binary-urls.js +100 -0
  188. package/dist/engines/clickhouse/binary-urls.js.map +1 -0
  189. package/dist/engines/clickhouse/cli-utils.js +143 -0
  190. package/dist/engines/clickhouse/cli-utils.js.map +1 -0
  191. package/dist/engines/clickhouse/hostdb-releases.js +24 -0
  192. package/dist/engines/clickhouse/hostdb-releases.js.map +1 -0
  193. package/dist/engines/clickhouse/index.js +1077 -0
  194. package/dist/engines/clickhouse/index.js.map +1 -0
  195. package/dist/engines/clickhouse/restore.js +335 -0
  196. package/dist/engines/clickhouse/restore.js.map +1 -0
  197. package/dist/engines/clickhouse/version-maps.js +83 -0
  198. package/dist/engines/clickhouse/version-maps.js.map +1 -0
  199. package/dist/engines/clickhouse/version-validator.js +133 -0
  200. package/dist/engines/clickhouse/version-validator.js.map +1 -0
  201. package/dist/engines/cockroachdb/backup.js +261 -0
  202. package/dist/engines/cockroachdb/backup.js.map +1 -0
  203. package/dist/engines/cockroachdb/binary-manager.js +33 -0
  204. package/dist/engines/cockroachdb/binary-manager.js.map +1 -0
  205. package/dist/engines/cockroachdb/binary-urls.js +33 -0
  206. package/dist/engines/cockroachdb/binary-urls.js.map +1 -0
  207. package/dist/engines/cockroachdb/cli-utils.js +338 -0
  208. package/dist/engines/cockroachdb/cli-utils.js.map +1 -0
  209. package/dist/engines/cockroachdb/hostdb-releases.js +21 -0
  210. package/dist/engines/cockroachdb/hostdb-releases.js.map +1 -0
  211. package/dist/engines/cockroachdb/index.js +1016 -0
  212. package/dist/engines/cockroachdb/index.js.map +1 -0
  213. package/dist/engines/cockroachdb/restore.js +323 -0
  214. package/dist/engines/cockroachdb/restore.js.map +1 -0
  215. package/dist/engines/cockroachdb/version-maps.js +37 -0
  216. package/dist/engines/cockroachdb/version-maps.js.map +1 -0
  217. package/dist/engines/couchdb/api-client.js +64 -0
  218. package/dist/engines/couchdb/api-client.js.map +1 -0
  219. package/dist/engines/couchdb/backup.js +90 -0
  220. package/dist/engines/couchdb/backup.js.map +1 -0
  221. package/dist/engines/couchdb/binary-manager.js +62 -0
  222. package/dist/engines/couchdb/binary-manager.js.map +1 -0
  223. package/dist/engines/couchdb/binary-urls.js +92 -0
  224. package/dist/engines/couchdb/binary-urls.js.map +1 -0
  225. package/dist/engines/couchdb/hostdb-releases.js +21 -0
  226. package/dist/engines/couchdb/hostdb-releases.js.map +1 -0
  227. package/dist/engines/couchdb/index.js +1043 -0
  228. package/dist/engines/couchdb/index.js.map +1 -0
  229. package/dist/engines/couchdb/restore.js +198 -0
  230. package/dist/engines/couchdb/restore.js.map +1 -0
  231. package/dist/engines/couchdb/version-maps.js +67 -0
  232. package/dist/engines/couchdb/version-maps.js.map +1 -0
  233. package/dist/engines/couchdb/version-validator.js +88 -0
  234. package/dist/engines/couchdb/version-validator.js.map +1 -0
  235. package/dist/engines/duckdb/binary-manager.js +33 -0
  236. package/dist/engines/duckdb/binary-manager.js.map +1 -0
  237. package/{engines/duckdb/binary-urls.ts → dist/engines/duckdb/binary-urls.js} +11 -16
  238. package/dist/engines/duckdb/binary-urls.js.map +1 -0
  239. package/dist/engines/duckdb/hostdb-releases.js +21 -0
  240. package/dist/engines/duckdb/hostdb-releases.js.map +1 -0
  241. package/dist/engines/duckdb/index.js +594 -0
  242. package/dist/engines/duckdb/index.js.map +1 -0
  243. package/dist/engines/duckdb/registry.js +265 -0
  244. package/dist/engines/duckdb/registry.js.map +1 -0
  245. package/dist/engines/duckdb/scanner.js +12 -0
  246. package/dist/engines/duckdb/scanner.js.map +1 -0
  247. package/dist/engines/duckdb/version-maps.js +67 -0
  248. package/dist/engines/duckdb/version-maps.js.map +1 -0
  249. package/dist/engines/duckdb/version-validator.js +62 -0
  250. package/dist/engines/duckdb/version-validator.js.map +1 -0
  251. package/dist/engines/ferretdb/backup.js +170 -0
  252. package/dist/engines/ferretdb/backup.js.map +1 -0
  253. package/dist/engines/ferretdb/binary-manager.js +765 -0
  254. package/dist/engines/ferretdb/binary-manager.js.map +1 -0
  255. package/dist/engines/ferretdb/binary-urls.js +135 -0
  256. package/dist/engines/ferretdb/binary-urls.js.map +1 -0
  257. package/dist/engines/ferretdb/index.js +1517 -0
  258. package/dist/engines/ferretdb/index.js.map +1 -0
  259. package/dist/engines/ferretdb/restore.js +310 -0
  260. package/dist/engines/ferretdb/restore.js.map +1 -0
  261. package/{engines/ferretdb/version-maps.ts → dist/engines/ferretdb/version-maps.js} +62 -79
  262. package/dist/engines/ferretdb/version-maps.js.map +1 -0
  263. package/dist/engines/file-based-utils.js +184 -0
  264. package/dist/engines/file-based-utils.js.map +1 -0
  265. package/dist/engines/index.js +124 -0
  266. package/dist/engines/index.js.map +1 -0
  267. package/dist/engines/influxdb/api-client.js +54 -0
  268. package/dist/engines/influxdb/api-client.js.map +1 -0
  269. package/dist/engines/influxdb/backup.js +119 -0
  270. package/dist/engines/influxdb/backup.js.map +1 -0
  271. package/dist/engines/influxdb/binary-manager.js +87 -0
  272. package/dist/engines/influxdb/binary-manager.js.map +1 -0
  273. package/dist/engines/influxdb/binary-urls.js +56 -0
  274. package/dist/engines/influxdb/binary-urls.js.map +1 -0
  275. package/dist/engines/influxdb/hostdb-releases.js +21 -0
  276. package/dist/engines/influxdb/hostdb-releases.js.map +1 -0
  277. package/dist/engines/influxdb/index.js +962 -0
  278. package/dist/engines/influxdb/index.js.map +1 -0
  279. package/dist/engines/influxdb/restore.js +329 -0
  280. package/dist/engines/influxdb/restore.js.map +1 -0
  281. package/dist/engines/influxdb/version-maps.js +64 -0
  282. package/dist/engines/influxdb/version-maps.js.map +1 -0
  283. package/dist/engines/influxdb/version-validator.js +109 -0
  284. package/dist/engines/influxdb/version-validator.js.map +1 -0
  285. package/dist/engines/mariadb/backup.js +178 -0
  286. package/dist/engines/mariadb/backup.js.map +1 -0
  287. package/dist/engines/mariadb/binary-manager.js +33 -0
  288. package/dist/engines/mariadb/binary-manager.js.map +1 -0
  289. package/{engines/mariadb/binary-urls.ts → dist/engines/mariadb/binary-urls.js} +38 -55
  290. package/dist/engines/mariadb/binary-urls.js.map +1 -0
  291. package/dist/engines/mariadb/hostdb-releases.js +21 -0
  292. package/dist/engines/mariadb/hostdb-releases.js.map +1 -0
  293. package/dist/engines/mariadb/index.js +1011 -0
  294. package/dist/engines/mariadb/index.js.map +1 -0
  295. package/dist/engines/mariadb/restore.js +322 -0
  296. package/dist/engines/mariadb/restore.js.map +1 -0
  297. package/dist/engines/mariadb/version-maps.js +63 -0
  298. package/dist/engines/mariadb/version-maps.js.map +1 -0
  299. package/dist/engines/mariadb/version-validator.js +143 -0
  300. package/dist/engines/mariadb/version-validator.js.map +1 -0
  301. package/dist/engines/meilisearch/api-client.js +50 -0
  302. package/dist/engines/meilisearch/api-client.js.map +1 -0
  303. package/dist/engines/meilisearch/backup.js +167 -0
  304. package/dist/engines/meilisearch/backup.js.map +1 -0
  305. package/dist/engines/meilisearch/binary-manager.js +31 -0
  306. package/dist/engines/meilisearch/binary-manager.js.map +1 -0
  307. package/dist/engines/meilisearch/binary-urls.js +56 -0
  308. package/dist/engines/meilisearch/binary-urls.js.map +1 -0
  309. package/dist/engines/meilisearch/hostdb-releases.js +21 -0
  310. package/dist/engines/meilisearch/hostdb-releases.js.map +1 -0
  311. package/dist/engines/meilisearch/index.js +992 -0
  312. package/dist/engines/meilisearch/index.js.map +1 -0
  313. package/dist/engines/meilisearch/restore.js +167 -0
  314. package/dist/engines/meilisearch/restore.js.map +1 -0
  315. package/dist/engines/meilisearch/version-maps.js +67 -0
  316. package/dist/engines/meilisearch/version-maps.js.map +1 -0
  317. package/dist/engines/meilisearch/version-validator.js +109 -0
  318. package/dist/engines/meilisearch/version-validator.js.map +1 -0
  319. package/dist/engines/mongodb/backup.js +109 -0
  320. package/dist/engines/mongodb/backup.js.map +1 -0
  321. package/dist/engines/mongodb/binary-manager.js +36 -0
  322. package/dist/engines/mongodb/binary-manager.js.map +1 -0
  323. package/dist/engines/mongodb/binary-urls.js +46 -0
  324. package/dist/engines/mongodb/binary-urls.js.map +1 -0
  325. package/dist/engines/mongodb/cli-utils.js +131 -0
  326. package/dist/engines/mongodb/cli-utils.js.map +1 -0
  327. package/dist/engines/mongodb/hostdb-releases.js +77 -0
  328. package/dist/engines/mongodb/hostdb-releases.js.map +1 -0
  329. package/dist/engines/mongodb/index.js +873 -0
  330. package/dist/engines/mongodb/index.js.map +1 -0
  331. package/dist/engines/mongodb/restore.js +276 -0
  332. package/dist/engines/mongodb/restore.js.map +1 -0
  333. package/dist/engines/mongodb/version-maps.js +79 -0
  334. package/dist/engines/mongodb/version-maps.js.map +1 -0
  335. package/dist/engines/mongodb/version-validator.js +133 -0
  336. package/dist/engines/mongodb/version-validator.js.map +1 -0
  337. package/dist/engines/mysql/backup.js +210 -0
  338. package/dist/engines/mysql/backup.js.map +1 -0
  339. package/dist/engines/mysql/binary-detection.js +325 -0
  340. package/dist/engines/mysql/binary-detection.js.map +1 -0
  341. package/dist/engines/mysql/binary-manager.js +30 -0
  342. package/dist/engines/mysql/binary-manager.js.map +1 -0
  343. package/dist/engines/mysql/binary-urls.js +87 -0
  344. package/dist/engines/mysql/binary-urls.js.map +1 -0
  345. package/{engines/mysql/hostdb-releases.ts → dist/engines/mysql/hostdb-releases.js} +20 -23
  346. package/dist/engines/mysql/hostdb-releases.js.map +1 -0
  347. package/dist/engines/mysql/index.js +1066 -0
  348. package/dist/engines/mysql/index.js.map +1 -0
  349. package/dist/engines/mysql/restore.js +361 -0
  350. package/dist/engines/mysql/restore.js.map +1 -0
  351. package/dist/engines/mysql/version-maps.js +79 -0
  352. package/dist/engines/mysql/version-maps.js.map +1 -0
  353. package/dist/engines/mysql/version-validator.js +266 -0
  354. package/dist/engines/mysql/version-validator.js.map +1 -0
  355. package/dist/engines/postgresql/backup.js +118 -0
  356. package/dist/engines/postgresql/backup.js.map +1 -0
  357. package/dist/engines/postgresql/binary-manager.js +85 -0
  358. package/dist/engines/postgresql/binary-manager.js.map +1 -0
  359. package/dist/engines/postgresql/binary-urls.js +80 -0
  360. package/dist/engines/postgresql/binary-urls.js.map +1 -0
  361. package/dist/engines/postgresql/hostdb-releases.js +21 -0
  362. package/dist/engines/postgresql/hostdb-releases.js.map +1 -0
  363. package/dist/engines/postgresql/index.js +852 -0
  364. package/dist/engines/postgresql/index.js.map +1 -0
  365. package/dist/engines/postgresql/remote-version.js +109 -0
  366. package/dist/engines/postgresql/remote-version.js.map +1 -0
  367. package/dist/engines/postgresql/restore.js +254 -0
  368. package/dist/engines/postgresql/restore.js.map +1 -0
  369. package/dist/engines/postgresql/version-maps.js +73 -0
  370. package/dist/engines/postgresql/version-maps.js.map +1 -0
  371. package/dist/engines/postgresql/version-validator.js +286 -0
  372. package/dist/engines/postgresql/version-validator.js.map +1 -0
  373. package/dist/engines/qdrant/api-client.js +50 -0
  374. package/dist/engines/qdrant/api-client.js.map +1 -0
  375. package/dist/engines/qdrant/backup.js +115 -0
  376. package/dist/engines/qdrant/backup.js.map +1 -0
  377. package/dist/engines/qdrant/binary-manager.js +31 -0
  378. package/dist/engines/qdrant/binary-manager.js.map +1 -0
  379. package/dist/engines/qdrant/binary-urls.js +92 -0
  380. package/dist/engines/qdrant/binary-urls.js.map +1 -0
  381. package/dist/engines/qdrant/cli-utils.js +39 -0
  382. package/dist/engines/qdrant/cli-utils.js.map +1 -0
  383. package/dist/engines/qdrant/hostdb-releases.js +21 -0
  384. package/dist/engines/qdrant/hostdb-releases.js.map +1 -0
  385. package/dist/engines/qdrant/index.js +1002 -0
  386. package/dist/engines/qdrant/index.js.map +1 -0
  387. package/dist/engines/qdrant/restore.js +154 -0
  388. package/dist/engines/qdrant/restore.js.map +1 -0
  389. package/dist/engines/qdrant/version-maps.js +67 -0
  390. package/dist/engines/qdrant/version-maps.js.map +1 -0
  391. package/dist/engines/qdrant/version-validator.js +109 -0
  392. package/dist/engines/qdrant/version-validator.js.map +1 -0
  393. package/dist/engines/questdb/backup.js +191 -0
  394. package/dist/engines/questdb/backup.js.map +1 -0
  395. package/dist/engines/questdb/binary-manager.js +247 -0
  396. package/dist/engines/questdb/binary-manager.js.map +1 -0
  397. package/dist/engines/questdb/binary-urls.js +27 -0
  398. package/dist/engines/questdb/binary-urls.js.map +1 -0
  399. package/dist/engines/questdb/hostdb-releases.js +21 -0
  400. package/dist/engines/questdb/hostdb-releases.js.map +1 -0
  401. package/dist/engines/questdb/index.js +814 -0
  402. package/dist/engines/questdb/index.js.map +1 -0
  403. package/dist/engines/questdb/restore.js +202 -0
  404. package/dist/engines/questdb/restore.js.map +1 -0
  405. package/dist/engines/questdb/version-maps.js +33 -0
  406. package/dist/engines/questdb/version-maps.js.map +1 -0
  407. package/dist/engines/questdb/version-validator.js +99 -0
  408. package/dist/engines/questdb/version-validator.js.map +1 -0
  409. package/dist/engines/redis/backup.js +292 -0
  410. package/dist/engines/redis/backup.js.map +1 -0
  411. package/dist/engines/redis/binary-manager.js +32 -0
  412. package/dist/engines/redis/binary-manager.js.map +1 -0
  413. package/dist/engines/redis/binary-urls.js +96 -0
  414. package/dist/engines/redis/binary-urls.js.map +1 -0
  415. package/dist/engines/redis/cli-utils.js +38 -0
  416. package/dist/engines/redis/cli-utils.js.map +1 -0
  417. package/dist/engines/redis/hostdb-releases.js +21 -0
  418. package/dist/engines/redis/hostdb-releases.js.map +1 -0
  419. package/dist/engines/redis/index.js +1263 -0
  420. package/dist/engines/redis/index.js.map +1 -0
  421. package/dist/engines/redis/restore.js +338 -0
  422. package/dist/engines/redis/restore.js.map +1 -0
  423. package/dist/engines/redis/version-maps.js +70 -0
  424. package/dist/engines/redis/version-maps.js.map +1 -0
  425. package/dist/engines/redis/version-validator.js +109 -0
  426. package/dist/engines/redis/version-validator.js.map +1 -0
  427. package/dist/engines/sqlite/binary-manager.js +39 -0
  428. package/dist/engines/sqlite/binary-manager.js.map +1 -0
  429. package/{engines/sqlite/binary-urls.ts → dist/engines/sqlite/binary-urls.js} +11 -16
  430. package/dist/engines/sqlite/binary-urls.js.map +1 -0
  431. package/dist/engines/sqlite/hostdb-releases.js +21 -0
  432. package/dist/engines/sqlite/hostdb-releases.js.map +1 -0
  433. package/dist/engines/sqlite/index.js +493 -0
  434. package/dist/engines/sqlite/index.js.map +1 -0
  435. package/dist/engines/sqlite/registry.js +163 -0
  436. package/dist/engines/sqlite/registry.js.map +1 -0
  437. package/dist/engines/sqlite/scanner.js +12 -0
  438. package/dist/engines/sqlite/scanner.js.map +1 -0
  439. package/dist/engines/sqlite/version-maps.js +57 -0
  440. package/dist/engines/sqlite/version-maps.js.map +1 -0
  441. package/dist/engines/surrealdb/backup.js +97 -0
  442. package/dist/engines/surrealdb/backup.js.map +1 -0
  443. package/dist/engines/surrealdb/binary-manager.js +33 -0
  444. package/dist/engines/surrealdb/binary-manager.js.map +1 -0
  445. package/dist/engines/surrealdb/binary-urls.js +33 -0
  446. package/dist/engines/surrealdb/binary-urls.js.map +1 -0
  447. package/dist/engines/surrealdb/cli-utils.js +147 -0
  448. package/dist/engines/surrealdb/cli-utils.js.map +1 -0
  449. package/dist/engines/surrealdb/hostdb-releases.js +21 -0
  450. package/dist/engines/surrealdb/hostdb-releases.js.map +1 -0
  451. package/dist/engines/surrealdb/index.js +1022 -0
  452. package/dist/engines/surrealdb/index.js.map +1 -0
  453. package/dist/engines/surrealdb/restore.js +224 -0
  454. package/dist/engines/surrealdb/restore.js.map +1 -0
  455. package/dist/engines/surrealdb/version-maps.js +36 -0
  456. package/dist/engines/surrealdb/version-maps.js.map +1 -0
  457. package/dist/engines/tigerbeetle/backup.js +36 -0
  458. package/dist/engines/tigerbeetle/backup.js.map +1 -0
  459. package/dist/engines/tigerbeetle/binary-manager.js +72 -0
  460. package/dist/engines/tigerbeetle/binary-manager.js.map +1 -0
  461. package/dist/engines/tigerbeetle/binary-urls.js +49 -0
  462. package/dist/engines/tigerbeetle/binary-urls.js.map +1 -0
  463. package/dist/engines/tigerbeetle/hostdb-releases.js +21 -0
  464. package/dist/engines/tigerbeetle/hostdb-releases.js.map +1 -0
  465. package/dist/engines/tigerbeetle/index.js +559 -0
  466. package/dist/engines/tigerbeetle/index.js.map +1 -0
  467. package/dist/engines/tigerbeetle/restore.js +91 -0
  468. package/dist/engines/tigerbeetle/restore.js.map +1 -0
  469. package/{engines/tigerbeetle/version-maps.ts → dist/engines/tigerbeetle/version-maps.js} +22 -31
  470. package/dist/engines/tigerbeetle/version-maps.js.map +1 -0
  471. package/dist/engines/tigerbeetle/version-validator.js +108 -0
  472. package/dist/engines/tigerbeetle/version-validator.js.map +1 -0
  473. package/dist/engines/typedb/backup.js +129 -0
  474. package/dist/engines/typedb/backup.js.map +1 -0
  475. package/dist/engines/typedb/binary-manager.js +151 -0
  476. package/dist/engines/typedb/binary-manager.js.map +1 -0
  477. package/dist/engines/typedb/binary-urls.js +33 -0
  478. package/dist/engines/typedb/binary-urls.js.map +1 -0
  479. package/dist/engines/typedb/cli-utils.js +163 -0
  480. package/dist/engines/typedb/cli-utils.js.map +1 -0
  481. package/dist/engines/typedb/hostdb-releases.js +21 -0
  482. package/dist/engines/typedb/hostdb-releases.js.map +1 -0
  483. package/dist/engines/typedb/index.js +1003 -0
  484. package/dist/engines/typedb/index.js.map +1 -0
  485. package/dist/engines/typedb/restore.js +279 -0
  486. package/dist/engines/typedb/restore.js.map +1 -0
  487. package/dist/engines/typedb/version-maps.js +40 -0
  488. package/dist/engines/typedb/version-maps.js.map +1 -0
  489. package/dist/engines/typedb/version-validator.js +103 -0
  490. package/dist/engines/typedb/version-validator.js.map +1 -0
  491. package/dist/engines/valkey/backup.js +292 -0
  492. package/dist/engines/valkey/backup.js.map +1 -0
  493. package/dist/engines/valkey/binary-manager.js +33 -0
  494. package/dist/engines/valkey/binary-manager.js.map +1 -0
  495. package/dist/engines/valkey/binary-urls.js +98 -0
  496. package/dist/engines/valkey/binary-urls.js.map +1 -0
  497. package/dist/engines/valkey/cli-utils.js +38 -0
  498. package/dist/engines/valkey/cli-utils.js.map +1 -0
  499. package/dist/engines/valkey/hostdb-releases.js +21 -0
  500. package/dist/engines/valkey/hostdb-releases.js.map +1 -0
  501. package/dist/engines/valkey/index.js +1257 -0
  502. package/dist/engines/valkey/index.js.map +1 -0
  503. package/dist/engines/valkey/restore.js +340 -0
  504. package/dist/engines/valkey/restore.js.map +1 -0
  505. package/dist/engines/valkey/version-maps.js +70 -0
  506. package/dist/engines/valkey/version-maps.js.map +1 -0
  507. package/dist/engines/valkey/version-validator.js +112 -0
  508. package/dist/engines/valkey/version-validator.js.map +1 -0
  509. package/dist/engines/weaviate/api-client.js +50 -0
  510. package/dist/engines/weaviate/api-client.js.map +1 -0
  511. package/dist/engines/weaviate/backup.js +95 -0
  512. package/dist/engines/weaviate/backup.js.map +1 -0
  513. package/dist/engines/weaviate/binary-manager.js +58 -0
  514. package/dist/engines/weaviate/binary-manager.js.map +1 -0
  515. package/dist/engines/weaviate/binary-urls.js +92 -0
  516. package/dist/engines/weaviate/binary-urls.js.map +1 -0
  517. package/dist/engines/weaviate/cli-utils.js +39 -0
  518. package/dist/engines/weaviate/cli-utils.js.map +1 -0
  519. package/dist/engines/weaviate/hostdb-releases.js +21 -0
  520. package/dist/engines/weaviate/hostdb-releases.js.map +1 -0
  521. package/dist/engines/weaviate/index.js +871 -0
  522. package/dist/engines/weaviate/index.js.map +1 -0
  523. package/dist/engines/weaviate/restore.js +185 -0
  524. package/dist/engines/weaviate/restore.js.map +1 -0
  525. package/dist/engines/weaviate/version-maps.js +67 -0
  526. package/dist/engines/weaviate/version-maps.js.map +1 -0
  527. package/dist/engines/weaviate/version-validator.js +109 -0
  528. package/dist/engines/weaviate/version-validator.js.map +1 -0
  529. package/dist/types/index.js +102 -0
  530. package/dist/types/index.js.map +1 -0
  531. package/package.json +12 -9
  532. package/bin/cli.js +0 -68
  533. package/cli/bin.ts +0 -10
  534. package/cli/commands/attach.ts +0 -139
  535. package/cli/commands/backup.ts +0 -290
  536. package/cli/commands/backups.ts +0 -247
  537. package/cli/commands/clone.ts +0 -159
  538. package/cli/commands/config.ts +0 -367
  539. package/cli/commands/connect.ts +0 -684
  540. package/cli/commands/create.ts +0 -1201
  541. package/cli/commands/databases.ts +0 -630
  542. package/cli/commands/delete.ts +0 -133
  543. package/cli/commands/deps.ts +0 -342
  544. package/cli/commands/detach.ts +0 -107
  545. package/cli/commands/doctor.ts +0 -689
  546. package/cli/commands/duckdb.ts +0 -273
  547. package/cli/commands/edit.ts +0 -683
  548. package/cli/commands/engines.ts +0 -1914
  549. package/cli/commands/export.ts +0 -544
  550. package/cli/commands/info.ts +0 -340
  551. package/cli/commands/list.ts +0 -284
  552. package/cli/commands/logs.ts +0 -102
  553. package/cli/commands/menu/backup-handlers.ts +0 -1571
  554. package/cli/commands/menu/container-handlers.ts +0 -2288
  555. package/cli/commands/menu/engine-handlers.ts +0 -355
  556. package/cli/commands/menu/index.ts +0 -342
  557. package/cli/commands/menu/settings-handlers.ts +0 -365
  558. package/cli/commands/menu/shared.ts +0 -23
  559. package/cli/commands/menu/shell-handlers.ts +0 -1811
  560. package/cli/commands/menu/sql-handlers.ts +0 -231
  561. package/cli/commands/menu/update-handlers.ts +0 -378
  562. package/cli/commands/menu/validators.ts +0 -8
  563. package/cli/commands/ports.ts +0 -211
  564. package/cli/commands/pull.ts +0 -223
  565. package/cli/commands/query.ts +0 -241
  566. package/cli/commands/restore.ts +0 -587
  567. package/cli/commands/run.ts +0 -178
  568. package/cli/commands/self-update.ts +0 -121
  569. package/cli/commands/sqlite.ts +0 -273
  570. package/cli/commands/start.ts +0 -218
  571. package/cli/commands/stop.ts +0 -241
  572. package/cli/commands/url.ts +0 -104
  573. package/cli/commands/users.ts +0 -264
  574. package/cli/commands/version.ts +0 -55
  575. package/cli/commands/which.ts +0 -290
  576. package/cli/constants.ts +0 -233
  577. package/cli/helpers.ts +0 -1593
  578. package/cli/index.ts +0 -162
  579. package/cli/ui/prompts.ts +0 -1525
  580. package/cli/ui/spinner.ts +0 -88
  581. package/cli/ui/theme.ts +0 -128
  582. package/cli/utils/file-follower.ts +0 -93
  583. package/config/backup-formats.ts +0 -446
  584. package/config/defaults.ts +0 -56
  585. package/config/engine-defaults.ts +0 -336
  586. package/config/engines-registry.ts +0 -150
  587. package/config/engines.schema.json +0 -135
  588. package/config/os-dependencies.ts +0 -888
  589. package/config/paths.ts +0 -200
  590. package/core/backup-restore.ts +0 -330
  591. package/core/base-binary-manager.ts +0 -562
  592. package/core/base-document-binary-manager.ts +0 -523
  593. package/core/base-embedded-binary-manager.ts +0 -547
  594. package/core/base-server-binary-manager.ts +0 -523
  595. package/core/config-manager.ts +0 -652
  596. package/core/container-manager.ts +0 -787
  597. package/core/credential-generator.ts +0 -93
  598. package/core/credential-manager.ts +0 -259
  599. package/core/dblab-utils.ts +0 -113
  600. package/core/dependency-manager.ts +0 -512
  601. package/core/docker-exporter.ts +0 -1345
  602. package/core/error-handler.ts +0 -419
  603. package/core/fs-error-utils.ts +0 -82
  604. package/core/homebrew-version-manager.ts +0 -352
  605. package/core/hostdb-client.ts +0 -344
  606. package/core/hostdb-metadata.ts +0 -350
  607. package/core/hostdb-releases-factory.ts +0 -237
  608. package/core/library-env.ts +0 -118
  609. package/core/pgweb-utils.ts +0 -62
  610. package/core/platform-service.ts +0 -829
  611. package/core/port-manager.ts +0 -165
  612. package/core/process-manager.ts +0 -576
  613. package/core/pull-manager.ts +0 -511
  614. package/core/query-parser.ts +0 -514
  615. package/core/spawn-utils.ts +0 -122
  616. package/core/start-with-retry.ts +0 -130
  617. package/core/test-cleanup.ts +0 -108
  618. package/core/tls-generator.ts +0 -116
  619. package/core/transaction-manager.ts +0 -158
  620. package/core/update-manager.ts +0 -308
  621. package/core/version-migration.ts +0 -346
  622. package/core/version-utils.ts +0 -104
  623. package/engines/base-engine.ts +0 -340
  624. package/engines/clickhouse/README.md +0 -231
  625. package/engines/clickhouse/backup.ts +0 -398
  626. package/engines/clickhouse/binary-manager.ts +0 -201
  627. package/engines/clickhouse/binary-urls.ts +0 -125
  628. package/engines/clickhouse/cli-utils.ts +0 -176
  629. package/engines/clickhouse/hostdb-releases.ts +0 -30
  630. package/engines/clickhouse/index.ts +0 -1345
  631. package/engines/clickhouse/restore.ts +0 -466
  632. package/engines/clickhouse/version-maps.ts +0 -95
  633. package/engines/clickhouse/version-validator.ts +0 -154
  634. package/engines/cockroachdb/README.md +0 -170
  635. package/engines/cockroachdb/backup.ts +0 -376
  636. package/engines/cockroachdb/binary-manager.ts +0 -45
  637. package/engines/cockroachdb/binary-urls.ts +0 -40
  638. package/engines/cockroachdb/cli-utils.ts +0 -384
  639. package/engines/cockroachdb/hostdb-releases.ts +0 -26
  640. package/engines/cockroachdb/index.ts +0 -1276
  641. package/engines/cockroachdb/restore.ts +0 -455
  642. package/engines/cockroachdb/version-maps.ts +0 -42
  643. package/engines/couchdb/README.md +0 -257
  644. package/engines/couchdb/api-client.ts +0 -81
  645. package/engines/couchdb/backup.ts +0 -137
  646. package/engines/couchdb/binary-manager.ts +0 -86
  647. package/engines/couchdb/binary-urls.ts +0 -115
  648. package/engines/couchdb/hostdb-releases.ts +0 -23
  649. package/engines/couchdb/index.ts +0 -1429
  650. package/engines/couchdb/restore.ts +0 -290
  651. package/engines/couchdb/version-maps.ts +0 -78
  652. package/engines/couchdb/version-validator.ts +0 -111
  653. package/engines/duckdb/README.md +0 -154
  654. package/engines/duckdb/binary-manager.ts +0 -45
  655. package/engines/duckdb/hostdb-releases.ts +0 -23
  656. package/engines/duckdb/index.ts +0 -749
  657. package/engines/duckdb/registry.ts +0 -303
  658. package/engines/duckdb/scanner.ts +0 -22
  659. package/engines/duckdb/version-maps.ts +0 -78
  660. package/engines/duckdb/version-validator.ts +0 -78
  661. package/engines/ferretdb/README.md +0 -262
  662. package/engines/ferretdb/backup.ts +0 -173
  663. package/engines/ferretdb/binary-manager.ts +0 -1095
  664. package/engines/ferretdb/binary-urls.ts +0 -183
  665. package/engines/ferretdb/index.ts +0 -1907
  666. package/engines/ferretdb/restore.ts +0 -357
  667. package/engines/file-based-utils.ts +0 -262
  668. package/engines/index.ts +0 -131
  669. package/engines/influxdb/README.md +0 -180
  670. package/engines/influxdb/api-client.ts +0 -64
  671. package/engines/influxdb/backup.ts +0 -160
  672. package/engines/influxdb/binary-manager.ts +0 -110
  673. package/engines/influxdb/binary-urls.ts +0 -69
  674. package/engines/influxdb/hostdb-releases.ts +0 -23
  675. package/engines/influxdb/index.ts +0 -1272
  676. package/engines/influxdb/restore.ts +0 -417
  677. package/engines/influxdb/version-maps.ts +0 -75
  678. package/engines/influxdb/version-validator.ts +0 -128
  679. package/engines/mariadb/README.md +0 -141
  680. package/engines/mariadb/backup.ts +0 -233
  681. package/engines/mariadb/binary-manager.ts +0 -45
  682. package/engines/mariadb/hostdb-releases.ts +0 -23
  683. package/engines/mariadb/index.ts +0 -1300
  684. package/engines/mariadb/restore.ts +0 -447
  685. package/engines/mariadb/version-maps.ts +0 -72
  686. package/engines/mariadb/version-validator.ts +0 -181
  687. package/engines/meilisearch/README.md +0 -255
  688. package/engines/meilisearch/api-client.ts +0 -61
  689. package/engines/meilisearch/backup.ts +0 -233
  690. package/engines/meilisearch/binary-manager.ts +0 -43
  691. package/engines/meilisearch/binary-urls.ts +0 -69
  692. package/engines/meilisearch/hostdb-releases.ts +0 -26
  693. package/engines/meilisearch/index.ts +0 -1292
  694. package/engines/meilisearch/restore.ts +0 -219
  695. package/engines/meilisearch/version-maps.ts +0 -78
  696. package/engines/meilisearch/version-validator.ts +0 -128
  697. package/engines/mongodb/README.md +0 -162
  698. package/engines/mongodb/backup.ts +0 -127
  699. package/engines/mongodb/binary-manager.ts +0 -48
  700. package/engines/mongodb/binary-urls.ts +0 -63
  701. package/engines/mongodb/cli-utils.ts +0 -171
  702. package/engines/mongodb/hostdb-releases.ts +0 -91
  703. package/engines/mongodb/index.ts +0 -1118
  704. package/engines/mongodb/restore.ts +0 -361
  705. package/engines/mongodb/version-maps.ts +0 -91
  706. package/engines/mongodb/version-validator.ts +0 -160
  707. package/engines/mysql/README.md +0 -142
  708. package/engines/mysql/backup.ts +0 -270
  709. package/engines/mysql/binary-detection.ts +0 -408
  710. package/engines/mysql/binary-manager.ts +0 -42
  711. package/engines/mysql/binary-urls.ts +0 -104
  712. package/engines/mysql/index.ts +0 -1361
  713. package/engines/mysql/restore.ts +0 -500
  714. package/engines/mysql/version-maps.ts +0 -91
  715. package/engines/mysql/version-validator.ts +0 -369
  716. package/engines/postgresql/README.md +0 -158
  717. package/engines/postgresql/backup.ts +0 -151
  718. package/engines/postgresql/binary-manager.ts +0 -114
  719. package/engines/postgresql/binary-urls.ts +0 -99
  720. package/engines/postgresql/hostdb-releases.ts +0 -26
  721. package/engines/postgresql/index.ts +0 -1143
  722. package/engines/postgresql/remote-version.ts +0 -161
  723. package/engines/postgresql/restore.ts +0 -342
  724. package/engines/postgresql/version-maps.ts +0 -83
  725. package/engines/postgresql/version-validator.ts +0 -413
  726. package/engines/qdrant/README.md +0 -222
  727. package/engines/qdrant/api-client.ts +0 -61
  728. package/engines/qdrant/backup.ts +0 -165
  729. package/engines/qdrant/binary-manager.ts +0 -43
  730. package/engines/qdrant/binary-urls.ts +0 -115
  731. package/engines/qdrant/cli-utils.ts +0 -43
  732. package/engines/qdrant/hostdb-releases.ts +0 -23
  733. package/engines/qdrant/index.ts +0 -1312
  734. package/engines/qdrant/restore.ts +0 -203
  735. package/engines/qdrant/version-maps.ts +0 -78
  736. package/engines/qdrant/version-validator.ts +0 -128
  737. package/engines/questdb/README.md +0 -334
  738. package/engines/questdb/backup.ts +0 -220
  739. package/engines/questdb/binary-manager.ts +0 -310
  740. package/engines/questdb/binary-urls.ts +0 -34
  741. package/engines/questdb/hostdb-releases.ts +0 -23
  742. package/engines/questdb/index.ts +0 -1023
  743. package/engines/questdb/restore.ts +0 -260
  744. package/engines/questdb/version-maps.ts +0 -37
  745. package/engines/questdb/version-validator.ts +0 -121
  746. package/engines/redis/README.md +0 -173
  747. package/engines/redis/backup.ts +0 -389
  748. package/engines/redis/binary-manager.ts +0 -44
  749. package/engines/redis/binary-urls.ts +0 -117
  750. package/engines/redis/cli-utils.ts +0 -42
  751. package/engines/redis/hostdb-releases.ts +0 -23
  752. package/engines/redis/index.ts +0 -1583
  753. package/engines/redis/restore.ts +0 -443
  754. package/engines/redis/version-maps.ts +0 -81
  755. package/engines/redis/version-validator.ts +0 -131
  756. package/engines/sqlite/README.md +0 -162
  757. package/engines/sqlite/binary-manager.ts +0 -52
  758. package/engines/sqlite/hostdb-releases.ts +0 -23
  759. package/engines/sqlite/index.ts +0 -641
  760. package/engines/sqlite/registry.ts +0 -198
  761. package/engines/sqlite/scanner.ts +0 -22
  762. package/engines/sqlite/version-maps.ts +0 -64
  763. package/engines/surrealdb/README.md +0 -218
  764. package/engines/surrealdb/backup.ts +0 -131
  765. package/engines/surrealdb/binary-manager.ts +0 -45
  766. package/engines/surrealdb/binary-urls.ts +0 -40
  767. package/engines/surrealdb/cli-utils.ts +0 -173
  768. package/engines/surrealdb/hostdb-releases.ts +0 -23
  769. package/engines/surrealdb/index.ts +0 -1246
  770. package/engines/surrealdb/restore.ts +0 -302
  771. package/engines/surrealdb/version-maps.ts +0 -41
  772. package/engines/tigerbeetle/README.md +0 -61
  773. package/engines/tigerbeetle/backup.ts +0 -49
  774. package/engines/tigerbeetle/binary-manager.ts +0 -95
  775. package/engines/tigerbeetle/binary-urls.ts +0 -62
  776. package/engines/tigerbeetle/hostdb-releases.ts +0 -26
  777. package/engines/tigerbeetle/index.ts +0 -746
  778. package/engines/tigerbeetle/restore.ts +0 -130
  779. package/engines/tigerbeetle/version-validator.ts +0 -126
  780. package/engines/typedb/backup.ts +0 -167
  781. package/engines/typedb/binary-manager.ts +0 -200
  782. package/engines/typedb/binary-urls.ts +0 -40
  783. package/engines/typedb/cli-utils.ts +0 -210
  784. package/engines/typedb/hostdb-releases.ts +0 -23
  785. package/engines/typedb/index.ts +0 -1275
  786. package/engines/typedb/restore.ts +0 -377
  787. package/engines/typedb/version-maps.ts +0 -48
  788. package/engines/typedb/version-validator.ts +0 -127
  789. package/engines/valkey/README.md +0 -219
  790. package/engines/valkey/backup.ts +0 -389
  791. package/engines/valkey/binary-manager.ts +0 -45
  792. package/engines/valkey/binary-urls.ts +0 -122
  793. package/engines/valkey/cli-utils.ts +0 -42
  794. package/engines/valkey/hostdb-releases.ts +0 -23
  795. package/engines/valkey/index.ts +0 -1585
  796. package/engines/valkey/restore.ts +0 -446
  797. package/engines/valkey/version-maps.ts +0 -81
  798. package/engines/valkey/version-validator.ts +0 -131
  799. package/engines/weaviate/README.md +0 -302
  800. package/engines/weaviate/api-client.ts +0 -61
  801. package/engines/weaviate/backup.ts +0 -145
  802. package/engines/weaviate/binary-manager.ts +0 -80
  803. package/engines/weaviate/binary-urls.ts +0 -115
  804. package/engines/weaviate/cli-utils.ts +0 -43
  805. package/engines/weaviate/hostdb-releases.ts +0 -23
  806. package/engines/weaviate/index.ts +0 -1139
  807. package/engines/weaviate/restore.ts +0 -235
  808. package/engines/weaviate/version-maps.ts +0 -78
  809. package/engines/weaviate/version-validator.ts +0 -128
  810. package/types/index.ts +0 -624
  811. /package/{config → dist/config}/engines.json +0 -0
@@ -1,1272 +0,0 @@
1
- import { spawn, type SpawnOptions } from 'child_process'
2
- import { existsSync } from 'fs'
3
- import { mkdir, writeFile, readFile, unlink } from 'fs/promises'
4
- import { join } from 'path'
5
- import { BaseEngine } from '../base-engine'
6
- import { paths } from '../../config/paths'
7
- import { getEngineDefaults } from '../../config/defaults'
8
- import { platformService, isWindows } from '../../core/platform-service'
9
- import { configManager } from '../../core/config-manager'
10
- import { logDebug, logWarning } from '../../core/error-handler'
11
- import { processManager } from '../../core/process-manager'
12
- import { portManager } from '../../core/port-manager'
13
- import { influxdbBinaryManager } from './binary-manager'
14
- import { getBinaryUrl } from './binary-urls'
15
- import { normalizeVersion, SUPPORTED_MAJOR_VERSIONS } from './version-maps'
16
- import { fetchAvailableVersions as fetchHostdbVersions } from './hostdb-releases'
17
- import {
18
- detectBackupFormat as detectBackupFormatImpl,
19
- restoreBackup,
20
- } from './restore'
21
- import { createBackup } from './backup'
22
- import { influxdbApiRequest } from './api-client'
23
- import {
24
- type Platform,
25
- type Arch,
26
- type ContainerConfig,
27
- type ProgressCallback,
28
- type BackupFormat,
29
- type BackupOptions,
30
- type BackupResult,
31
- type RestoreResult,
32
- type DumpResult,
33
- type StatusResult,
34
- type QueryResult,
35
- type QueryOptions,
36
- } from '../../types'
37
- import { parseRESTAPIResult } from '../../core/query-parser'
38
-
39
- const ENGINE = 'influxdb'
40
- const engineDef = getEngineDefaults(ENGINE)
41
-
42
- /**
43
- * Initial delay before checking if InfluxDB is ready after spawning.
44
- * Windows requires a longer delay as process startup is slower.
45
- */
46
- const START_CHECK_DELAY_MS = isWindows() ? 2000 : 500
47
-
48
- /**
49
- * Parse an InfluxDB connection string
50
- * Supported formats:
51
- * - http://host:port
52
- * - https://host:port
53
- * - influxdb://host:port (converted to http)
54
- */
55
- function parseInfluxDBConnectionString(connectionString: string): {
56
- baseUrl: string
57
- headers: Record<string, string>
58
- database?: string
59
- } {
60
- let url: URL
61
- let scheme = 'http'
62
-
63
- // Handle influxdb:// scheme by converting to http://
64
- let normalized = connectionString.trim()
65
- if (normalized.startsWith('influxdb://')) {
66
- normalized = normalized.replace('influxdb://', 'http://')
67
- }
68
-
69
- // Ensure scheme is present
70
- if (!normalized.startsWith('http://') && !normalized.startsWith('https://')) {
71
- normalized = `http://${normalized}`
72
- }
73
-
74
- try {
75
- url = new URL(normalized)
76
- scheme = url.protocol.replace(':', '')
77
- } catch {
78
- throw new Error(
79
- `Invalid InfluxDB connection string: ${connectionString}\n` +
80
- 'Expected format: http://host:port or influxdb://host:port',
81
- )
82
- }
83
-
84
- // Extract token if provided
85
- const token = url.searchParams.get('token')
86
- const database = url.searchParams.get('db') || undefined
87
-
88
- const headers: Record<string, string> = {
89
- 'Content-Type': 'application/json',
90
- }
91
-
92
- if (token) {
93
- headers['Authorization'] = `Bearer ${token}`
94
- }
95
-
96
- // Construct base URL without query params
97
- const port = url.port || '8086'
98
- const baseUrl = `${scheme}://${url.hostname}:${port}`
99
-
100
- return { baseUrl, headers, database }
101
- }
102
-
103
- /**
104
- * Make an HTTP request to a remote InfluxDB server
105
- */
106
- async function remoteInfluxDBRequest(
107
- baseUrl: string,
108
- method: string,
109
- path: string,
110
- headers: Record<string, string>,
111
- body?: Record<string, unknown>,
112
- timeoutMs = 30000,
113
- ): Promise<{ status: number; data: unknown }> {
114
- const url = `${baseUrl}${path}`
115
-
116
- const controller = new AbortController()
117
- const timeoutId = setTimeout(() => controller.abort(), timeoutMs)
118
-
119
- const options: RequestInit = {
120
- method,
121
- headers,
122
- signal: controller.signal,
123
- }
124
-
125
- if (body) {
126
- options.body = JSON.stringify(body)
127
- }
128
-
129
- try {
130
- const response = await fetch(url, options)
131
-
132
- let data: unknown
133
- const contentType = response.headers.get('content-type') || ''
134
- if (contentType.includes('application/json')) {
135
- data = await response.json()
136
- } else {
137
- data = await response.text()
138
- }
139
-
140
- return { status: response.status, data }
141
- } catch (error) {
142
- if (error instanceof Error && error.name === 'AbortError') {
143
- throw new Error(
144
- `Remote InfluxDB request timed out after ${timeoutMs / 1000}s: ${method} ${path}`,
145
- )
146
- }
147
- throw error
148
- } finally {
149
- clearTimeout(timeoutId)
150
- }
151
- }
152
-
153
- export class InfluxDBEngine extends BaseEngine {
154
- name = ENGINE
155
- displayName = 'InfluxDB'
156
- defaultPort = engineDef.defaultPort
157
- supportedVersions = SUPPORTED_MAJOR_VERSIONS
158
-
159
- // Get platform info for binary operations
160
- getPlatformInfo(): { platform: Platform; arch: Arch } {
161
- return platformService.getPlatformInfo()
162
- }
163
-
164
- // Fetch available versions from hostdb
165
- async fetchAvailableVersions(): Promise<Record<string, string[]>> {
166
- return fetchHostdbVersions()
167
- }
168
-
169
- // Get binary download URL from hostdb
170
- getBinaryUrl(version: string, platform: Platform, arch: Arch): string {
171
- return getBinaryUrl(version, platform, arch)
172
- }
173
-
174
- // Resolves version string to full version (e.g., '3' -> '3.8.0')
175
- resolveFullVersion(version: string): string {
176
- return normalizeVersion(version)
177
- }
178
-
179
- // Get the path where binaries for a version would be installed
180
- getBinaryPath(version: string): string {
181
- const fullVersion = this.resolveFullVersion(version)
182
- const { platform: p, arch: a } = this.getPlatformInfo()
183
- return paths.getBinaryPath({
184
- engine: 'influxdb',
185
- version: fullVersion,
186
- platform: p,
187
- arch: a,
188
- })
189
- }
190
-
191
- // Verify that InfluxDB binaries are available
192
- async verifyBinary(binPath: string): Promise<boolean> {
193
- const ext = platformService.getExecutableExtension()
194
- const serverPath = join(binPath, 'bin', `influxdb3${ext}`)
195
- return existsSync(serverPath)
196
- }
197
-
198
- // Check if a specific InfluxDB version is installed
199
- async isBinaryInstalled(version: string): Promise<boolean> {
200
- const { platform, arch } = this.getPlatformInfo()
201
- return influxdbBinaryManager.isInstalled(version, platform, arch)
202
- }
203
-
204
- /**
205
- * Ensure InfluxDB binaries are available for a specific version
206
- * Downloads from hostdb if not already installed
207
- * Returns the path to the bin directory
208
- */
209
- async ensureBinaries(
210
- version: string,
211
- onProgress?: ProgressCallback,
212
- ): Promise<string> {
213
- const { platform, arch } = this.getPlatformInfo()
214
-
215
- const binPath = await influxdbBinaryManager.ensureInstalled(
216
- version,
217
- platform,
218
- arch,
219
- onProgress,
220
- )
221
-
222
- // Register binaries in config
223
- const ext = platformService.getExecutableExtension()
224
- const tools = ['influxdb3'] as const
225
-
226
- for (const tool of tools) {
227
- const toolPath = join(binPath, 'bin', `${tool}${ext}`)
228
- if (existsSync(toolPath)) {
229
- await configManager.setBinaryPath(tool, toolPath, 'bundled')
230
- }
231
- }
232
-
233
- return binPath
234
- }
235
-
236
- /**
237
- * Initialize a new InfluxDB data directory
238
- */
239
- async initDataDir(
240
- containerName: string,
241
- _version: string,
242
- _options: Record<string, unknown> = {},
243
- ): Promise<string> {
244
- const dataDir = paths.getContainerDataPath(containerName, {
245
- engine: ENGINE,
246
- })
247
- const containerDir = paths.getContainerPath(containerName, {
248
- engine: ENGINE,
249
- })
250
-
251
- // Create container directory if it doesn't exist
252
- if (!existsSync(containerDir)) {
253
- await mkdir(containerDir, { recursive: true })
254
- }
255
-
256
- // Create data directory if it doesn't exist
257
- if (!existsSync(dataDir)) {
258
- await mkdir(dataDir, { recursive: true })
259
- logDebug(`Created InfluxDB data directory: ${dataDir}`)
260
- }
261
-
262
- return dataDir
263
- }
264
-
265
- // Get the path to influxdb3 server for a version
266
- async getInfluxDBServerPath(version: string): Promise<string> {
267
- const { platform, arch } = this.getPlatformInfo()
268
- const fullVersion = normalizeVersion(version)
269
- const binPath = paths.getBinaryPath({
270
- engine: 'influxdb',
271
- version: fullVersion,
272
- platform,
273
- arch,
274
- })
275
- const ext = platformService.getExecutableExtension()
276
- const serverPath = join(binPath, 'bin', `influxdb3${ext}`)
277
- if (existsSync(serverPath)) {
278
- return serverPath
279
- }
280
- throw new Error(
281
- `InfluxDB ${version} is not installed. Run: spindb engines download influxdb ${version}`,
282
- )
283
- }
284
-
285
- // Get the path to influxdb3 binary
286
- async getInfluxDBPath(version?: string): Promise<string> {
287
- // Check config cache first
288
- const cached = await configManager.getBinaryPath('influxdb3')
289
- if (cached && existsSync(cached)) {
290
- return cached
291
- }
292
-
293
- // If version provided, use downloaded binary
294
- if (version) {
295
- const { platform, arch } = this.getPlatformInfo()
296
- const fullVersion = normalizeVersion(version)
297
- const binPath = paths.getBinaryPath({
298
- engine: 'influxdb',
299
- version: fullVersion,
300
- platform,
301
- arch,
302
- })
303
- const ext = platformService.getExecutableExtension()
304
- const influxdbPath = join(binPath, 'bin', `influxdb3${ext}`)
305
- if (existsSync(influxdbPath)) {
306
- return influxdbPath
307
- }
308
- }
309
-
310
- throw new Error(
311
- 'influxdb3 not found. Run: spindb engines download influxdb <version>',
312
- )
313
- }
314
-
315
- /**
316
- * Start InfluxDB server
317
- * CLI: influxdb3 serve --data-dir /path/to/data --http-bind 127.0.0.1:PORT
318
- */
319
- async start(
320
- container: ContainerConfig,
321
- onProgress?: ProgressCallback,
322
- ): Promise<{ port: number; connectionString: string }> {
323
- const { name, port, version, binaryPath } = container
324
-
325
- // Check if already running
326
- const alreadyRunning = await processManager.isRunning(name, {
327
- engine: ENGINE,
328
- })
329
- if (alreadyRunning) {
330
- return {
331
- port,
332
- connectionString: this.getConnectionString(container),
333
- }
334
- }
335
-
336
- // Use stored binary path if available
337
- let influxdbServer: string | null = null
338
-
339
- if (binaryPath && existsSync(binaryPath)) {
340
- const ext = platformService.getExecutableExtension()
341
- const serverPath = join(binaryPath, 'bin', `influxdb3${ext}`)
342
- if (existsSync(serverPath)) {
343
- influxdbServer = serverPath
344
- logDebug(`Using stored binary path: ${influxdbServer}`)
345
- }
346
- }
347
-
348
- // Fall back to normal path
349
- if (!influxdbServer) {
350
- try {
351
- influxdbServer = await this.getInfluxDBServerPath(version)
352
- } catch (error) {
353
- const originalMessage =
354
- error instanceof Error ? error.message : String(error)
355
- throw new Error(
356
- `InfluxDB ${version} is not installed. Run: spindb engines download influxdb ${version}\n` +
357
- ` Original error: ${originalMessage}`,
358
- )
359
- }
360
- }
361
-
362
- logDebug(`Using influxdb3 for version ${version}: ${influxdbServer}`)
363
-
364
- const containerDir = paths.getContainerPath(name, { engine: ENGINE })
365
- const dataDir = paths.getContainerDataPath(name, { engine: ENGINE })
366
- const logFile = paths.getContainerLogPath(name, { engine: ENGINE })
367
- const pidFile = join(containerDir, 'influxdb.pid')
368
-
369
- // On Windows, wait longer for ports to be released
370
- const portWaitTimeout = isWindows() ? 60000 : 0
371
- const portCheckStart = Date.now()
372
- const portCheckInterval = 1000
373
-
374
- // Check if HTTP port is available
375
- while (!(await portManager.isPortAvailable(port))) {
376
- if (Date.now() - portCheckStart >= portWaitTimeout) {
377
- throw new Error(`HTTP port ${port} is already in use.`)
378
- }
379
- logDebug(`Waiting for HTTP port ${port} to become available...`)
380
- await new Promise((resolve) => setTimeout(resolve, portCheckInterval))
381
- }
382
-
383
- onProgress?.({ stage: 'starting', message: 'Starting InfluxDB...' })
384
-
385
- // Build command arguments
386
- // InfluxDB 3.x uses 'serve' subcommand with required --node-id
387
- // Use fixed node-id so data persists across container renames
388
- const args = [
389
- 'serve',
390
- '--node-id',
391
- 'spindb',
392
- '--object-store',
393
- 'file',
394
- '--data-dir',
395
- dataDir,
396
- '--http-bind',
397
- `127.0.0.1:${port}`,
398
- '--without-auth',
399
- ]
400
-
401
- logDebug(`Starting influxdb3 with args: ${args.join(' ')}`)
402
-
403
- /**
404
- * Check log file for startup errors
405
- */
406
- const checkLogForError = async (): Promise<string | null> => {
407
- try {
408
- const logContent = await readFile(logFile, 'utf-8')
409
- const recentLog = logContent.slice(-2000) // Last 2KB
410
-
411
- if (
412
- recentLog.includes('Address already in use') ||
413
- recentLog.includes('bind: Address already in use')
414
- ) {
415
- return `Port ${port} is already in use`
416
- }
417
- if (recentLog.includes('Failed to bind')) {
418
- return `Port ${port} is already in use`
419
- }
420
- } catch {
421
- // Log file might not exist yet
422
- }
423
- return null
424
- }
425
-
426
- // InfluxDB runs in foreground, so we need to spawn detached
427
- if (isWindows()) {
428
- return new Promise((resolve, reject) => {
429
- const spawnOpts: SpawnOptions = {
430
- cwd: containerDir,
431
- stdio: ['ignore', 'pipe', 'pipe'],
432
- detached: true,
433
- windowsHide: true,
434
- }
435
-
436
- const proc = spawn(influxdbServer, args, spawnOpts)
437
- let settled = false
438
- let stderrOutput = ''
439
- let stdoutOutput = ''
440
-
441
- proc.on('error', (err) => {
442
- if (settled) return
443
- settled = true
444
- reject(new Error(`Failed to spawn InfluxDB server: ${err.message}`))
445
- })
446
-
447
- proc.on('exit', (code, signal) => {
448
- if (settled) return
449
- settled = true
450
- const reason = signal ? `signal ${signal}` : `code ${code}`
451
- reject(
452
- new Error(
453
- `InfluxDB process exited unexpectedly (${reason}).\n` +
454
- `Stderr: ${stderrOutput || '(none)'}\n` +
455
- `Stdout: ${stdoutOutput || '(none)'}`,
456
- ),
457
- )
458
- })
459
-
460
- proc.stdout?.on('data', (data: Buffer) => {
461
- const str = data.toString()
462
- stdoutOutput += str
463
- logDebug(`influxdb3 stdout: ${str}`)
464
- })
465
- proc.stderr?.on('data', (data: Buffer) => {
466
- const str = data.toString()
467
- stderrOutput += str
468
- logDebug(`influxdb3 stderr: ${str}`)
469
- })
470
-
471
- proc.unref()
472
-
473
- setTimeout(async () => {
474
- if (settled) return
475
-
476
- if (!proc.pid) {
477
- settled = true
478
- reject(
479
- new Error('InfluxDB server process failed to start (no PID)'),
480
- )
481
- return
482
- }
483
-
484
- try {
485
- await writeFile(pidFile, String(proc.pid))
486
- } catch {
487
- // Non-fatal
488
- }
489
-
490
- const ready = await this.waitForReady(port)
491
- if (settled) return
492
-
493
- if (ready) {
494
- settled = true
495
- resolve({
496
- port,
497
- connectionString: this.getConnectionString(container),
498
- })
499
- } else {
500
- settled = true
501
-
502
- // Clean up the orphaned detached process before rejecting
503
- if (proc.pid && platformService.isProcessRunning(proc.pid)) {
504
- try {
505
- await platformService.terminateProcess(proc.pid, true)
506
- } catch {
507
- // Ignore cleanup errors
508
- }
509
- }
510
-
511
- const portError = await checkLogForError()
512
-
513
- const errorDetails = [
514
- portError || 'InfluxDB failed to start within timeout.',
515
- `Binary: ${influxdbServer}`,
516
- `Log file: ${logFile}`,
517
- stderrOutput ? `Stderr:\n${stderrOutput}` : '',
518
- stdoutOutput ? `Stdout:\n${stdoutOutput}` : '',
519
- ]
520
- .filter(Boolean)
521
- .join('\n')
522
-
523
- reject(new Error(errorDetails))
524
- }
525
- }, START_CHECK_DELAY_MS)
526
- })
527
- }
528
-
529
- // macOS/Linux: spawn with ignored stdio so Node.js can exit cleanly
530
- const proc = spawn(influxdbServer, args, {
531
- cwd: containerDir,
532
- stdio: ['ignore', 'ignore', 'ignore'],
533
- detached: true,
534
- })
535
- proc.unref()
536
-
537
- if (!proc.pid) {
538
- throw new Error('InfluxDB server process failed to start (no PID)')
539
- }
540
-
541
- try {
542
- await writeFile(pidFile, String(proc.pid))
543
- } catch {
544
- // Non-fatal
545
- }
546
-
547
- // Wait for InfluxDB to be ready
548
- const ready = await this.waitForReady(port)
549
-
550
- if (ready) {
551
- return {
552
- port,
553
- connectionString: this.getConnectionString(container),
554
- }
555
- }
556
-
557
- // Clean up the orphaned detached process before throwing
558
- if (proc.pid) {
559
- try {
560
- process.kill(-proc.pid, 'SIGTERM')
561
- logDebug(`Killed process group ${proc.pid}`)
562
- } catch {
563
- try {
564
- process.kill(proc.pid, 'SIGTERM')
565
- logDebug(`Killed process ${proc.pid}`)
566
- } catch {
567
- // Ignore - process may have already exited
568
- }
569
- }
570
- }
571
-
572
- // Clean up PID file
573
- if (existsSync(pidFile)) {
574
- try {
575
- await unlink(pidFile)
576
- } catch {
577
- // Non-fatal
578
- }
579
- }
580
-
581
- const portError = await checkLogForError()
582
-
583
- const errorDetails = [
584
- portError || 'InfluxDB failed to start within timeout.',
585
- `Binary: ${influxdbServer}`,
586
- `Log file: ${logFile}`,
587
- ]
588
- .filter(Boolean)
589
- .join('\n')
590
-
591
- throw new Error(errorDetails)
592
- }
593
-
594
- // Wait for InfluxDB to be ready to accept connections
595
- private async waitForReady(
596
- port: number,
597
- timeoutMs = 30000,
598
- ): Promise<boolean> {
599
- const startTime = Date.now()
600
- const checkInterval = 500
601
-
602
- while (Date.now() - startTime < timeoutMs) {
603
- try {
604
- // InfluxDB 3.x health check endpoint
605
- const response = await influxdbApiRequest(port, 'GET', '/health')
606
- if (response.status === 200) {
607
- logDebug(`InfluxDB ready on port ${port}`)
608
- return true
609
- }
610
- } catch {
611
- // Connection failed, wait and retry
612
- }
613
- await new Promise((resolve) => setTimeout(resolve, checkInterval))
614
- }
615
-
616
- logDebug(`InfluxDB did not become ready within ${timeoutMs}ms`)
617
- return false
618
- }
619
-
620
- /**
621
- * Stop InfluxDB server
622
- */
623
- async stop(container: ContainerConfig): Promise<void> {
624
- const { name, port } = container
625
- const containerDir = paths.getContainerPath(name, { engine: ENGINE })
626
- const pidFile = join(containerDir, 'influxdb.pid')
627
-
628
- logDebug(`Stopping InfluxDB container "${name}" on port ${port}`)
629
-
630
- // Get PID and terminate
631
- let pid: number | null = null
632
-
633
- if (existsSync(pidFile)) {
634
- try {
635
- const content = await readFile(pidFile, 'utf8')
636
- pid = parseInt(content.trim(), 10)
637
- } catch {
638
- // Ignore
639
- }
640
- }
641
-
642
- // Kill process if running
643
- if (pid && platformService.isProcessRunning(pid)) {
644
- logDebug(`Killing InfluxDB process ${pid}`)
645
- try {
646
- if (isWindows()) {
647
- await platformService.terminateProcess(pid, true)
648
- } else {
649
- await platformService.terminateProcess(pid, false)
650
- await new Promise((resolve) => setTimeout(resolve, 2000))
651
-
652
- if (platformService.isProcessRunning(pid)) {
653
- logWarning(`Graceful termination failed, force killing ${pid}`)
654
- await platformService.terminateProcess(pid, true)
655
- }
656
- }
657
- } catch (error) {
658
- logDebug(`Process termination error: ${error}`)
659
- }
660
- }
661
-
662
- // Wait for process to fully terminate
663
- if (isWindows()) {
664
- await new Promise((resolve) => setTimeout(resolve, 3000))
665
- }
666
-
667
- // Kill any processes still listening on the port
668
- const portPids = await platformService.findProcessByPort(port)
669
- for (const portPid of portPids) {
670
- if (platformService.isProcessRunning(portPid)) {
671
- logDebug(`Killing process ${portPid} still on port ${port}`)
672
- try {
673
- await platformService.terminateProcess(portPid, true)
674
- } catch {
675
- // Ignore
676
- }
677
- }
678
- }
679
-
680
- // On Windows, wait again after killing port processes
681
- if (isWindows() && portPids.length > 0) {
682
- await new Promise((resolve) => setTimeout(resolve, 2000))
683
- }
684
-
685
- // Cleanup PID file
686
- if (existsSync(pidFile)) {
687
- try {
688
- await unlink(pidFile)
689
- } catch {
690
- // Ignore
691
- }
692
- }
693
-
694
- // On Windows, wait for ports to be released
695
- if (isWindows()) {
696
- logDebug(`Waiting for port ${port} to be released...`)
697
- const portWaitStart = Date.now()
698
- const portWaitTimeout = 30000
699
- const checkInterval = 500
700
-
701
- while (Date.now() - portWaitStart < portWaitTimeout) {
702
- const httpAvailable = await portManager.isPortAvailable(port)
703
-
704
- if (httpAvailable) {
705
- logDebug('Port released successfully')
706
- break
707
- }
708
- await new Promise((resolve) => setTimeout(resolve, checkInterval))
709
- }
710
- }
711
-
712
- logDebug('InfluxDB stopped')
713
- }
714
-
715
- // Get InfluxDB server status
716
- async status(container: ContainerConfig): Promise<StatusResult> {
717
- const { name, port } = container
718
- const containerDir = paths.getContainerPath(name, { engine: ENGINE })
719
- const pidFile = join(containerDir, 'influxdb.pid')
720
-
721
- // Try health check via REST API
722
- try {
723
- const response = await influxdbApiRequest(port, 'GET', '/health')
724
- if (response.status === 200) {
725
- return { running: true, message: 'InfluxDB is running' }
726
- }
727
- } catch {
728
- // Not responding, check PID
729
- }
730
-
731
- // Check PID file
732
- if (existsSync(pidFile)) {
733
- try {
734
- const content = await readFile(pidFile, 'utf8')
735
- const pid = parseInt(content.trim(), 10)
736
- if (!isNaN(pid) && pid > 0 && platformService.isProcessRunning(pid)) {
737
- return {
738
- running: true,
739
- message: `InfluxDB is running (PID: ${pid})`,
740
- }
741
- }
742
- } catch {
743
- // Ignore
744
- }
745
- }
746
-
747
- return { running: false, message: 'InfluxDB is not running' }
748
- }
749
-
750
- // Detect backup format
751
- async detectBackupFormat(filePath: string): Promise<BackupFormat> {
752
- return detectBackupFormatImpl(filePath)
753
- }
754
-
755
- /**
756
- * Restore a backup
757
- * InfluxDB can be running during SQL restore (via REST API)
758
- */
759
- async restore(
760
- container: ContainerConfig,
761
- backupPath: string,
762
- _options: { database?: string; flush?: boolean } = {},
763
- ): Promise<RestoreResult> {
764
- const { name, port } = container
765
- const database = _options.database || container.database
766
-
767
- return restoreBackup(backupPath, {
768
- containerName: name,
769
- port,
770
- database,
771
- })
772
- }
773
-
774
- /**
775
- * Get connection string
776
- * Format: http://127.0.0.1:PORT
777
- */
778
- getConnectionString(container: ContainerConfig, _database?: string): string {
779
- const { port } = container
780
- return `http://127.0.0.1:${port}`
781
- }
782
-
783
- // Open HTTP API (InfluxDB uses REST API)
784
- async connect(container: ContainerConfig, _database?: string): Promise<void> {
785
- const { port } = container
786
- const url = `http://127.0.0.1:${port}`
787
-
788
- console.log(`InfluxDB REST API available at: ${url}`)
789
- console.log('')
790
- console.log('Example commands:')
791
- console.log(` curl ${url}/health`)
792
- console.log(
793
- ` curl -X POST ${url}/api/v3/query_sql -H "Content-Type: application/json" -d '{"db":"mydb","q":"SELECT 1"}'`,
794
- )
795
- }
796
-
797
- /**
798
- * Create a new database
799
- * InfluxDB 3.x creates databases implicitly on first write,
800
- * but we can verify the server is running
801
- */
802
- async createDatabase(
803
- container: ContainerConfig,
804
- database: string,
805
- ): Promise<void> {
806
- const { port } = container
807
-
808
- // InfluxDB 3.x creates databases implicitly when data is written
809
- // Verify server is accessible and write a test record to create the database
810
- const response = await influxdbApiRequest(
811
- port,
812
- 'POST',
813
- `/api/v3/write_lp?db=${encodeURIComponent(database)}`,
814
- undefined,
815
- )
816
-
817
- // A 204 or 200 means success, but we might also get a 2xx with empty body
818
- // which is fine - database will be created on first write
819
- if (response.status >= 400) {
820
- logDebug(
821
- `Database creation note: ${JSON.stringify(response.data)}. Database will be created on first write.`,
822
- )
823
- }
824
-
825
- logDebug(`InfluxDB database "${database}" ready (created on first write)`)
826
- }
827
-
828
- /**
829
- * Drop a database
830
- * InfluxDB 3.x doesn't have a direct DROP DATABASE command via REST
831
- */
832
- async dropDatabase(
833
- container: ContainerConfig,
834
- database: string,
835
- ): Promise<void> {
836
- const { port } = container
837
-
838
- // Try to delete tables in the database
839
- const tablesResponse = await influxdbApiRequest(
840
- port,
841
- 'POST',
842
- '/api/v3/query_sql',
843
- {
844
- db: database,
845
- q: 'SHOW TABLES',
846
- format: 'json',
847
- },
848
- )
849
-
850
- if (tablesResponse.status === 200) {
851
- const tables = tablesResponse.data as Array<Record<string, unknown>>
852
- if (Array.isArray(tables)) {
853
- for (const row of tables) {
854
- // Only drop user tables (iox schema), skip system/information_schema
855
- const schema = row.table_schema as string | undefined
856
- if (schema && schema !== 'iox') continue
857
- const tableName =
858
- (row.table_name as string) ||
859
- (row.name as string) ||
860
- (Object.values(row)[0] as string)
861
- if (tableName) {
862
- await influxdbApiRequest(port, 'POST', '/api/v3/query_sql', {
863
- db: database,
864
- q: `DROP TABLE "${tableName}"`,
865
- format: 'json',
866
- })
867
- }
868
- }
869
- }
870
- }
871
-
872
- logDebug(`Dropped tables in InfluxDB database: ${database}`)
873
- }
874
-
875
- /**
876
- * Get the storage size of the InfluxDB instance
877
- */
878
- async getDatabaseSize(_container: ContainerConfig): Promise<number | null> {
879
- // InfluxDB 3.x doesn't have a direct size endpoint
880
- // Return null to use filesystem-based calculation
881
- return null
882
- }
883
-
884
- /**
885
- * Dump from a remote InfluxDB connection
886
- * Uses InfluxDB's REST API to query tables and export data as SQL
887
- */
888
- async dumpFromConnectionString(
889
- connectionString: string,
890
- outputPath: string,
891
- ): Promise<DumpResult> {
892
- const { baseUrl, headers, database } =
893
- parseInfluxDBConnectionString(connectionString)
894
-
895
- logDebug(`Connecting to remote InfluxDB at ${baseUrl}`)
896
-
897
- // Check connectivity
898
- const healthResponse = await remoteInfluxDBRequest(
899
- baseUrl,
900
- 'GET',
901
- '/health',
902
- headers,
903
- )
904
- if (healthResponse.status !== 200) {
905
- throw new Error(
906
- `Failed to connect to InfluxDB at ${baseUrl}: ${JSON.stringify(healthResponse.data)}`,
907
- )
908
- }
909
-
910
- const db = database || 'mydb'
911
- const warnings: string[] = []
912
-
913
- // Get list of tables
914
- const tablesResponse = await remoteInfluxDBRequest(
915
- baseUrl,
916
- 'POST',
917
- '/api/v3/query_sql',
918
- headers,
919
- { db, q: 'SHOW TABLES', format: 'json' },
920
- )
921
-
922
- const tablesData = tablesResponse.data as Array<Record<string, unknown>>
923
- const tables: string[] = []
924
- if (Array.isArray(tablesData)) {
925
- for (const row of tablesData) {
926
- const schema = row.table_schema as string | undefined
927
- if (schema && schema !== 'iox') continue
928
- const tableName =
929
- (row.table_name as string) ||
930
- (row.name as string) ||
931
- (Object.values(row)[0] as string)
932
- if (tableName) tables.push(tableName)
933
- }
934
- }
935
-
936
- logDebug(`Found ${tables.length} tables on remote server`)
937
-
938
- if (tables.length === 0) {
939
- warnings.push(
940
- `Remote InfluxDB instance has no tables in database "${db}"`,
941
- )
942
- }
943
-
944
- // Build SQL dump (same format as local backup)
945
- let sqlContent = `-- InfluxDB SQL Backup\n`
946
- sqlContent += `-- Database: ${db}\n`
947
- sqlContent += `-- Source: ${baseUrl}\n`
948
- sqlContent += `-- Created: ${new Date().toISOString()}\n\n`
949
-
950
- for (const table of tables) {
951
- // Query column metadata for tag identification
952
- const tagColumns: string[] = []
953
- try {
954
- const colResponse = await remoteInfluxDBRequest(
955
- baseUrl,
956
- 'POST',
957
- '/api/v3/query_sql',
958
- headers,
959
- {
960
- db,
961
- q: `SELECT column_name, data_type FROM information_schema.columns WHERE table_name = '${table.replace(/'/g, "''")}'`,
962
- format: 'json',
963
- },
964
- )
965
- if (colResponse.status === 200 && Array.isArray(colResponse.data)) {
966
- for (const col of colResponse.data as Array<
967
- Record<string, unknown>
968
- >) {
969
- if (String(col.data_type || '').includes('Dictionary')) {
970
- tagColumns.push(String(col.column_name))
971
- }
972
- }
973
- }
974
- } catch {
975
- logDebug(`Warning: Could not query column metadata for ${table}`)
976
- }
977
-
978
- // Query all data from the table
979
- const dataResponse = await remoteInfluxDBRequest(
980
- baseUrl,
981
- 'POST',
982
- '/api/v3/query_sql',
983
- headers,
984
- {
985
- db,
986
- q: `SELECT * FROM "${table.replace(/"/g, '""')}"`,
987
- format: 'json',
988
- },
989
- )
990
-
991
- if (dataResponse.status !== 200) {
992
- const msg = `Failed to export table ${table}: ${JSON.stringify(dataResponse.data)}`
993
- logDebug(`Warning: ${msg}`)
994
- warnings.push(msg)
995
- continue
996
- }
997
-
998
- const rows = dataResponse.data as Array<Record<string, unknown>>
999
- if (Array.isArray(rows) && rows.length > 0) {
1000
- sqlContent += `-- Table: ${table}\n`
1001
- if (tagColumns.length > 0) {
1002
- sqlContent += `-- Tags: ${tagColumns.join(', ')}\n`
1003
- }
1004
-
1005
- for (const row of rows) {
1006
- const columns = Object.keys(row)
1007
- const values = columns.map((col) => {
1008
- const val = row[col]
1009
- if (val === null || val === undefined) return 'NULL'
1010
- if (typeof val === 'number') return String(val)
1011
- if (typeof val === 'boolean') return val ? 'true' : 'false'
1012
- return `'${String(val).replace(/'/g, "''")}'`
1013
- })
1014
- sqlContent += `INSERT INTO "${table.replace(/"/g, '""')}" (${columns.map((c) => `"${c.replace(/"/g, '""')}"`).join(', ')}) VALUES (${values.join(', ')});\n`
1015
- }
1016
- sqlContent += '\n'
1017
- }
1018
- }
1019
-
1020
- // Write SQL content to file
1021
- await writeFile(outputPath, sqlContent, 'utf-8')
1022
-
1023
- return {
1024
- filePath: outputPath,
1025
- warnings,
1026
- }
1027
- }
1028
-
1029
- // Create a backup
1030
- async backup(
1031
- container: ContainerConfig,
1032
- outputPath: string,
1033
- options: BackupOptions,
1034
- ): Promise<BackupResult> {
1035
- return createBackup(container, outputPath, options)
1036
- }
1037
-
1038
- // Run a command - InfluxDB uses REST API with SQL
1039
- async runScript(
1040
- container: ContainerConfig,
1041
- options: { file?: string; sql?: string; database?: string },
1042
- ): Promise<void> {
1043
- const { port } = container
1044
- const database = options.database || container.database
1045
-
1046
- if (options.file) {
1047
- const content = await readFile(options.file, 'utf-8')
1048
-
1049
- // Ensure the database exists (InfluxDB creates DBs implicitly on write,
1050
- // but SQL queries fail if the DB doesn't exist yet)
1051
- const createDbResp = await influxdbApiRequest(
1052
- port,
1053
- 'POST',
1054
- '/api/v3/configure/database',
1055
- { db: database },
1056
- )
1057
- if (createDbResp.status >= 400) {
1058
- throw new Error(
1059
- `Failed to create database "${database}": HTTP ${createDbResp.status} — ${JSON.stringify(createDbResp.data)}`,
1060
- )
1061
- }
1062
-
1063
- // Line protocol files (.lp) → write via /api/v3/write_lp
1064
- if (options.file.endsWith('.lp')) {
1065
- const lines = content
1066
- .split('\n')
1067
- .filter((line) => line.trim().length > 0 && !line.startsWith('#'))
1068
- .join('\n')
1069
- const response = await influxdbApiRequest(
1070
- port,
1071
- 'POST',
1072
- `/api/v3/write_lp?db=${encodeURIComponent(database)}`,
1073
- lines,
1074
- )
1075
- if (response.status >= 400) {
1076
- throw new Error(`Write error: ${JSON.stringify(response.data)}`)
1077
- }
1078
- return
1079
- }
1080
-
1081
- // SQL files → execute via /api/v3/query_sql
1082
- const statements = content
1083
- .split('\n')
1084
- .filter((line) => !line.startsWith('--') && line.trim().length > 0)
1085
- .join('\n')
1086
- .split(';')
1087
- .map((s) => s.trim())
1088
- .filter((s) => s.length > 0)
1089
-
1090
- for (const sql of statements) {
1091
- const response = await influxdbApiRequest(
1092
- port,
1093
- 'POST',
1094
- '/api/v3/query_sql',
1095
- {
1096
- db: database,
1097
- q: sql,
1098
- format: 'json',
1099
- },
1100
- )
1101
-
1102
- if (response.status >= 400) {
1103
- throw new Error(
1104
- `SQL error: ${JSON.stringify(response.data)}\nStatement: ${sql}`,
1105
- )
1106
- }
1107
- }
1108
- return
1109
- }
1110
-
1111
- if (options.sql) {
1112
- // Ensure database exists for inline SQL too
1113
- const createDbResp2 = await influxdbApiRequest(
1114
- port,
1115
- 'POST',
1116
- '/api/v3/configure/database',
1117
- { db: database },
1118
- )
1119
- if (createDbResp2.status >= 400) {
1120
- throw new Error(
1121
- `Failed to create database "${database}": HTTP ${createDbResp2.status} — ${JSON.stringify(createDbResp2.data)}`,
1122
- )
1123
- }
1124
- const response = await influxdbApiRequest(
1125
- port,
1126
- 'POST',
1127
- '/api/v3/query_sql',
1128
- {
1129
- db: database,
1130
- q: options.sql,
1131
- format: 'json',
1132
- },
1133
- )
1134
-
1135
- if (response.status >= 400) {
1136
- throw new Error(`SQL error: ${JSON.stringify(response.data)}`)
1137
- }
1138
-
1139
- if (response.data) {
1140
- console.log(JSON.stringify(response.data, null, 2))
1141
- }
1142
- return
1143
- }
1144
-
1145
- throw new Error('Either file or sql option must be provided')
1146
- }
1147
-
1148
- /**
1149
- * Execute a query via REST API
1150
- *
1151
- * Query format: SQL statement or METHOD /path [JSON body]
1152
- * Examples:
1153
- * SELECT * FROM cpu
1154
- * GET /health
1155
- * POST /api/v3/query_sql {"db": "mydb", "q": "SELECT 1"}
1156
- */
1157
- async executeQuery(
1158
- container: ContainerConfig,
1159
- query: string,
1160
- options?: QueryOptions,
1161
- ): Promise<QueryResult> {
1162
- const { port } = container
1163
- const database = options?.database || container.database
1164
- const trimmed = query.trim()
1165
-
1166
- // Check if this is a REST API-style query (starts with HTTP method)
1167
- const httpMethods = ['GET', 'POST', 'PUT', 'DELETE']
1168
- const firstWord = trimmed.split(/\s+/)[0].toUpperCase()
1169
-
1170
- if (httpMethods.includes(firstWord)) {
1171
- // Parse as REST API query: METHOD /path [body]
1172
- const spaceIdx = trimmed.indexOf(' ')
1173
- const method = (options?.method || firstWord) as
1174
- | 'GET'
1175
- | 'POST'
1176
- | 'PUT'
1177
- | 'DELETE'
1178
- const rest = trimmed.substring(spaceIdx + 1).trim()
1179
-
1180
- let path: string
1181
- let body: Record<string, unknown> | undefined = options?.body
1182
-
1183
- const bodyStart = rest.indexOf('{')
1184
- if (bodyStart !== -1) {
1185
- path = rest.substring(0, bodyStart).trim()
1186
- if (!body) {
1187
- try {
1188
- body = JSON.parse(rest.substring(bodyStart)) as Record<
1189
- string,
1190
- unknown
1191
- >
1192
- } catch {
1193
- throw new Error('Invalid JSON body in query')
1194
- }
1195
- }
1196
- } else {
1197
- path = rest
1198
- }
1199
-
1200
- if (!path.startsWith('/')) {
1201
- path = '/' + path
1202
- }
1203
-
1204
- const response = await influxdbApiRequest(port, method, path, body)
1205
-
1206
- if (response.status >= 400) {
1207
- throw new Error(
1208
- `InfluxDB API error (${response.status}): ${JSON.stringify(response.data)}`,
1209
- )
1210
- }
1211
-
1212
- return parseRESTAPIResult(JSON.stringify(response.data))
1213
- }
1214
-
1215
- // Default: treat as SQL query
1216
- const response = await influxdbApiRequest(
1217
- port,
1218
- 'POST',
1219
- '/api/v3/query_sql',
1220
- {
1221
- db: database,
1222
- q: trimmed,
1223
- format: 'json',
1224
- },
1225
- )
1226
-
1227
- if (response.status >= 400) {
1228
- throw new Error(
1229
- `InfluxDB SQL error (${response.status}): ${JSON.stringify(response.data)}`,
1230
- )
1231
- }
1232
-
1233
- return parseRESTAPIResult(JSON.stringify(response.data))
1234
- }
1235
-
1236
- /**
1237
- * List databases for InfluxDB.
1238
- * InfluxDB 3.x uses GET /api/v3/configure/database?format=json
1239
- */
1240
- async listDatabases(container: ContainerConfig): Promise<string[]> {
1241
- const { port } = container
1242
-
1243
- try {
1244
- const response = await influxdbApiRequest(
1245
- port,
1246
- 'GET',
1247
- '/api/v3/configure/database?format=json',
1248
- )
1249
-
1250
- if (response.status === 200 && response.data) {
1251
- const data = response.data as Array<Record<string, unknown>>
1252
- if (Array.isArray(data)) {
1253
- const databases = data
1254
- .map((row) => {
1255
- return (
1256
- (row['iox::database'] as string) ||
1257
- (row.name as string) ||
1258
- (Object.values(row)[0] as string)
1259
- )
1260
- })
1261
- .filter(Boolean)
1262
- return databases.length > 0 ? databases : [container.database]
1263
- }
1264
- }
1265
- return [container.database]
1266
- } catch {
1267
- return [container.database]
1268
- }
1269
- }
1270
- }
1271
-
1272
- export const influxdbEngine = new InfluxDBEngine()