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.
- package/dist/cli/bin.js +9 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/attach.js +102 -0
- package/dist/cli/commands/attach.js.map +1 -0
- package/dist/cli/commands/backup.js +197 -0
- package/dist/cli/commands/backup.js.map +1 -0
- package/dist/cli/commands/backups.js +190 -0
- package/dist/cli/commands/backups.js.map +1 -0
- package/dist/cli/commands/clone.js +119 -0
- package/dist/cli/commands/clone.js.map +1 -0
- package/dist/cli/commands/config.js +276 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/connect.js +559 -0
- package/dist/cli/commands/connect.js.map +1 -0
- package/dist/cli/commands/create.js +952 -0
- package/dist/cli/commands/create.js.map +1 -0
- package/dist/cli/commands/databases.js +485 -0
- package/dist/cli/commands/databases.js.map +1 -0
- package/dist/cli/commands/delete.js +106 -0
- package/dist/cli/commands/delete.js.map +1 -0
- package/dist/cli/commands/deps.js +238 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/detach.js +81 -0
- package/dist/cli/commands/detach.js.map +1 -0
- package/dist/cli/commands/doctor.js +567 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/duckdb.js +207 -0
- package/dist/cli/commands/duckdb.js.map +1 -0
- package/dist/cli/commands/edit.js +524 -0
- package/dist/cli/commands/edit.js.map +1 -0
- package/dist/cli/commands/engines.js +1414 -0
- package/dist/cli/commands/engines.js.map +1 -0
- package/dist/cli/commands/export.js +383 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/info.js +270 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/list.js +215 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/logs.js +81 -0
- package/dist/cli/commands/logs.js.map +1 -0
- package/dist/cli/commands/menu/backup-handlers.js +1202 -0
- package/dist/cli/commands/menu/backup-handlers.js.map +1 -0
- package/dist/cli/commands/menu/container-handlers.js +1788 -0
- package/dist/cli/commands/menu/container-handlers.js.map +1 -0
- package/dist/cli/commands/menu/engine-handlers.js +235 -0
- package/dist/cli/commands/menu/engine-handlers.js.map +1 -0
- package/dist/cli/commands/menu/index.js +266 -0
- package/dist/cli/commands/menu/index.js.map +1 -0
- package/dist/cli/commands/menu/settings-handlers.js +320 -0
- package/dist/cli/commands/menu/settings-handlers.js.map +1 -0
- package/dist/cli/commands/menu/shared.js +13 -0
- package/dist/cli/commands/menu/shared.js.map +1 -0
- package/dist/cli/commands/menu/shell-handlers.js +1573 -0
- package/dist/cli/commands/menu/shell-handlers.js.map +1 -0
- package/dist/cli/commands/menu/sql-handlers.js +185 -0
- package/dist/cli/commands/menu/sql-handlers.js.map +1 -0
- package/dist/cli/commands/menu/update-handlers.js +322 -0
- package/dist/cli/commands/menu/update-handlers.js.map +1 -0
- package/dist/cli/commands/menu/validators.js +9 -0
- package/dist/cli/commands/menu/validators.js.map +1 -0
- package/dist/cli/commands/ports.js +166 -0
- package/dist/cli/commands/ports.js.map +1 -0
- package/dist/cli/commands/pull.js +166 -0
- package/dist/cli/commands/pull.js.map +1 -0
- package/dist/cli/commands/query.js +180 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/restore.js +428 -0
- package/dist/cli/commands/restore.js.map +1 -0
- package/dist/cli/commands/run.js +115 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/self-update.js +99 -0
- package/dist/cli/commands/self-update.js.map +1 -0
- package/dist/cli/commands/sqlite.js +207 -0
- package/dist/cli/commands/sqlite.js.map +1 -0
- package/dist/cli/commands/start.js +196 -0
- package/dist/cli/commands/start.js.map +1 -0
- package/dist/cli/commands/stop.js +182 -0
- package/dist/cli/commands/stop.js.map +1 -0
- package/dist/cli/commands/url.js +88 -0
- package/dist/cli/commands/url.js.map +1 -0
- package/dist/cli/commands/users.js +189 -0
- package/dist/cli/commands/users.js.map +1 -0
- package/dist/cli/commands/version.js +52 -0
- package/dist/cli/commands/version.js.map +1 -0
- package/dist/cli/commands/which.js +258 -0
- package/dist/cli/commands/which.js.map +1 -0
- package/dist/cli/constants.js +212 -0
- package/dist/cli/constants.js.map +1 -0
- package/dist/cli/helpers.js +1120 -0
- package/dist/cli/helpers.js.map +1 -0
- package/dist/cli/index.js +146 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/ui/prompts.js +1002 -0
- package/dist/cli/ui/prompts.js.map +1 -0
- package/dist/cli/ui/spinner.js +74 -0
- package/dist/cli/ui/spinner.js.map +1 -0
- package/dist/cli/ui/theme.js +99 -0
- package/dist/cli/ui/theme.js.map +1 -0
- package/dist/cli/utils/file-follower.js +79 -0
- package/dist/cli/utils/file-follower.js.map +1 -0
- package/dist/config/backup-formats.js +363 -0
- package/dist/config/backup-formats.js.map +1 -0
- package/dist/config/defaults.js +25 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/engine-defaults.js +303 -0
- package/dist/config/engine-defaults.js.map +1 -0
- package/dist/config/engines-registry.js +103 -0
- package/dist/config/engines-registry.js.map +1 -0
- package/dist/config/os-dependencies.js +767 -0
- package/dist/config/os-dependencies.js.map +1 -0
- package/dist/config/paths.js +156 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/version.js +3 -0
- package/dist/config/version.js.map +1 -0
- package/dist/core/backup-restore.js +219 -0
- package/dist/core/backup-restore.js.map +1 -0
- package/dist/core/base-binary-manager.js +403 -0
- package/dist/core/base-binary-manager.js.map +1 -0
- package/dist/core/base-document-binary-manager.js +364 -0
- package/dist/core/base-document-binary-manager.js.map +1 -0
- package/dist/core/base-embedded-binary-manager.js +364 -0
- package/dist/core/base-embedded-binary-manager.js.map +1 -0
- package/dist/core/base-server-binary-manager.js +368 -0
- package/dist/core/base-server-binary-manager.js.map +1 -0
- package/dist/core/config-manager.js +495 -0
- package/dist/core/config-manager.js.map +1 -0
- package/dist/core/container-manager.js +609 -0
- package/dist/core/container-manager.js.map +1 -0
- package/dist/core/credential-generator.js +67 -0
- package/dist/core/credential-generator.js.map +1 -0
- package/dist/core/credential-manager.js +211 -0
- package/dist/core/credential-manager.js.map +1 -0
- package/dist/core/dblab-utils.js +105 -0
- package/dist/core/dblab-utils.js.map +1 -0
- package/dist/core/dependency-manager.js +359 -0
- package/dist/core/dependency-manager.js.map +1 -0
- package/dist/core/docker-exporter.js +1077 -0
- package/dist/core/docker-exporter.js.map +1 -0
- package/dist/core/error-handler.js +295 -0
- package/dist/core/error-handler.js.map +1 -0
- package/dist/core/fs-error-utils.js +74 -0
- package/dist/core/fs-error-utils.js.map +1 -0
- package/dist/core/homebrew-version-manager.js +280 -0
- package/dist/core/homebrew-version-manager.js.map +1 -0
- package/dist/core/hostdb-client.js +252 -0
- package/dist/core/hostdb-client.js.map +1 -0
- package/dist/core/hostdb-metadata.js +243 -0
- package/dist/core/hostdb-metadata.js.map +1 -0
- package/dist/core/hostdb-releases-factory.js +161 -0
- package/dist/core/hostdb-releases-factory.js.map +1 -0
- package/dist/core/library-env.js +88 -0
- package/dist/core/library-env.js.map +1 -0
- package/dist/core/pgweb-utils.js +53 -0
- package/dist/core/pgweb-utils.js.map +1 -0
- package/dist/core/platform-service.js +632 -0
- package/dist/core/platform-service.js.map +1 -0
- package/dist/core/port-manager.js +136 -0
- package/dist/core/port-manager.js.map +1 -0
- package/dist/core/process-manager.js +445 -0
- package/dist/core/process-manager.js.map +1 -0
- package/dist/core/pull-manager.js +418 -0
- package/dist/core/pull-manager.js.map +1 -0
- package/dist/core/query-parser.js +449 -0
- package/dist/core/query-parser.js.map +1 -0
- package/dist/core/spawn-utils.js +90 -0
- package/dist/core/spawn-utils.js.map +1 -0
- package/dist/core/start-with-retry.js +90 -0
- package/dist/core/start-with-retry.js.map +1 -0
- package/dist/core/test-cleanup.js +85 -0
- package/dist/core/test-cleanup.js.map +1 -0
- package/dist/core/tls-generator.js +84 -0
- package/dist/core/tls-generator.js.map +1 -0
- package/dist/core/transaction-manager.js +139 -0
- package/dist/core/transaction-manager.js.map +1 -0
- package/dist/core/update-manager.js +241 -0
- package/dist/core/update-manager.js.map +1 -0
- package/dist/core/version-migration.js +260 -0
- package/dist/core/version-migration.js.map +1 -0
- package/dist/core/version-utils.js +91 -0
- package/dist/core/version-utils.js.map +1 -0
- package/dist/engines/base-engine.js +179 -0
- package/dist/engines/base-engine.js.map +1 -0
- package/dist/engines/clickhouse/backup.js +289 -0
- package/dist/engines/clickhouse/backup.js.map +1 -0
- package/dist/engines/clickhouse/binary-manager.js +145 -0
- package/dist/engines/clickhouse/binary-manager.js.map +1 -0
- package/dist/engines/clickhouse/binary-urls.js +100 -0
- package/dist/engines/clickhouse/binary-urls.js.map +1 -0
- package/dist/engines/clickhouse/cli-utils.js +143 -0
- package/dist/engines/clickhouse/cli-utils.js.map +1 -0
- package/dist/engines/clickhouse/hostdb-releases.js +24 -0
- package/dist/engines/clickhouse/hostdb-releases.js.map +1 -0
- package/dist/engines/clickhouse/index.js +1077 -0
- package/dist/engines/clickhouse/index.js.map +1 -0
- package/dist/engines/clickhouse/restore.js +335 -0
- package/dist/engines/clickhouse/restore.js.map +1 -0
- package/dist/engines/clickhouse/version-maps.js +83 -0
- package/dist/engines/clickhouse/version-maps.js.map +1 -0
- package/dist/engines/clickhouse/version-validator.js +133 -0
- package/dist/engines/clickhouse/version-validator.js.map +1 -0
- package/dist/engines/cockroachdb/backup.js +261 -0
- package/dist/engines/cockroachdb/backup.js.map +1 -0
- package/dist/engines/cockroachdb/binary-manager.js +33 -0
- package/dist/engines/cockroachdb/binary-manager.js.map +1 -0
- package/dist/engines/cockroachdb/binary-urls.js +33 -0
- package/dist/engines/cockroachdb/binary-urls.js.map +1 -0
- package/dist/engines/cockroachdb/cli-utils.js +338 -0
- package/dist/engines/cockroachdb/cli-utils.js.map +1 -0
- package/dist/engines/cockroachdb/hostdb-releases.js +21 -0
- package/dist/engines/cockroachdb/hostdb-releases.js.map +1 -0
- package/dist/engines/cockroachdb/index.js +1016 -0
- package/dist/engines/cockroachdb/index.js.map +1 -0
- package/dist/engines/cockroachdb/restore.js +323 -0
- package/dist/engines/cockroachdb/restore.js.map +1 -0
- package/dist/engines/cockroachdb/version-maps.js +37 -0
- package/dist/engines/cockroachdb/version-maps.js.map +1 -0
- package/dist/engines/couchdb/api-client.js +64 -0
- package/dist/engines/couchdb/api-client.js.map +1 -0
- package/dist/engines/couchdb/backup.js +90 -0
- package/dist/engines/couchdb/backup.js.map +1 -0
- package/dist/engines/couchdb/binary-manager.js +62 -0
- package/dist/engines/couchdb/binary-manager.js.map +1 -0
- package/dist/engines/couchdb/binary-urls.js +92 -0
- package/dist/engines/couchdb/binary-urls.js.map +1 -0
- package/dist/engines/couchdb/hostdb-releases.js +21 -0
- package/dist/engines/couchdb/hostdb-releases.js.map +1 -0
- package/dist/engines/couchdb/index.js +1043 -0
- package/dist/engines/couchdb/index.js.map +1 -0
- package/dist/engines/couchdb/restore.js +198 -0
- package/dist/engines/couchdb/restore.js.map +1 -0
- package/dist/engines/couchdb/version-maps.js +67 -0
- package/dist/engines/couchdb/version-maps.js.map +1 -0
- package/dist/engines/couchdb/version-validator.js +88 -0
- package/dist/engines/couchdb/version-validator.js.map +1 -0
- package/dist/engines/duckdb/binary-manager.js +33 -0
- package/dist/engines/duckdb/binary-manager.js.map +1 -0
- package/{engines/duckdb/binary-urls.ts → dist/engines/duckdb/binary-urls.js} +11 -16
- package/dist/engines/duckdb/binary-urls.js.map +1 -0
- package/dist/engines/duckdb/hostdb-releases.js +21 -0
- package/dist/engines/duckdb/hostdb-releases.js.map +1 -0
- package/dist/engines/duckdb/index.js +594 -0
- package/dist/engines/duckdb/index.js.map +1 -0
- package/dist/engines/duckdb/registry.js +265 -0
- package/dist/engines/duckdb/registry.js.map +1 -0
- package/dist/engines/duckdb/scanner.js +12 -0
- package/dist/engines/duckdb/scanner.js.map +1 -0
- package/dist/engines/duckdb/version-maps.js +67 -0
- package/dist/engines/duckdb/version-maps.js.map +1 -0
- package/dist/engines/duckdb/version-validator.js +62 -0
- package/dist/engines/duckdb/version-validator.js.map +1 -0
- package/dist/engines/ferretdb/backup.js +170 -0
- package/dist/engines/ferretdb/backup.js.map +1 -0
- package/dist/engines/ferretdb/binary-manager.js +765 -0
- package/dist/engines/ferretdb/binary-manager.js.map +1 -0
- package/dist/engines/ferretdb/binary-urls.js +135 -0
- package/dist/engines/ferretdb/binary-urls.js.map +1 -0
- package/dist/engines/ferretdb/index.js +1517 -0
- package/dist/engines/ferretdb/index.js.map +1 -0
- package/dist/engines/ferretdb/restore.js +310 -0
- package/dist/engines/ferretdb/restore.js.map +1 -0
- package/{engines/ferretdb/version-maps.ts → dist/engines/ferretdb/version-maps.js} +62 -79
- package/dist/engines/ferretdb/version-maps.js.map +1 -0
- package/dist/engines/file-based-utils.js +184 -0
- package/dist/engines/file-based-utils.js.map +1 -0
- package/dist/engines/index.js +124 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/engines/influxdb/api-client.js +54 -0
- package/dist/engines/influxdb/api-client.js.map +1 -0
- package/dist/engines/influxdb/backup.js +119 -0
- package/dist/engines/influxdb/backup.js.map +1 -0
- package/dist/engines/influxdb/binary-manager.js +87 -0
- package/dist/engines/influxdb/binary-manager.js.map +1 -0
- package/dist/engines/influxdb/binary-urls.js +56 -0
- package/dist/engines/influxdb/binary-urls.js.map +1 -0
- package/dist/engines/influxdb/hostdb-releases.js +21 -0
- package/dist/engines/influxdb/hostdb-releases.js.map +1 -0
- package/dist/engines/influxdb/index.js +962 -0
- package/dist/engines/influxdb/index.js.map +1 -0
- package/dist/engines/influxdb/restore.js +329 -0
- package/dist/engines/influxdb/restore.js.map +1 -0
- package/dist/engines/influxdb/version-maps.js +64 -0
- package/dist/engines/influxdb/version-maps.js.map +1 -0
- package/dist/engines/influxdb/version-validator.js +109 -0
- package/dist/engines/influxdb/version-validator.js.map +1 -0
- package/dist/engines/mariadb/backup.js +178 -0
- package/dist/engines/mariadb/backup.js.map +1 -0
- package/dist/engines/mariadb/binary-manager.js +33 -0
- package/dist/engines/mariadb/binary-manager.js.map +1 -0
- package/{engines/mariadb/binary-urls.ts → dist/engines/mariadb/binary-urls.js} +38 -55
- package/dist/engines/mariadb/binary-urls.js.map +1 -0
- package/dist/engines/mariadb/hostdb-releases.js +21 -0
- package/dist/engines/mariadb/hostdb-releases.js.map +1 -0
- package/dist/engines/mariadb/index.js +1011 -0
- package/dist/engines/mariadb/index.js.map +1 -0
- package/dist/engines/mariadb/restore.js +322 -0
- package/dist/engines/mariadb/restore.js.map +1 -0
- package/dist/engines/mariadb/version-maps.js +63 -0
- package/dist/engines/mariadb/version-maps.js.map +1 -0
- package/dist/engines/mariadb/version-validator.js +143 -0
- package/dist/engines/mariadb/version-validator.js.map +1 -0
- package/dist/engines/meilisearch/api-client.js +50 -0
- package/dist/engines/meilisearch/api-client.js.map +1 -0
- package/dist/engines/meilisearch/backup.js +167 -0
- package/dist/engines/meilisearch/backup.js.map +1 -0
- package/dist/engines/meilisearch/binary-manager.js +31 -0
- package/dist/engines/meilisearch/binary-manager.js.map +1 -0
- package/dist/engines/meilisearch/binary-urls.js +56 -0
- package/dist/engines/meilisearch/binary-urls.js.map +1 -0
- package/dist/engines/meilisearch/hostdb-releases.js +21 -0
- package/dist/engines/meilisearch/hostdb-releases.js.map +1 -0
- package/dist/engines/meilisearch/index.js +992 -0
- package/dist/engines/meilisearch/index.js.map +1 -0
- package/dist/engines/meilisearch/restore.js +167 -0
- package/dist/engines/meilisearch/restore.js.map +1 -0
- package/dist/engines/meilisearch/version-maps.js +67 -0
- package/dist/engines/meilisearch/version-maps.js.map +1 -0
- package/dist/engines/meilisearch/version-validator.js +109 -0
- package/dist/engines/meilisearch/version-validator.js.map +1 -0
- package/dist/engines/mongodb/backup.js +109 -0
- package/dist/engines/mongodb/backup.js.map +1 -0
- package/dist/engines/mongodb/binary-manager.js +36 -0
- package/dist/engines/mongodb/binary-manager.js.map +1 -0
- package/dist/engines/mongodb/binary-urls.js +46 -0
- package/dist/engines/mongodb/binary-urls.js.map +1 -0
- package/dist/engines/mongodb/cli-utils.js +131 -0
- package/dist/engines/mongodb/cli-utils.js.map +1 -0
- package/dist/engines/mongodb/hostdb-releases.js +77 -0
- package/dist/engines/mongodb/hostdb-releases.js.map +1 -0
- package/dist/engines/mongodb/index.js +873 -0
- package/dist/engines/mongodb/index.js.map +1 -0
- package/dist/engines/mongodb/restore.js +276 -0
- package/dist/engines/mongodb/restore.js.map +1 -0
- package/dist/engines/mongodb/version-maps.js +79 -0
- package/dist/engines/mongodb/version-maps.js.map +1 -0
- package/dist/engines/mongodb/version-validator.js +133 -0
- package/dist/engines/mongodb/version-validator.js.map +1 -0
- package/dist/engines/mysql/backup.js +210 -0
- package/dist/engines/mysql/backup.js.map +1 -0
- package/dist/engines/mysql/binary-detection.js +325 -0
- package/dist/engines/mysql/binary-detection.js.map +1 -0
- package/dist/engines/mysql/binary-manager.js +30 -0
- package/dist/engines/mysql/binary-manager.js.map +1 -0
- package/dist/engines/mysql/binary-urls.js +87 -0
- package/dist/engines/mysql/binary-urls.js.map +1 -0
- package/{engines/mysql/hostdb-releases.ts → dist/engines/mysql/hostdb-releases.js} +20 -23
- package/dist/engines/mysql/hostdb-releases.js.map +1 -0
- package/dist/engines/mysql/index.js +1066 -0
- package/dist/engines/mysql/index.js.map +1 -0
- package/dist/engines/mysql/restore.js +361 -0
- package/dist/engines/mysql/restore.js.map +1 -0
- package/dist/engines/mysql/version-maps.js +79 -0
- package/dist/engines/mysql/version-maps.js.map +1 -0
- package/dist/engines/mysql/version-validator.js +266 -0
- package/dist/engines/mysql/version-validator.js.map +1 -0
- package/dist/engines/postgresql/backup.js +118 -0
- package/dist/engines/postgresql/backup.js.map +1 -0
- package/dist/engines/postgresql/binary-manager.js +85 -0
- package/dist/engines/postgresql/binary-manager.js.map +1 -0
- package/dist/engines/postgresql/binary-urls.js +80 -0
- package/dist/engines/postgresql/binary-urls.js.map +1 -0
- package/dist/engines/postgresql/hostdb-releases.js +21 -0
- package/dist/engines/postgresql/hostdb-releases.js.map +1 -0
- package/dist/engines/postgresql/index.js +852 -0
- package/dist/engines/postgresql/index.js.map +1 -0
- package/dist/engines/postgresql/remote-version.js +109 -0
- package/dist/engines/postgresql/remote-version.js.map +1 -0
- package/dist/engines/postgresql/restore.js +254 -0
- package/dist/engines/postgresql/restore.js.map +1 -0
- package/dist/engines/postgresql/version-maps.js +73 -0
- package/dist/engines/postgresql/version-maps.js.map +1 -0
- package/dist/engines/postgresql/version-validator.js +286 -0
- package/dist/engines/postgresql/version-validator.js.map +1 -0
- package/dist/engines/qdrant/api-client.js +50 -0
- package/dist/engines/qdrant/api-client.js.map +1 -0
- package/dist/engines/qdrant/backup.js +115 -0
- package/dist/engines/qdrant/backup.js.map +1 -0
- package/dist/engines/qdrant/binary-manager.js +31 -0
- package/dist/engines/qdrant/binary-manager.js.map +1 -0
- package/dist/engines/qdrant/binary-urls.js +92 -0
- package/dist/engines/qdrant/binary-urls.js.map +1 -0
- package/dist/engines/qdrant/cli-utils.js +39 -0
- package/dist/engines/qdrant/cli-utils.js.map +1 -0
- package/dist/engines/qdrant/hostdb-releases.js +21 -0
- package/dist/engines/qdrant/hostdb-releases.js.map +1 -0
- package/dist/engines/qdrant/index.js +1002 -0
- package/dist/engines/qdrant/index.js.map +1 -0
- package/dist/engines/qdrant/restore.js +154 -0
- package/dist/engines/qdrant/restore.js.map +1 -0
- package/dist/engines/qdrant/version-maps.js +67 -0
- package/dist/engines/qdrant/version-maps.js.map +1 -0
- package/dist/engines/qdrant/version-validator.js +109 -0
- package/dist/engines/qdrant/version-validator.js.map +1 -0
- package/dist/engines/questdb/backup.js +191 -0
- package/dist/engines/questdb/backup.js.map +1 -0
- package/dist/engines/questdb/binary-manager.js +247 -0
- package/dist/engines/questdb/binary-manager.js.map +1 -0
- package/dist/engines/questdb/binary-urls.js +27 -0
- package/dist/engines/questdb/binary-urls.js.map +1 -0
- package/dist/engines/questdb/hostdb-releases.js +21 -0
- package/dist/engines/questdb/hostdb-releases.js.map +1 -0
- package/dist/engines/questdb/index.js +814 -0
- package/dist/engines/questdb/index.js.map +1 -0
- package/dist/engines/questdb/restore.js +202 -0
- package/dist/engines/questdb/restore.js.map +1 -0
- package/dist/engines/questdb/version-maps.js +33 -0
- package/dist/engines/questdb/version-maps.js.map +1 -0
- package/dist/engines/questdb/version-validator.js +99 -0
- package/dist/engines/questdb/version-validator.js.map +1 -0
- package/dist/engines/redis/backup.js +292 -0
- package/dist/engines/redis/backup.js.map +1 -0
- package/dist/engines/redis/binary-manager.js +32 -0
- package/dist/engines/redis/binary-manager.js.map +1 -0
- package/dist/engines/redis/binary-urls.js +96 -0
- package/dist/engines/redis/binary-urls.js.map +1 -0
- package/dist/engines/redis/cli-utils.js +38 -0
- package/dist/engines/redis/cli-utils.js.map +1 -0
- package/dist/engines/redis/hostdb-releases.js +21 -0
- package/dist/engines/redis/hostdb-releases.js.map +1 -0
- package/dist/engines/redis/index.js +1263 -0
- package/dist/engines/redis/index.js.map +1 -0
- package/dist/engines/redis/restore.js +338 -0
- package/dist/engines/redis/restore.js.map +1 -0
- package/dist/engines/redis/version-maps.js +70 -0
- package/dist/engines/redis/version-maps.js.map +1 -0
- package/dist/engines/redis/version-validator.js +109 -0
- package/dist/engines/redis/version-validator.js.map +1 -0
- package/dist/engines/sqlite/binary-manager.js +39 -0
- package/dist/engines/sqlite/binary-manager.js.map +1 -0
- package/{engines/sqlite/binary-urls.ts → dist/engines/sqlite/binary-urls.js} +11 -16
- package/dist/engines/sqlite/binary-urls.js.map +1 -0
- package/dist/engines/sqlite/hostdb-releases.js +21 -0
- package/dist/engines/sqlite/hostdb-releases.js.map +1 -0
- package/dist/engines/sqlite/index.js +493 -0
- package/dist/engines/sqlite/index.js.map +1 -0
- package/dist/engines/sqlite/registry.js +163 -0
- package/dist/engines/sqlite/registry.js.map +1 -0
- package/dist/engines/sqlite/scanner.js +12 -0
- package/dist/engines/sqlite/scanner.js.map +1 -0
- package/dist/engines/sqlite/version-maps.js +57 -0
- package/dist/engines/sqlite/version-maps.js.map +1 -0
- package/dist/engines/surrealdb/backup.js +97 -0
- package/dist/engines/surrealdb/backup.js.map +1 -0
- package/dist/engines/surrealdb/binary-manager.js +33 -0
- package/dist/engines/surrealdb/binary-manager.js.map +1 -0
- package/dist/engines/surrealdb/binary-urls.js +33 -0
- package/dist/engines/surrealdb/binary-urls.js.map +1 -0
- package/dist/engines/surrealdb/cli-utils.js +147 -0
- package/dist/engines/surrealdb/cli-utils.js.map +1 -0
- package/dist/engines/surrealdb/hostdb-releases.js +21 -0
- package/dist/engines/surrealdb/hostdb-releases.js.map +1 -0
- package/dist/engines/surrealdb/index.js +1022 -0
- package/dist/engines/surrealdb/index.js.map +1 -0
- package/dist/engines/surrealdb/restore.js +224 -0
- package/dist/engines/surrealdb/restore.js.map +1 -0
- package/dist/engines/surrealdb/version-maps.js +36 -0
- package/dist/engines/surrealdb/version-maps.js.map +1 -0
- package/dist/engines/tigerbeetle/backup.js +36 -0
- package/dist/engines/tigerbeetle/backup.js.map +1 -0
- package/dist/engines/tigerbeetle/binary-manager.js +72 -0
- package/dist/engines/tigerbeetle/binary-manager.js.map +1 -0
- package/dist/engines/tigerbeetle/binary-urls.js +49 -0
- package/dist/engines/tigerbeetle/binary-urls.js.map +1 -0
- package/dist/engines/tigerbeetle/hostdb-releases.js +21 -0
- package/dist/engines/tigerbeetle/hostdb-releases.js.map +1 -0
- package/dist/engines/tigerbeetle/index.js +559 -0
- package/dist/engines/tigerbeetle/index.js.map +1 -0
- package/dist/engines/tigerbeetle/restore.js +91 -0
- package/dist/engines/tigerbeetle/restore.js.map +1 -0
- package/{engines/tigerbeetle/version-maps.ts → dist/engines/tigerbeetle/version-maps.js} +22 -31
- package/dist/engines/tigerbeetle/version-maps.js.map +1 -0
- package/dist/engines/tigerbeetle/version-validator.js +108 -0
- package/dist/engines/tigerbeetle/version-validator.js.map +1 -0
- package/dist/engines/typedb/backup.js +129 -0
- package/dist/engines/typedb/backup.js.map +1 -0
- package/dist/engines/typedb/binary-manager.js +151 -0
- package/dist/engines/typedb/binary-manager.js.map +1 -0
- package/dist/engines/typedb/binary-urls.js +33 -0
- package/dist/engines/typedb/binary-urls.js.map +1 -0
- package/dist/engines/typedb/cli-utils.js +163 -0
- package/dist/engines/typedb/cli-utils.js.map +1 -0
- package/dist/engines/typedb/hostdb-releases.js +21 -0
- package/dist/engines/typedb/hostdb-releases.js.map +1 -0
- package/dist/engines/typedb/index.js +1003 -0
- package/dist/engines/typedb/index.js.map +1 -0
- package/dist/engines/typedb/restore.js +279 -0
- package/dist/engines/typedb/restore.js.map +1 -0
- package/dist/engines/typedb/version-maps.js +40 -0
- package/dist/engines/typedb/version-maps.js.map +1 -0
- package/dist/engines/typedb/version-validator.js +103 -0
- package/dist/engines/typedb/version-validator.js.map +1 -0
- package/dist/engines/valkey/backup.js +292 -0
- package/dist/engines/valkey/backup.js.map +1 -0
- package/dist/engines/valkey/binary-manager.js +33 -0
- package/dist/engines/valkey/binary-manager.js.map +1 -0
- package/dist/engines/valkey/binary-urls.js +98 -0
- package/dist/engines/valkey/binary-urls.js.map +1 -0
- package/dist/engines/valkey/cli-utils.js +38 -0
- package/dist/engines/valkey/cli-utils.js.map +1 -0
- package/dist/engines/valkey/hostdb-releases.js +21 -0
- package/dist/engines/valkey/hostdb-releases.js.map +1 -0
- package/dist/engines/valkey/index.js +1257 -0
- package/dist/engines/valkey/index.js.map +1 -0
- package/dist/engines/valkey/restore.js +340 -0
- package/dist/engines/valkey/restore.js.map +1 -0
- package/dist/engines/valkey/version-maps.js +70 -0
- package/dist/engines/valkey/version-maps.js.map +1 -0
- package/dist/engines/valkey/version-validator.js +112 -0
- package/dist/engines/valkey/version-validator.js.map +1 -0
- package/dist/engines/weaviate/api-client.js +50 -0
- package/dist/engines/weaviate/api-client.js.map +1 -0
- package/dist/engines/weaviate/backup.js +95 -0
- package/dist/engines/weaviate/backup.js.map +1 -0
- package/dist/engines/weaviate/binary-manager.js +58 -0
- package/dist/engines/weaviate/binary-manager.js.map +1 -0
- package/dist/engines/weaviate/binary-urls.js +92 -0
- package/dist/engines/weaviate/binary-urls.js.map +1 -0
- package/dist/engines/weaviate/cli-utils.js +39 -0
- package/dist/engines/weaviate/cli-utils.js.map +1 -0
- package/dist/engines/weaviate/hostdb-releases.js +21 -0
- package/dist/engines/weaviate/hostdb-releases.js.map +1 -0
- package/dist/engines/weaviate/index.js +871 -0
- package/dist/engines/weaviate/index.js.map +1 -0
- package/dist/engines/weaviate/restore.js +185 -0
- package/dist/engines/weaviate/restore.js.map +1 -0
- package/dist/engines/weaviate/version-maps.js +67 -0
- package/dist/engines/weaviate/version-maps.js.map +1 -0
- package/dist/engines/weaviate/version-validator.js +109 -0
- package/dist/engines/weaviate/version-validator.js.map +1 -0
- package/dist/types/index.js +102 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +12 -9
- package/bin/cli.js +0 -68
- package/cli/bin.ts +0 -10
- package/cli/commands/attach.ts +0 -139
- package/cli/commands/backup.ts +0 -290
- package/cli/commands/backups.ts +0 -247
- package/cli/commands/clone.ts +0 -159
- package/cli/commands/config.ts +0 -367
- package/cli/commands/connect.ts +0 -684
- package/cli/commands/create.ts +0 -1201
- package/cli/commands/databases.ts +0 -630
- package/cli/commands/delete.ts +0 -133
- package/cli/commands/deps.ts +0 -342
- package/cli/commands/detach.ts +0 -107
- package/cli/commands/doctor.ts +0 -689
- package/cli/commands/duckdb.ts +0 -273
- package/cli/commands/edit.ts +0 -683
- package/cli/commands/engines.ts +0 -1914
- package/cli/commands/export.ts +0 -544
- package/cli/commands/info.ts +0 -340
- package/cli/commands/list.ts +0 -284
- package/cli/commands/logs.ts +0 -102
- package/cli/commands/menu/backup-handlers.ts +0 -1571
- package/cli/commands/menu/container-handlers.ts +0 -2288
- package/cli/commands/menu/engine-handlers.ts +0 -355
- package/cli/commands/menu/index.ts +0 -342
- package/cli/commands/menu/settings-handlers.ts +0 -365
- package/cli/commands/menu/shared.ts +0 -23
- package/cli/commands/menu/shell-handlers.ts +0 -1811
- package/cli/commands/menu/sql-handlers.ts +0 -231
- package/cli/commands/menu/update-handlers.ts +0 -378
- package/cli/commands/menu/validators.ts +0 -8
- package/cli/commands/ports.ts +0 -211
- package/cli/commands/pull.ts +0 -223
- package/cli/commands/query.ts +0 -241
- package/cli/commands/restore.ts +0 -587
- package/cli/commands/run.ts +0 -178
- package/cli/commands/self-update.ts +0 -121
- package/cli/commands/sqlite.ts +0 -273
- package/cli/commands/start.ts +0 -218
- package/cli/commands/stop.ts +0 -241
- package/cli/commands/url.ts +0 -104
- package/cli/commands/users.ts +0 -264
- package/cli/commands/version.ts +0 -55
- package/cli/commands/which.ts +0 -290
- package/cli/constants.ts +0 -233
- package/cli/helpers.ts +0 -1593
- package/cli/index.ts +0 -162
- package/cli/ui/prompts.ts +0 -1525
- package/cli/ui/spinner.ts +0 -88
- package/cli/ui/theme.ts +0 -128
- package/cli/utils/file-follower.ts +0 -93
- package/config/backup-formats.ts +0 -446
- package/config/defaults.ts +0 -56
- package/config/engine-defaults.ts +0 -336
- package/config/engines-registry.ts +0 -150
- package/config/engines.schema.json +0 -135
- package/config/os-dependencies.ts +0 -888
- package/config/paths.ts +0 -200
- package/core/backup-restore.ts +0 -330
- package/core/base-binary-manager.ts +0 -562
- package/core/base-document-binary-manager.ts +0 -523
- package/core/base-embedded-binary-manager.ts +0 -547
- package/core/base-server-binary-manager.ts +0 -523
- package/core/config-manager.ts +0 -652
- package/core/container-manager.ts +0 -787
- package/core/credential-generator.ts +0 -93
- package/core/credential-manager.ts +0 -259
- package/core/dblab-utils.ts +0 -113
- package/core/dependency-manager.ts +0 -512
- package/core/docker-exporter.ts +0 -1345
- package/core/error-handler.ts +0 -419
- package/core/fs-error-utils.ts +0 -82
- package/core/homebrew-version-manager.ts +0 -352
- package/core/hostdb-client.ts +0 -344
- package/core/hostdb-metadata.ts +0 -350
- package/core/hostdb-releases-factory.ts +0 -237
- package/core/library-env.ts +0 -118
- package/core/pgweb-utils.ts +0 -62
- package/core/platform-service.ts +0 -829
- package/core/port-manager.ts +0 -165
- package/core/process-manager.ts +0 -576
- package/core/pull-manager.ts +0 -511
- package/core/query-parser.ts +0 -514
- package/core/spawn-utils.ts +0 -122
- package/core/start-with-retry.ts +0 -130
- package/core/test-cleanup.ts +0 -108
- package/core/tls-generator.ts +0 -116
- package/core/transaction-manager.ts +0 -158
- package/core/update-manager.ts +0 -308
- package/core/version-migration.ts +0 -346
- package/core/version-utils.ts +0 -104
- package/engines/base-engine.ts +0 -340
- package/engines/clickhouse/README.md +0 -231
- package/engines/clickhouse/backup.ts +0 -398
- package/engines/clickhouse/binary-manager.ts +0 -201
- package/engines/clickhouse/binary-urls.ts +0 -125
- package/engines/clickhouse/cli-utils.ts +0 -176
- package/engines/clickhouse/hostdb-releases.ts +0 -30
- package/engines/clickhouse/index.ts +0 -1345
- package/engines/clickhouse/restore.ts +0 -466
- package/engines/clickhouse/version-maps.ts +0 -95
- package/engines/clickhouse/version-validator.ts +0 -154
- package/engines/cockroachdb/README.md +0 -170
- package/engines/cockroachdb/backup.ts +0 -376
- package/engines/cockroachdb/binary-manager.ts +0 -45
- package/engines/cockroachdb/binary-urls.ts +0 -40
- package/engines/cockroachdb/cli-utils.ts +0 -384
- package/engines/cockroachdb/hostdb-releases.ts +0 -26
- package/engines/cockroachdb/index.ts +0 -1276
- package/engines/cockroachdb/restore.ts +0 -455
- package/engines/cockroachdb/version-maps.ts +0 -42
- package/engines/couchdb/README.md +0 -257
- package/engines/couchdb/api-client.ts +0 -81
- package/engines/couchdb/backup.ts +0 -137
- package/engines/couchdb/binary-manager.ts +0 -86
- package/engines/couchdb/binary-urls.ts +0 -115
- package/engines/couchdb/hostdb-releases.ts +0 -23
- package/engines/couchdb/index.ts +0 -1429
- package/engines/couchdb/restore.ts +0 -290
- package/engines/couchdb/version-maps.ts +0 -78
- package/engines/couchdb/version-validator.ts +0 -111
- package/engines/duckdb/README.md +0 -154
- package/engines/duckdb/binary-manager.ts +0 -45
- package/engines/duckdb/hostdb-releases.ts +0 -23
- package/engines/duckdb/index.ts +0 -749
- package/engines/duckdb/registry.ts +0 -303
- package/engines/duckdb/scanner.ts +0 -22
- package/engines/duckdb/version-maps.ts +0 -78
- package/engines/duckdb/version-validator.ts +0 -78
- package/engines/ferretdb/README.md +0 -262
- package/engines/ferretdb/backup.ts +0 -173
- package/engines/ferretdb/binary-manager.ts +0 -1095
- package/engines/ferretdb/binary-urls.ts +0 -183
- package/engines/ferretdb/index.ts +0 -1907
- package/engines/ferretdb/restore.ts +0 -357
- package/engines/file-based-utils.ts +0 -262
- package/engines/index.ts +0 -131
- package/engines/influxdb/README.md +0 -180
- package/engines/influxdb/api-client.ts +0 -64
- package/engines/influxdb/backup.ts +0 -160
- package/engines/influxdb/binary-manager.ts +0 -110
- package/engines/influxdb/binary-urls.ts +0 -69
- package/engines/influxdb/hostdb-releases.ts +0 -23
- package/engines/influxdb/index.ts +0 -1272
- package/engines/influxdb/restore.ts +0 -417
- package/engines/influxdb/version-maps.ts +0 -75
- package/engines/influxdb/version-validator.ts +0 -128
- package/engines/mariadb/README.md +0 -141
- package/engines/mariadb/backup.ts +0 -233
- package/engines/mariadb/binary-manager.ts +0 -45
- package/engines/mariadb/hostdb-releases.ts +0 -23
- package/engines/mariadb/index.ts +0 -1300
- package/engines/mariadb/restore.ts +0 -447
- package/engines/mariadb/version-maps.ts +0 -72
- package/engines/mariadb/version-validator.ts +0 -181
- package/engines/meilisearch/README.md +0 -255
- package/engines/meilisearch/api-client.ts +0 -61
- package/engines/meilisearch/backup.ts +0 -233
- package/engines/meilisearch/binary-manager.ts +0 -43
- package/engines/meilisearch/binary-urls.ts +0 -69
- package/engines/meilisearch/hostdb-releases.ts +0 -26
- package/engines/meilisearch/index.ts +0 -1292
- package/engines/meilisearch/restore.ts +0 -219
- package/engines/meilisearch/version-maps.ts +0 -78
- package/engines/meilisearch/version-validator.ts +0 -128
- package/engines/mongodb/README.md +0 -162
- package/engines/mongodb/backup.ts +0 -127
- package/engines/mongodb/binary-manager.ts +0 -48
- package/engines/mongodb/binary-urls.ts +0 -63
- package/engines/mongodb/cli-utils.ts +0 -171
- package/engines/mongodb/hostdb-releases.ts +0 -91
- package/engines/mongodb/index.ts +0 -1118
- package/engines/mongodb/restore.ts +0 -361
- package/engines/mongodb/version-maps.ts +0 -91
- package/engines/mongodb/version-validator.ts +0 -160
- package/engines/mysql/README.md +0 -142
- package/engines/mysql/backup.ts +0 -270
- package/engines/mysql/binary-detection.ts +0 -408
- package/engines/mysql/binary-manager.ts +0 -42
- package/engines/mysql/binary-urls.ts +0 -104
- package/engines/mysql/index.ts +0 -1361
- package/engines/mysql/restore.ts +0 -500
- package/engines/mysql/version-maps.ts +0 -91
- package/engines/mysql/version-validator.ts +0 -369
- package/engines/postgresql/README.md +0 -158
- package/engines/postgresql/backup.ts +0 -151
- package/engines/postgresql/binary-manager.ts +0 -114
- package/engines/postgresql/binary-urls.ts +0 -99
- package/engines/postgresql/hostdb-releases.ts +0 -26
- package/engines/postgresql/index.ts +0 -1143
- package/engines/postgresql/remote-version.ts +0 -161
- package/engines/postgresql/restore.ts +0 -342
- package/engines/postgresql/version-maps.ts +0 -83
- package/engines/postgresql/version-validator.ts +0 -413
- package/engines/qdrant/README.md +0 -222
- package/engines/qdrant/api-client.ts +0 -61
- package/engines/qdrant/backup.ts +0 -165
- package/engines/qdrant/binary-manager.ts +0 -43
- package/engines/qdrant/binary-urls.ts +0 -115
- package/engines/qdrant/cli-utils.ts +0 -43
- package/engines/qdrant/hostdb-releases.ts +0 -23
- package/engines/qdrant/index.ts +0 -1312
- package/engines/qdrant/restore.ts +0 -203
- package/engines/qdrant/version-maps.ts +0 -78
- package/engines/qdrant/version-validator.ts +0 -128
- package/engines/questdb/README.md +0 -334
- package/engines/questdb/backup.ts +0 -220
- package/engines/questdb/binary-manager.ts +0 -310
- package/engines/questdb/binary-urls.ts +0 -34
- package/engines/questdb/hostdb-releases.ts +0 -23
- package/engines/questdb/index.ts +0 -1023
- package/engines/questdb/restore.ts +0 -260
- package/engines/questdb/version-maps.ts +0 -37
- package/engines/questdb/version-validator.ts +0 -121
- package/engines/redis/README.md +0 -173
- package/engines/redis/backup.ts +0 -389
- package/engines/redis/binary-manager.ts +0 -44
- package/engines/redis/binary-urls.ts +0 -117
- package/engines/redis/cli-utils.ts +0 -42
- package/engines/redis/hostdb-releases.ts +0 -23
- package/engines/redis/index.ts +0 -1583
- package/engines/redis/restore.ts +0 -443
- package/engines/redis/version-maps.ts +0 -81
- package/engines/redis/version-validator.ts +0 -131
- package/engines/sqlite/README.md +0 -162
- package/engines/sqlite/binary-manager.ts +0 -52
- package/engines/sqlite/hostdb-releases.ts +0 -23
- package/engines/sqlite/index.ts +0 -641
- package/engines/sqlite/registry.ts +0 -198
- package/engines/sqlite/scanner.ts +0 -22
- package/engines/sqlite/version-maps.ts +0 -64
- package/engines/surrealdb/README.md +0 -218
- package/engines/surrealdb/backup.ts +0 -131
- package/engines/surrealdb/binary-manager.ts +0 -45
- package/engines/surrealdb/binary-urls.ts +0 -40
- package/engines/surrealdb/cli-utils.ts +0 -173
- package/engines/surrealdb/hostdb-releases.ts +0 -23
- package/engines/surrealdb/index.ts +0 -1246
- package/engines/surrealdb/restore.ts +0 -302
- package/engines/surrealdb/version-maps.ts +0 -41
- package/engines/tigerbeetle/README.md +0 -61
- package/engines/tigerbeetle/backup.ts +0 -49
- package/engines/tigerbeetle/binary-manager.ts +0 -95
- package/engines/tigerbeetle/binary-urls.ts +0 -62
- package/engines/tigerbeetle/hostdb-releases.ts +0 -26
- package/engines/tigerbeetle/index.ts +0 -746
- package/engines/tigerbeetle/restore.ts +0 -130
- package/engines/tigerbeetle/version-validator.ts +0 -126
- package/engines/typedb/backup.ts +0 -167
- package/engines/typedb/binary-manager.ts +0 -200
- package/engines/typedb/binary-urls.ts +0 -40
- package/engines/typedb/cli-utils.ts +0 -210
- package/engines/typedb/hostdb-releases.ts +0 -23
- package/engines/typedb/index.ts +0 -1275
- package/engines/typedb/restore.ts +0 -377
- package/engines/typedb/version-maps.ts +0 -48
- package/engines/typedb/version-validator.ts +0 -127
- package/engines/valkey/README.md +0 -219
- package/engines/valkey/backup.ts +0 -389
- package/engines/valkey/binary-manager.ts +0 -45
- package/engines/valkey/binary-urls.ts +0 -122
- package/engines/valkey/cli-utils.ts +0 -42
- package/engines/valkey/hostdb-releases.ts +0 -23
- package/engines/valkey/index.ts +0 -1585
- package/engines/valkey/restore.ts +0 -446
- package/engines/valkey/version-maps.ts +0 -81
- package/engines/valkey/version-validator.ts +0 -131
- package/engines/weaviate/README.md +0 -302
- package/engines/weaviate/api-client.ts +0 -61
- package/engines/weaviate/backup.ts +0 -145
- package/engines/weaviate/binary-manager.ts +0 -80
- package/engines/weaviate/binary-urls.ts +0 -115
- package/engines/weaviate/cli-utils.ts +0 -43
- package/engines/weaviate/hostdb-releases.ts +0 -23
- package/engines/weaviate/index.ts +0 -1139
- package/engines/weaviate/restore.ts +0 -235
- package/engines/weaviate/version-maps.ts +0 -78
- package/engines/weaviate/version-validator.ts +0 -128
- package/types/index.ts +0 -624
- /package/{config → dist/config}/engines.json +0 -0
|
@@ -0,0 +1,814 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QuestDB Engine Implementation
|
|
3
|
+
*
|
|
4
|
+
* QuestDB is a high-performance time-series database with built-in support for
|
|
5
|
+
* SQL queries via PostgreSQL wire protocol.
|
|
6
|
+
*
|
|
7
|
+
* Key characteristics:
|
|
8
|
+
* - Default PostgreSQL wire protocol port: 8812
|
|
9
|
+
* - Default HTTP port: 9000 (REST API and Web Console)
|
|
10
|
+
* - Default ILP (InfluxDB Line Protocol) port: 9009
|
|
11
|
+
* - Java-based with bundled JRE (no Java installation required)
|
|
12
|
+
* - Startup script: questdb.sh (Unix) or questdb.exe (Windows)
|
|
13
|
+
* - Default database: qdb (root database)
|
|
14
|
+
* - Default user: admin (password: quest)
|
|
15
|
+
* - Query language: SQL (with time-series extensions)
|
|
16
|
+
* - Web Console at http://localhost:9000
|
|
17
|
+
*/
|
|
18
|
+
import { spawn } from 'child_process';
|
|
19
|
+
import { existsSync } from 'fs';
|
|
20
|
+
import { mkdir, writeFile, readFile, unlink, readdir, stat } from 'fs/promises';
|
|
21
|
+
import { join } from 'path';
|
|
22
|
+
import { BaseEngine } from '../base-engine.js';
|
|
23
|
+
import { paths } from '../../config/paths.js';
|
|
24
|
+
import { getEngineDefaults } from '../../config/defaults.js';
|
|
25
|
+
import { platformService } from '../../core/platform-service.js';
|
|
26
|
+
import { configManager } from '../../core/config-manager.js';
|
|
27
|
+
import { logDebug, logWarning } from '../../core/error-handler.js';
|
|
28
|
+
import { findBinary } from '../../core/dependency-manager.js';
|
|
29
|
+
import { processManager } from '../../core/process-manager.js';
|
|
30
|
+
import { questdbBinaryManager } from './binary-manager.js';
|
|
31
|
+
import { getBinaryUrl } from './binary-urls.js';
|
|
32
|
+
import { normalizeVersion, SUPPORTED_MAJOR_VERSIONS, QUESTDB_VERSION_MAP, } from './version-maps.js';
|
|
33
|
+
import { fetchAvailableVersions as fetchHostdbVersions } from './hostdb-releases.js';
|
|
34
|
+
import { detectBackupFormat as detectBackupFormatImpl, restoreBackup, parseConnectionString, } from './restore.js';
|
|
35
|
+
import { createBackup } from './backup.js';
|
|
36
|
+
import { parseCSVToQueryResult } from '../../core/query-parser.js';
|
|
37
|
+
const ENGINE = 'questdb';
|
|
38
|
+
const engineDef = getEngineDefaults(ENGINE);
|
|
39
|
+
export class QuestDBEngine extends BaseEngine {
|
|
40
|
+
name = ENGINE;
|
|
41
|
+
displayName = 'QuestDB';
|
|
42
|
+
defaultPort = engineDef.defaultPort;
|
|
43
|
+
supportedVersions = SUPPORTED_MAJOR_VERSIONS;
|
|
44
|
+
// Get platform info for binary operations
|
|
45
|
+
getPlatformInfo() {
|
|
46
|
+
return platformService.getPlatformInfo();
|
|
47
|
+
}
|
|
48
|
+
// Fetch available versions from hostdb (dynamically or from cache/fallback)
|
|
49
|
+
async fetchAvailableVersions() {
|
|
50
|
+
return fetchHostdbVersions();
|
|
51
|
+
}
|
|
52
|
+
// Get binary download URL from hostdb
|
|
53
|
+
getBinaryUrl(version, platform, arch) {
|
|
54
|
+
return getBinaryUrl(version, platform, arch);
|
|
55
|
+
}
|
|
56
|
+
// Resolves version string to full version (e.g., '9' -> '9.2.3')
|
|
57
|
+
resolveFullVersion(version) {
|
|
58
|
+
if (/^\d+\.\d+\.\d+$/.test(version)) {
|
|
59
|
+
return version;
|
|
60
|
+
}
|
|
61
|
+
return QUESTDB_VERSION_MAP[version] || version;
|
|
62
|
+
}
|
|
63
|
+
// Get the path where binaries for a version would be installed
|
|
64
|
+
getBinaryPath(version) {
|
|
65
|
+
const fullVersion = this.resolveFullVersion(version);
|
|
66
|
+
const { platform: p, arch: a } = this.getPlatformInfo();
|
|
67
|
+
return paths.getBinaryPath({
|
|
68
|
+
engine: 'questdb',
|
|
69
|
+
version: fullVersion,
|
|
70
|
+
platform: p,
|
|
71
|
+
arch: a,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
// Verify that QuestDB binaries are available
|
|
75
|
+
async verifyBinary(binPath) {
|
|
76
|
+
// Check both root and bin/ subdirectory (structure differs by platform)
|
|
77
|
+
const { platform } = this.getPlatformInfo();
|
|
78
|
+
if (platform === 'win32') {
|
|
79
|
+
const exePathRoot = join(binPath, 'questdb.exe');
|
|
80
|
+
const exePathBin = join(binPath, 'bin', 'questdb.exe');
|
|
81
|
+
return existsSync(exePathRoot) || existsSync(exePathBin);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const shPathRoot = join(binPath, 'questdb.sh');
|
|
85
|
+
const shPathBin = join(binPath, 'bin', 'questdb.sh');
|
|
86
|
+
return existsSync(shPathRoot) || existsSync(shPathBin);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Check if a specific QuestDB version is installed (downloaded)
|
|
90
|
+
async isBinaryInstalled(version) {
|
|
91
|
+
const { platform, arch } = this.getPlatformInfo();
|
|
92
|
+
return questdbBinaryManager.isInstalled(version, platform, arch);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Ensure QuestDB binaries are available for a specific version
|
|
96
|
+
* Downloads from hostdb if not already installed
|
|
97
|
+
* Returns the path to the installation directory
|
|
98
|
+
*/
|
|
99
|
+
async ensureBinaries(version, onProgress) {
|
|
100
|
+
const { platform, arch } = this.getPlatformInfo();
|
|
101
|
+
const binPath = await questdbBinaryManager.ensureInstalled(version, platform, arch, onProgress);
|
|
102
|
+
// Ensure startup script is executable
|
|
103
|
+
await questdbBinaryManager.postExtract(binPath, platform);
|
|
104
|
+
// Register the startup script in config
|
|
105
|
+
// Register the startup script in config - check both locations
|
|
106
|
+
if (platform === 'win32') {
|
|
107
|
+
const exePathRoot = join(binPath, 'questdb.exe');
|
|
108
|
+
const exePathBin = join(binPath, 'bin', 'questdb.exe');
|
|
109
|
+
const exePath = existsSync(exePathRoot) ? exePathRoot : exePathBin;
|
|
110
|
+
if (existsSync(exePath)) {
|
|
111
|
+
await configManager.setBinaryPath('questdb', exePath, 'bundled');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
const shPathRoot = join(binPath, 'questdb.sh');
|
|
116
|
+
const shPathBin = join(binPath, 'bin', 'questdb.sh');
|
|
117
|
+
const shPath = existsSync(shPathRoot) ? shPathRoot : shPathBin;
|
|
118
|
+
if (existsSync(shPath)) {
|
|
119
|
+
await configManager.setBinaryPath('questdb', shPath, 'bundled');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return binPath;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Initialize a new QuestDB data directory
|
|
126
|
+
*/
|
|
127
|
+
async initDataDir(containerName, _version, _options = {}) {
|
|
128
|
+
const dataDir = paths.getContainerDataPath(containerName, {
|
|
129
|
+
engine: ENGINE,
|
|
130
|
+
});
|
|
131
|
+
// Create data directory
|
|
132
|
+
await mkdir(dataDir, { recursive: true });
|
|
133
|
+
logDebug(`Created QuestDB data directory: ${dataDir}`);
|
|
134
|
+
return dataDir;
|
|
135
|
+
}
|
|
136
|
+
// Get the path to QuestDB startup script for a version
|
|
137
|
+
async getQuestDBPath(version) {
|
|
138
|
+
const { platform, arch } = this.getPlatformInfo();
|
|
139
|
+
const fullVersion = normalizeVersion(version);
|
|
140
|
+
const binPath = paths.getBinaryPath({
|
|
141
|
+
engine: 'questdb',
|
|
142
|
+
version: fullVersion,
|
|
143
|
+
platform,
|
|
144
|
+
arch,
|
|
145
|
+
});
|
|
146
|
+
// Check both root and bin/ subdirectory (structure differs by platform)
|
|
147
|
+
if (platform === 'win32') {
|
|
148
|
+
const exePathRoot = join(binPath, 'questdb.exe');
|
|
149
|
+
const exePathBin = join(binPath, 'bin', 'questdb.exe');
|
|
150
|
+
if (existsSync(exePathRoot))
|
|
151
|
+
return exePathRoot;
|
|
152
|
+
if (existsSync(exePathBin))
|
|
153
|
+
return exePathBin;
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
const shPathRoot = join(binPath, 'questdb.sh');
|
|
157
|
+
const shPathBin = join(binPath, 'bin', 'questdb.sh');
|
|
158
|
+
if (existsSync(shPathRoot))
|
|
159
|
+
return shPathRoot;
|
|
160
|
+
if (existsSync(shPathBin))
|
|
161
|
+
return shPathBin;
|
|
162
|
+
}
|
|
163
|
+
throw new Error(`QuestDB ${version} is not installed. Run: spindb engines download questdb ${version}`);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Start QuestDB server
|
|
167
|
+
*/
|
|
168
|
+
async start(container, onProgress) {
|
|
169
|
+
const { name, port, version, binaryPath } = container;
|
|
170
|
+
// Check if already running
|
|
171
|
+
const alreadyRunning = await processManager.isRunning(name, {
|
|
172
|
+
engine: ENGINE,
|
|
173
|
+
});
|
|
174
|
+
if (alreadyRunning) {
|
|
175
|
+
return {
|
|
176
|
+
port,
|
|
177
|
+
connectionString: this.getConnectionString(container),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
// Get QuestDB binary path - check both root and bin/ subdirectory
|
|
181
|
+
let questdbBinary = null;
|
|
182
|
+
const { platform } = this.getPlatformInfo();
|
|
183
|
+
if (binaryPath && existsSync(binaryPath)) {
|
|
184
|
+
if (platform === 'win32') {
|
|
185
|
+
const exePathRoot = join(binaryPath, 'questdb.exe');
|
|
186
|
+
const exePathBin = join(binaryPath, 'bin', 'questdb.exe');
|
|
187
|
+
if (existsSync(exePathRoot)) {
|
|
188
|
+
questdbBinary = exePathRoot;
|
|
189
|
+
logDebug(`Using stored binary path: ${questdbBinary}`);
|
|
190
|
+
}
|
|
191
|
+
else if (existsSync(exePathBin)) {
|
|
192
|
+
questdbBinary = exePathBin;
|
|
193
|
+
logDebug(`Using stored binary path (bin/): ${questdbBinary}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
const shPathRoot = join(binaryPath, 'questdb.sh');
|
|
198
|
+
const shPathBin = join(binaryPath, 'bin', 'questdb.sh');
|
|
199
|
+
if (existsSync(shPathRoot)) {
|
|
200
|
+
questdbBinary = shPathRoot;
|
|
201
|
+
logDebug(`Using stored binary path: ${questdbBinary}`);
|
|
202
|
+
}
|
|
203
|
+
else if (existsSync(shPathBin)) {
|
|
204
|
+
questdbBinary = shPathBin;
|
|
205
|
+
logDebug(`Using stored binary path (bin/): ${questdbBinary}`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (!questdbBinary) {
|
|
210
|
+
try {
|
|
211
|
+
questdbBinary = await this.getQuestDBPath(version);
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
const originalMessage = error instanceof Error ? error.message : String(error);
|
|
215
|
+
throw new Error(`QuestDB ${version} is not installed. Run: spindb engines download questdb ${version}\n` +
|
|
216
|
+
` Original error: ${originalMessage}`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const containerDir = paths.getContainerPath(name, { engine: ENGINE });
|
|
220
|
+
const dataDir = paths.getContainerDataPath(name, { engine: ENGINE });
|
|
221
|
+
const pidFile = join(containerDir, 'questdb.pid');
|
|
222
|
+
// Calculate HTTP port (default is PG port + 188, i.e., 8812 + 188 = 9000)
|
|
223
|
+
const httpPort = port + 188;
|
|
224
|
+
onProgress?.({ stage: 'starting', message: 'Starting QuestDB...' });
|
|
225
|
+
logDebug(`Starting QuestDB with data dir: ${dataDir}`);
|
|
226
|
+
const isWindows = platform === 'win32';
|
|
227
|
+
// QuestDB startup command
|
|
228
|
+
// Windows: questdb.exe doesn't support 'start' subcommand reliably (GitHub #1222)
|
|
229
|
+
// Run without 'start' command - it starts in interactive/foreground mode
|
|
230
|
+
// Unix: questdb.sh start -d ... -t ... -n daemonizes properly
|
|
231
|
+
// -t tag: Unique process tag allows multiple QuestDB instances to run simultaneously
|
|
232
|
+
// Without this, QuestDB detects other instances by process label and refuses to start
|
|
233
|
+
const args = isWindows
|
|
234
|
+
? ['-d', dataDir, '-t', name] // Windows: no 'start' command, no '-n' flag
|
|
235
|
+
: ['start', '-d', dataDir, '-t', name, '-n']; // Unix: full daemon mode
|
|
236
|
+
// Environment variables for QuestDB configuration
|
|
237
|
+
// Note: Don't set QDB_LOG_W_FILE_LOCATION - QuestDB expects rolling log patterns with $
|
|
238
|
+
// Logs are written to dataDir/log/ by default
|
|
239
|
+
//
|
|
240
|
+
// Port offsets from base PostgreSQL port:
|
|
241
|
+
// - HTTP Server: +188 (default 9000)
|
|
242
|
+
// - HTTP Min Server: +191 (default 9003) - for health checks/metrics
|
|
243
|
+
// - ILP TCP: +197 (default 9009)
|
|
244
|
+
const env = {
|
|
245
|
+
...process.env,
|
|
246
|
+
QDB_HTTP_BIND_TO: `0.0.0.0:${httpPort}`,
|
|
247
|
+
QDB_HTTP_MIN_NET_BIND_TO: `0.0.0.0:${port + 191}`, // HTTP Min Server (health/metrics)
|
|
248
|
+
QDB_PG_NET_BIND_TO: `0.0.0.0:${port}`,
|
|
249
|
+
QDB_LINE_TCP_NET_BIND_TO: `0.0.0.0:${port + 197}`, // ILP port
|
|
250
|
+
};
|
|
251
|
+
// IMPORTANT: Use 'ignore' for all stdio to prevent hanging
|
|
252
|
+
// QuestDB runs as a daemon and we don't want to keep file descriptors open
|
|
253
|
+
const spawnOptions = {
|
|
254
|
+
stdio: ['ignore', 'ignore', 'ignore'],
|
|
255
|
+
detached: true,
|
|
256
|
+
cwd: containerDir,
|
|
257
|
+
env,
|
|
258
|
+
windowsHide: true,
|
|
259
|
+
};
|
|
260
|
+
logDebug(`Spawning QuestDB: ${questdbBinary} ${args.join(' ')}`);
|
|
261
|
+
const proc = spawn(questdbBinary, args, spawnOptions);
|
|
262
|
+
// Allow the process to detach immediately
|
|
263
|
+
// Note: We don't write the PID file here because questdb.sh forks the Java
|
|
264
|
+
// process and exits. The shell's PID becomes invalid immediately.
|
|
265
|
+
// QuestDB writes its own PID file to {dataDir}/questdb.pid which we'll
|
|
266
|
+
// read after waiting for the server to be ready.
|
|
267
|
+
proc.unref();
|
|
268
|
+
// Wait for server to be ready
|
|
269
|
+
const timeout = isWindows ? 90000 : 60000;
|
|
270
|
+
logDebug(`Waiting for QuestDB to be ready on port ${port}... (timeout: ${timeout}ms)`);
|
|
271
|
+
// Give QuestDB a moment to start before checking
|
|
272
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
273
|
+
const ready = await this.waitForReady(port, version, timeout);
|
|
274
|
+
logDebug(`waitForReady returned: ${ready}`);
|
|
275
|
+
if (!ready) {
|
|
276
|
+
// Clean up on failure - try to find and kill the QuestDB process by port
|
|
277
|
+
try {
|
|
278
|
+
const pids = await platformService.findProcessByPort(port);
|
|
279
|
+
if (pids.length > 0) {
|
|
280
|
+
logDebug(`Cleaning up failed QuestDB process (pid: ${pids[0]})`);
|
|
281
|
+
await platformService.terminateProcess(pids[0], true);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
catch {
|
|
285
|
+
// Ignore cleanup errors
|
|
286
|
+
}
|
|
287
|
+
throw new Error(`QuestDB failed to start within timeout. Check logs at: ${dataDir}/log/`);
|
|
288
|
+
}
|
|
289
|
+
// QuestDB is ready - find the actual Java process PID by port
|
|
290
|
+
// QuestDB doesn't create a PID file in daemon mode, so we find the process by port
|
|
291
|
+
try {
|
|
292
|
+
const pids = await platformService.findProcessByPort(port);
|
|
293
|
+
if (pids.length > 0) {
|
|
294
|
+
const actualPid = pids[0];
|
|
295
|
+
await writeFile(pidFile, actualPid.toString(), 'utf-8');
|
|
296
|
+
logDebug(`Wrote PID file: ${pidFile} (pid: ${actualPid})`);
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
logDebug('Could not find QuestDB process by port - PID file not created');
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
catch (err) {
|
|
303
|
+
logDebug(`Could not find QuestDB PID: ${err instanceof Error ? err.message : String(err)}`);
|
|
304
|
+
// Don't fail - QuestDB is running, we just can't track its PID
|
|
305
|
+
}
|
|
306
|
+
return {
|
|
307
|
+
port,
|
|
308
|
+
connectionString: this.getConnectionString(container),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
// Wait for QuestDB to be ready using psql
|
|
312
|
+
async waitForReady(port, version, timeoutMs = 60000) {
|
|
313
|
+
logDebug(`waitForReady called for port ${port}`);
|
|
314
|
+
const startTime = Date.now();
|
|
315
|
+
const checkInterval = 500;
|
|
316
|
+
// Try to find psql for connection checking
|
|
317
|
+
let psqlPath = await configManager.getBinaryPath('psql');
|
|
318
|
+
if (!psqlPath) {
|
|
319
|
+
// Try system psql
|
|
320
|
+
try {
|
|
321
|
+
const result = await findBinary('psql');
|
|
322
|
+
if (result?.path) {
|
|
323
|
+
psqlPath = result.path;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
catch {
|
|
327
|
+
// Ignore
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
// If no psql, try HTTP health check instead
|
|
331
|
+
if (!psqlPath) {
|
|
332
|
+
logDebug('psql not found, using HTTP health check');
|
|
333
|
+
return this.waitForReadyHttp(port + 188, timeoutMs);
|
|
334
|
+
}
|
|
335
|
+
let attempt = 0;
|
|
336
|
+
while (Date.now() - startTime < timeoutMs) {
|
|
337
|
+
attempt++;
|
|
338
|
+
logDebug(`Connection attempt ${attempt}...`);
|
|
339
|
+
try {
|
|
340
|
+
await new Promise((resolve, reject) => {
|
|
341
|
+
const proc = spawn(psqlPath, [
|
|
342
|
+
'-h',
|
|
343
|
+
'127.0.0.1',
|
|
344
|
+
'-p',
|
|
345
|
+
String(port),
|
|
346
|
+
'-U',
|
|
347
|
+
'admin',
|
|
348
|
+
'-d',
|
|
349
|
+
'qdb',
|
|
350
|
+
'-c',
|
|
351
|
+
'SELECT 1;',
|
|
352
|
+
], {
|
|
353
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
354
|
+
env: { ...process.env, PGPASSWORD: 'quest' },
|
|
355
|
+
});
|
|
356
|
+
proc.on('close', (code) => {
|
|
357
|
+
if (code === 0)
|
|
358
|
+
resolve();
|
|
359
|
+
else
|
|
360
|
+
reject(new Error(`Exit code ${code}`));
|
|
361
|
+
});
|
|
362
|
+
proc.on('error', reject);
|
|
363
|
+
});
|
|
364
|
+
logDebug(`QuestDB ready on port ${port}`);
|
|
365
|
+
return true;
|
|
366
|
+
}
|
|
367
|
+
catch (err) {
|
|
368
|
+
logDebug(`Attempt ${attempt} failed: ${err}`);
|
|
369
|
+
await new Promise((resolve) => setTimeout(resolve, checkInterval));
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
logWarning(`QuestDB did not become ready within ${timeoutMs}ms`);
|
|
373
|
+
return false;
|
|
374
|
+
}
|
|
375
|
+
// Fallback: wait using HTTP health check
|
|
376
|
+
async waitForReadyHttp(httpPort, timeoutMs) {
|
|
377
|
+
const startTime = Date.now();
|
|
378
|
+
const checkInterval = 500;
|
|
379
|
+
while (Date.now() - startTime < timeoutMs) {
|
|
380
|
+
try {
|
|
381
|
+
const response = await fetch(`http://127.0.0.1:${httpPort}/exec?query=SELECT%201`);
|
|
382
|
+
if (response.ok) {
|
|
383
|
+
logDebug(`QuestDB HTTP ready on port ${httpPort}`);
|
|
384
|
+
return true;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
catch {
|
|
388
|
+
// Not ready yet
|
|
389
|
+
}
|
|
390
|
+
await new Promise((resolve) => setTimeout(resolve, checkInterval));
|
|
391
|
+
}
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Stop QuestDB server
|
|
396
|
+
*/
|
|
397
|
+
async stop(container) {
|
|
398
|
+
const { name, port } = container;
|
|
399
|
+
const containerDir = paths.getContainerPath(name, { engine: ENGINE });
|
|
400
|
+
const pidFile = join(containerDir, 'questdb.pid');
|
|
401
|
+
logDebug(`Stopping QuestDB container "${name}" on port ${port}`);
|
|
402
|
+
// Try to find process by port first (most reliable)
|
|
403
|
+
// QuestDB doesn't create a PID file, so port lookup is primary
|
|
404
|
+
let pid = null;
|
|
405
|
+
try {
|
|
406
|
+
const pids = await platformService.findProcessByPort(port);
|
|
407
|
+
if (pids.length > 0) {
|
|
408
|
+
pid = pids[0];
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
catch {
|
|
412
|
+
// Fall back to our PID file
|
|
413
|
+
try {
|
|
414
|
+
const pidStr = await readFile(pidFile, 'utf-8');
|
|
415
|
+
const parsedPid = parseInt(pidStr.trim(), 10);
|
|
416
|
+
if (!isNaN(parsedPid)) {
|
|
417
|
+
pid = parsedPid;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
catch {
|
|
421
|
+
// Ignore
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
// Kill process if found
|
|
425
|
+
if (pid && platformService.isProcessRunning(pid)) {
|
|
426
|
+
logDebug(`Killing QuestDB process ${pid}`);
|
|
427
|
+
const { platform } = this.getPlatformInfo();
|
|
428
|
+
const isWindows = platform === 'win32';
|
|
429
|
+
try {
|
|
430
|
+
await platformService.terminateProcess(pid, false);
|
|
431
|
+
// Wait for graceful termination - Windows needs more time for Java to release file locks
|
|
432
|
+
const gracefulWait = isWindows ? 5000 : 2000;
|
|
433
|
+
await new Promise((resolve) => setTimeout(resolve, gracefulWait));
|
|
434
|
+
if (platformService.isProcessRunning(pid)) {
|
|
435
|
+
logWarning(`Graceful termination failed, force killing ${pid}`);
|
|
436
|
+
await platformService.terminateProcess(pid, true);
|
|
437
|
+
// Additional wait after force kill on Windows
|
|
438
|
+
if (isWindows) {
|
|
439
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
catch (error) {
|
|
444
|
+
logDebug(`Process termination error: ${error}`);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
// Cleanup our PID file
|
|
448
|
+
if (existsSync(pidFile)) {
|
|
449
|
+
try {
|
|
450
|
+
await unlink(pidFile);
|
|
451
|
+
}
|
|
452
|
+
catch {
|
|
453
|
+
// Ignore
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
logDebug('QuestDB stopped');
|
|
457
|
+
}
|
|
458
|
+
// Get QuestDB server status
|
|
459
|
+
async status(container) {
|
|
460
|
+
const { port } = container;
|
|
461
|
+
// Try HTTP health check first
|
|
462
|
+
const httpPort = port + 188;
|
|
463
|
+
try {
|
|
464
|
+
const response = await fetch(`http://127.0.0.1:${httpPort}/exec?query=SELECT%201`);
|
|
465
|
+
if (response.ok) {
|
|
466
|
+
return { running: true, message: 'QuestDB is running' };
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
catch {
|
|
470
|
+
// Not running or not responding
|
|
471
|
+
}
|
|
472
|
+
return { running: false, message: 'QuestDB is not running' };
|
|
473
|
+
}
|
|
474
|
+
// Detect backup format
|
|
475
|
+
async detectBackupFormat(filePath) {
|
|
476
|
+
return detectBackupFormatImpl(filePath);
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Restore a backup
|
|
480
|
+
*/
|
|
481
|
+
async restore(container, backupPath, options = {}) {
|
|
482
|
+
const { name, port, version } = container;
|
|
483
|
+
return restoreBackup(backupPath, {
|
|
484
|
+
containerName: name,
|
|
485
|
+
port,
|
|
486
|
+
database: options.database || container.database || 'qdb',
|
|
487
|
+
version,
|
|
488
|
+
clean: options.clean,
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Get connection string
|
|
493
|
+
* Format: postgresql://admin:quest@127.0.0.1:PORT/DATABASE
|
|
494
|
+
*/
|
|
495
|
+
getConnectionString(container, database) {
|
|
496
|
+
const { port } = container;
|
|
497
|
+
const db = database || container.database || 'qdb';
|
|
498
|
+
return `postgresql://admin:quest@127.0.0.1:${port}/${db}`;
|
|
499
|
+
}
|
|
500
|
+
// Open psql interactive shell
|
|
501
|
+
async connect(container, database) {
|
|
502
|
+
const { port } = container;
|
|
503
|
+
const db = database || container.database || 'qdb';
|
|
504
|
+
// Find psql
|
|
505
|
+
let psqlPath = await configManager.getBinaryPath('psql');
|
|
506
|
+
if (!psqlPath) {
|
|
507
|
+
const result = await findBinary('psql');
|
|
508
|
+
if (result?.path) {
|
|
509
|
+
psqlPath = result.path;
|
|
510
|
+
}
|
|
511
|
+
else {
|
|
512
|
+
throw new Error('psql not found. Install PostgreSQL client tools or use the Web Console at ' +
|
|
513
|
+
`http://127.0.0.1:${port + 188}`);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
const spawnOptions = {
|
|
517
|
+
stdio: 'inherit',
|
|
518
|
+
env: { ...process.env, PGPASSWORD: 'quest' },
|
|
519
|
+
};
|
|
520
|
+
return new Promise((resolve, reject) => {
|
|
521
|
+
const proc = spawn(psqlPath, ['-h', '127.0.0.1', '-p', String(port), '-U', 'admin', '-d', db], spawnOptions);
|
|
522
|
+
proc.on('error', reject);
|
|
523
|
+
proc.on('close', () => resolve());
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Create a new database
|
|
528
|
+
* Note: QuestDB has a single-database model but supports schemas
|
|
529
|
+
*/
|
|
530
|
+
async createDatabase(container, database) {
|
|
531
|
+
logDebug(`QuestDB uses a single-database model. Database "${database}" will be a schema.`);
|
|
532
|
+
// QuestDB doesn't have traditional CREATE DATABASE
|
|
533
|
+
// All tables exist in the default database
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Drop a database (schema in QuestDB)
|
|
537
|
+
*/
|
|
538
|
+
async dropDatabase(container, database) {
|
|
539
|
+
logDebug(`QuestDB uses a single-database model. Cannot drop database "${database}".`);
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Get the database size
|
|
543
|
+
*/
|
|
544
|
+
async getDatabaseSize(container) {
|
|
545
|
+
const dataDir = paths.getContainerDataPath(container.name, {
|
|
546
|
+
engine: ENGINE,
|
|
547
|
+
});
|
|
548
|
+
if (!existsSync(dataDir))
|
|
549
|
+
return null;
|
|
550
|
+
try {
|
|
551
|
+
let totalSize = 0;
|
|
552
|
+
const entries = await readdir(dataDir, {
|
|
553
|
+
withFileTypes: true,
|
|
554
|
+
recursive: true,
|
|
555
|
+
});
|
|
556
|
+
for (const entry of entries) {
|
|
557
|
+
if (entry.isFile()) {
|
|
558
|
+
const filePath = join(entry.parentPath ?? dataDir, entry.name);
|
|
559
|
+
const stats = await stat(filePath);
|
|
560
|
+
totalSize += stats.size;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
return totalSize;
|
|
564
|
+
}
|
|
565
|
+
catch {
|
|
566
|
+
return null;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Dump from a remote QuestDB connection
|
|
571
|
+
*/
|
|
572
|
+
async dumpFromConnectionString(connectionString, outputPath) {
|
|
573
|
+
const { host, port, database, user, password } = parseConnectionString(connectionString);
|
|
574
|
+
logDebug(`Connecting to remote QuestDB at ${host}:${port} (db: ${database})`);
|
|
575
|
+
// Find psql for remote operations
|
|
576
|
+
let psqlPath = await configManager.getBinaryPath('psql');
|
|
577
|
+
if (!psqlPath) {
|
|
578
|
+
const result = await findBinary('psql');
|
|
579
|
+
if (result?.path) {
|
|
580
|
+
psqlPath = result.path;
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
throw new Error('psql not found. Install PostgreSQL client tools to dump from remote QuestDB.');
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
const lines = [];
|
|
587
|
+
lines.push('-- QuestDB backup generated by SpinDB');
|
|
588
|
+
lines.push(`-- Source: ${host}:${port}`);
|
|
589
|
+
lines.push(`-- Database: ${database}`);
|
|
590
|
+
lines.push(`-- Date: ${new Date().toISOString()}`);
|
|
591
|
+
lines.push('');
|
|
592
|
+
// Get list of tables
|
|
593
|
+
const tablesQuery = `SELECT table_name FROM tables() WHERE table_name NOT LIKE 'sys.%'`;
|
|
594
|
+
const tablesResult = await this.execRemoteQuery(psqlPath, host, port, user, password ?? '', database, tablesQuery);
|
|
595
|
+
const tables = tablesResult.split('\n').filter((t) => t.trim());
|
|
596
|
+
logDebug(`Found ${tables.length} tables`);
|
|
597
|
+
for (const table of tables) {
|
|
598
|
+
if (!table.trim())
|
|
599
|
+
continue;
|
|
600
|
+
lines.push(`-- Table: ${table}`);
|
|
601
|
+
lines.push('');
|
|
602
|
+
try {
|
|
603
|
+
const createQuery = `SHOW CREATE TABLE "${table}"`;
|
|
604
|
+
const createResult = await this.execRemoteQuery(psqlPath, host, port, user, password ?? '', database, createQuery);
|
|
605
|
+
if (createResult) {
|
|
606
|
+
lines.push(createResult + ';');
|
|
607
|
+
lines.push('');
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
catch (error) {
|
|
611
|
+
logWarning(`Could not get CREATE TABLE for ${table}: ${error}`);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
const content = lines.join('\n');
|
|
615
|
+
await writeFile(outputPath, content, 'utf-8');
|
|
616
|
+
return {
|
|
617
|
+
filePath: outputPath,
|
|
618
|
+
warnings: tables.length === 0 ? ['No tables found in database'] : undefined,
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
async execRemoteQuery(psqlPath, host, port, user, password, database, query) {
|
|
622
|
+
return new Promise((resolve, reject) => {
|
|
623
|
+
const args = [
|
|
624
|
+
'-h',
|
|
625
|
+
host,
|
|
626
|
+
'-p',
|
|
627
|
+
String(port),
|
|
628
|
+
'-U',
|
|
629
|
+
user,
|
|
630
|
+
'-d',
|
|
631
|
+
database,
|
|
632
|
+
'-t',
|
|
633
|
+
'-A',
|
|
634
|
+
'-c',
|
|
635
|
+
query,
|
|
636
|
+
];
|
|
637
|
+
const proc = spawn(psqlPath, args, {
|
|
638
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
639
|
+
env: { ...process.env, PGPASSWORD: password },
|
|
640
|
+
});
|
|
641
|
+
let stdout = '';
|
|
642
|
+
let stderr = '';
|
|
643
|
+
proc.stdout.on('data', (data) => {
|
|
644
|
+
stdout += data.toString();
|
|
645
|
+
});
|
|
646
|
+
proc.stderr.on('data', (data) => {
|
|
647
|
+
stderr += data.toString();
|
|
648
|
+
});
|
|
649
|
+
proc.on('close', (code) => {
|
|
650
|
+
if (code === 0) {
|
|
651
|
+
resolve(stdout.trim());
|
|
652
|
+
}
|
|
653
|
+
else {
|
|
654
|
+
reject(new Error(stderr || `Exit code ${code}`));
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
proc.on('error', reject);
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
// Create a backup
|
|
661
|
+
async backup(container, outputPath, options) {
|
|
662
|
+
return createBackup(container, outputPath, options);
|
|
663
|
+
}
|
|
664
|
+
// Run a SQL file or inline SQL statement
|
|
665
|
+
async runScript(container, options) {
|
|
666
|
+
const { port } = container;
|
|
667
|
+
const db = options.database || container.database || 'qdb';
|
|
668
|
+
// Find psql
|
|
669
|
+
let psqlPath = await configManager.getBinaryPath('psql');
|
|
670
|
+
if (!psqlPath) {
|
|
671
|
+
const result = await findBinary('psql');
|
|
672
|
+
if (result?.path) {
|
|
673
|
+
psqlPath = result.path;
|
|
674
|
+
}
|
|
675
|
+
else {
|
|
676
|
+
throw new Error('psql not found. Install PostgreSQL client tools.');
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if (options.file) {
|
|
680
|
+
// Run SQL file
|
|
681
|
+
const args = [
|
|
682
|
+
'-h',
|
|
683
|
+
'127.0.0.1',
|
|
684
|
+
'-p',
|
|
685
|
+
String(port),
|
|
686
|
+
'-U',
|
|
687
|
+
'admin',
|
|
688
|
+
'-d',
|
|
689
|
+
db,
|
|
690
|
+
'-f',
|
|
691
|
+
options.file,
|
|
692
|
+
];
|
|
693
|
+
await new Promise((resolve, reject) => {
|
|
694
|
+
const proc = spawn(psqlPath, args, {
|
|
695
|
+
stdio: 'inherit',
|
|
696
|
+
env: { ...process.env, PGPASSWORD: 'quest' },
|
|
697
|
+
});
|
|
698
|
+
proc.on('error', reject);
|
|
699
|
+
proc.on('close', (code) => {
|
|
700
|
+
if (code === 0) {
|
|
701
|
+
resolve();
|
|
702
|
+
}
|
|
703
|
+
else {
|
|
704
|
+
reject(new Error(`psql exited with code ${code}`));
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
else if (options.sql) {
|
|
710
|
+
// Run inline SQL
|
|
711
|
+
const args = [
|
|
712
|
+
'-h',
|
|
713
|
+
'127.0.0.1',
|
|
714
|
+
'-p',
|
|
715
|
+
String(port),
|
|
716
|
+
'-U',
|
|
717
|
+
'admin',
|
|
718
|
+
'-d',
|
|
719
|
+
db,
|
|
720
|
+
'-c',
|
|
721
|
+
options.sql,
|
|
722
|
+
];
|
|
723
|
+
await new Promise((resolve, reject) => {
|
|
724
|
+
const proc = spawn(psqlPath, args, {
|
|
725
|
+
stdio: 'inherit',
|
|
726
|
+
env: { ...process.env, PGPASSWORD: 'quest' },
|
|
727
|
+
});
|
|
728
|
+
proc.on('error', reject);
|
|
729
|
+
proc.on('close', (code) => {
|
|
730
|
+
if (code === 0) {
|
|
731
|
+
resolve();
|
|
732
|
+
}
|
|
733
|
+
else {
|
|
734
|
+
reject(new Error(`psql exited with code ${code}`));
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
throw new Error('Either file or sql option must be provided');
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Execute a SQL query and return structured results
|
|
745
|
+
* Uses PostgreSQL wire protocol via psql
|
|
746
|
+
*/
|
|
747
|
+
async executeQuery(container, query, options) {
|
|
748
|
+
const { port } = container;
|
|
749
|
+
const db = options?.database || container.database || 'qdb';
|
|
750
|
+
// Find psql
|
|
751
|
+
let psqlPath = await configManager.getBinaryPath('psql');
|
|
752
|
+
if (!psqlPath) {
|
|
753
|
+
const result = await findBinary('psql');
|
|
754
|
+
if (result?.path) {
|
|
755
|
+
psqlPath = result.path;
|
|
756
|
+
}
|
|
757
|
+
else {
|
|
758
|
+
throw new Error('psql not found. Install PostgreSQL client tools or use the Web Console.');
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return new Promise((resolve, reject) => {
|
|
762
|
+
const args = [
|
|
763
|
+
'-X', // Skip ~/.psqlrc to ensure deterministic CSV output
|
|
764
|
+
'-h',
|
|
765
|
+
'127.0.0.1',
|
|
766
|
+
'-p',
|
|
767
|
+
String(port),
|
|
768
|
+
'-U',
|
|
769
|
+
'admin',
|
|
770
|
+
'-d',
|
|
771
|
+
db,
|
|
772
|
+
'--csv',
|
|
773
|
+
'-c',
|
|
774
|
+
query,
|
|
775
|
+
];
|
|
776
|
+
const proc = spawn(psqlPath, args, {
|
|
777
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
778
|
+
env: { ...process.env, PGPASSWORD: 'quest' },
|
|
779
|
+
});
|
|
780
|
+
let stdout = '';
|
|
781
|
+
let stderr = '';
|
|
782
|
+
proc.stdout?.on('data', (data) => {
|
|
783
|
+
stdout += data.toString();
|
|
784
|
+
});
|
|
785
|
+
proc.stderr?.on('data', (data) => {
|
|
786
|
+
stderr += data.toString();
|
|
787
|
+
});
|
|
788
|
+
proc.on('error', reject);
|
|
789
|
+
proc.on('close', (code) => {
|
|
790
|
+
if (code !== 0) {
|
|
791
|
+
reject(new Error(stderr || `psql exited with code ${code}`));
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
try {
|
|
795
|
+
resolve(parseCSVToQueryResult(stdout));
|
|
796
|
+
}
|
|
797
|
+
catch (error) {
|
|
798
|
+
reject(new Error(`Failed to parse query result: ${error instanceof Error ? error.message : error}`));
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* List databases for QuestDB.
|
|
805
|
+
* QuestDB has a single database 'qdb'. Returns the configured database.
|
|
806
|
+
*/
|
|
807
|
+
async listDatabases(container) {
|
|
808
|
+
// QuestDB has a single database 'qdb'
|
|
809
|
+
// Return the container's configured database
|
|
810
|
+
return [container.database];
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
export const questdbEngine = new QuestDBEngine();
|
|
814
|
+
//# sourceMappingURL=index.js.map
|