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
package/cli/commands/engines.ts
DELETED
|
@@ -1,1914 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander'
|
|
2
|
-
import chalk from 'chalk'
|
|
3
|
-
import { rm } from 'fs/promises'
|
|
4
|
-
import { existsSync } from 'fs'
|
|
5
|
-
import { join } from 'path'
|
|
6
|
-
import { execFile } from 'child_process'
|
|
7
|
-
import { promisify } from 'util'
|
|
8
|
-
import inquirer from 'inquirer'
|
|
9
|
-
import { containerManager } from '../../core/container-manager'
|
|
10
|
-
import { processManager } from '../../core/process-manager'
|
|
11
|
-
import { configManager } from '../../core/config-manager'
|
|
12
|
-
import { getEngine } from '../../engines'
|
|
13
|
-
import { postgresqlBinaryManager } from '../../engines/postgresql/binary-manager'
|
|
14
|
-
import { paths } from '../../config/paths'
|
|
15
|
-
import { platformService } from '../../core/platform-service'
|
|
16
|
-
import {
|
|
17
|
-
detectPackageManager,
|
|
18
|
-
checkEngineDependencies,
|
|
19
|
-
installEngineDependencies,
|
|
20
|
-
getManualInstallInstructions,
|
|
21
|
-
getCurrentPlatform,
|
|
22
|
-
findBinary,
|
|
23
|
-
} from '../../core/dependency-manager'
|
|
24
|
-
import {
|
|
25
|
-
getRequiredClientTools,
|
|
26
|
-
getPackagesForTools,
|
|
27
|
-
} from '../../core/hostdb-metadata'
|
|
28
|
-
import type { BinaryTool } from '../../types'
|
|
29
|
-
import { promptConfirm } from '../ui/prompts'
|
|
30
|
-
import { createSpinner } from '../ui/spinner'
|
|
31
|
-
import { uiError, uiWarning, uiInfo, uiSuccess, formatBytes } from '../ui/theme'
|
|
32
|
-
import { getEngineIcon } from '../constants'
|
|
33
|
-
import {
|
|
34
|
-
getInstalledEngines,
|
|
35
|
-
getInstalledPostgresEngines,
|
|
36
|
-
getEngineMetadata,
|
|
37
|
-
} from '../helpers'
|
|
38
|
-
import { Engine, Platform, ALL_ENGINES } from '../../types'
|
|
39
|
-
import {
|
|
40
|
-
loadEnginesJson,
|
|
41
|
-
filterEnginesByPlatform,
|
|
42
|
-
type EngineConfig,
|
|
43
|
-
} from '../../config/engines-registry'
|
|
44
|
-
import { mysqlBinaryManager } from '../../engines/mysql/binary-manager'
|
|
45
|
-
import { mariadbBinaryManager } from '../../engines/mariadb/binary-manager'
|
|
46
|
-
import { mongodbBinaryManager } from '../../engines/mongodb/binary-manager'
|
|
47
|
-
import { redisBinaryManager } from '../../engines/redis/binary-manager'
|
|
48
|
-
import { valkeyBinaryManager } from '../../engines/valkey/binary-manager'
|
|
49
|
-
import { sqliteBinaryManager } from '../../engines/sqlite/binary-manager'
|
|
50
|
-
import { duckdbBinaryManager } from '../../engines/duckdb/binary-manager'
|
|
51
|
-
import { clickhouseBinaryManager } from '../../engines/clickhouse/binary-manager'
|
|
52
|
-
import { qdrantBinaryManager } from '../../engines/qdrant/binary-manager'
|
|
53
|
-
import { meilisearchBinaryManager } from '../../engines/meilisearch/binary-manager'
|
|
54
|
-
import { ferretdbBinaryManager } from '../../engines/ferretdb/binary-manager'
|
|
55
|
-
import { couchdbBinaryManager } from '../../engines/couchdb/binary-manager'
|
|
56
|
-
import { cockroachdbBinaryManager } from '../../engines/cockroachdb/binary-manager'
|
|
57
|
-
import { surrealdbBinaryManager } from '../../engines/surrealdb/binary-manager'
|
|
58
|
-
import { questdbBinaryManager } from '../../engines/questdb/binary-manager'
|
|
59
|
-
import { typedbBinaryManager } from '../../engines/typedb/binary-manager'
|
|
60
|
-
import { influxdbBinaryManager } from '../../engines/influxdb/binary-manager'
|
|
61
|
-
import { weaviateBinaryManager } from '../../engines/weaviate/binary-manager'
|
|
62
|
-
import { tigerbeetleBinaryManager } from '../../engines/tigerbeetle/binary-manager'
|
|
63
|
-
import {
|
|
64
|
-
DEFAULT_DOCUMENTDB_VERSION,
|
|
65
|
-
DEFAULT_V1_POSTGRESQL_VERSION,
|
|
66
|
-
normalizeDocumentDBVersion,
|
|
67
|
-
isV1,
|
|
68
|
-
} from '../../engines/ferretdb/version-maps'
|
|
69
|
-
|
|
70
|
-
// Display manual installation instructions for missing dependencies
|
|
71
|
-
function displayManualInstallInstructions(
|
|
72
|
-
missingDeps: Array<{ dependency: { name: string }; installed: boolean }>,
|
|
73
|
-
): void {
|
|
74
|
-
const platform = getCurrentPlatform()
|
|
75
|
-
for (const status of missingDeps) {
|
|
76
|
-
const instructions = getManualInstallInstructions(
|
|
77
|
-
status.dependency as Parameters<typeof getManualInstallInstructions>[0],
|
|
78
|
-
platform,
|
|
79
|
-
)
|
|
80
|
-
console.log(chalk.gray(` ${status.dependency.name}:`))
|
|
81
|
-
for (const instruction of instructions) {
|
|
82
|
-
console.log(chalk.gray(` ${instruction}`))
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const execFileAsync = promisify(execFile)
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Check which client tools are bundled in the downloaded binaries
|
|
91
|
-
* @param binPath Path to the extracted binary directory
|
|
92
|
-
* @param tools List of tool names to check
|
|
93
|
-
* @returns Array of tools that were found bundled
|
|
94
|
-
*/
|
|
95
|
-
function checkBundledTools(binPath: string, tools: string[]): string[] {
|
|
96
|
-
const ext = platformService.getExecutableExtension()
|
|
97
|
-
const bundled: string[] = []
|
|
98
|
-
|
|
99
|
-
for (const tool of tools) {
|
|
100
|
-
const toolPath = join(binPath, 'bin', `${tool}${ext}`)
|
|
101
|
-
if (existsSync(toolPath)) {
|
|
102
|
-
bundled.push(tool)
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return bundled
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Install missing client tools using the system package manager
|
|
111
|
-
* Uses hostdb's downloads.json to determine the correct packages
|
|
112
|
-
*
|
|
113
|
-
* @param engine Engine name (e.g., 'postgresql', 'mysql')
|
|
114
|
-
* @param bundledTools Tools already bundled with the downloaded binaries
|
|
115
|
-
* @param onProgress Progress callback for UI updates
|
|
116
|
-
*/
|
|
117
|
-
async function installMissingClientTools(
|
|
118
|
-
engine: string,
|
|
119
|
-
bundledTools: string[],
|
|
120
|
-
onProgress?: (msg: string) => void,
|
|
121
|
-
): Promise<{
|
|
122
|
-
installed: string[]
|
|
123
|
-
failed: string[]
|
|
124
|
-
skipped: string[]
|
|
125
|
-
needsPathRefresh: string[]
|
|
126
|
-
}> {
|
|
127
|
-
const installed: string[] = []
|
|
128
|
-
const failed: string[] = []
|
|
129
|
-
const skipped: string[] = []
|
|
130
|
-
const needsPathRefresh: string[] = []
|
|
131
|
-
|
|
132
|
-
// Timeout for package installation commands (5 minutes)
|
|
133
|
-
const INSTALL_TIMEOUT_MS = 5 * 60 * 1000
|
|
134
|
-
|
|
135
|
-
// Get required client tools from hostdb databases.json
|
|
136
|
-
const requiredTools = await getRequiredClientTools(engine)
|
|
137
|
-
if (requiredTools.length === 0) {
|
|
138
|
-
return { installed, failed, skipped, needsPathRefresh }
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Find which tools are missing (not bundled and not already installed)
|
|
142
|
-
const missingTools: string[] = []
|
|
143
|
-
for (const tool of requiredTools) {
|
|
144
|
-
if (bundledTools.includes(tool)) {
|
|
145
|
-
// Already bundled in the download
|
|
146
|
-
continue
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// Check if already installed on system
|
|
150
|
-
const existing = await findBinary(tool)
|
|
151
|
-
if (existing) {
|
|
152
|
-
// Register it in config and skip installation
|
|
153
|
-
await configManager.setBinaryPath(
|
|
154
|
-
tool as BinaryTool,
|
|
155
|
-
existing.path,
|
|
156
|
-
'system',
|
|
157
|
-
)
|
|
158
|
-
skipped.push(tool)
|
|
159
|
-
continue
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
missingTools.push(tool)
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (missingTools.length === 0) {
|
|
166
|
-
return { installed, failed, skipped, needsPathRefresh }
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Detect package manager
|
|
170
|
-
const pm = await detectPackageManager()
|
|
171
|
-
if (!pm) {
|
|
172
|
-
// No package manager available, all missing tools fail
|
|
173
|
-
return { installed, failed: missingTools, skipped, needsPathRefresh }
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Package manager keys supported by hostdb
|
|
177
|
-
type PackageManagerKey = 'brew' | 'apt' | 'yum' | 'dnf' | 'choco'
|
|
178
|
-
|
|
179
|
-
// Explicit mapping from package manager name variants to canonical keys
|
|
180
|
-
const PACKAGE_MANAGER_ALIASES: Record<string, PackageManagerKey> = {
|
|
181
|
-
// Homebrew
|
|
182
|
-
brew: 'brew',
|
|
183
|
-
homebrew: 'brew',
|
|
184
|
-
// APT
|
|
185
|
-
apt: 'apt',
|
|
186
|
-
'apt-get': 'apt',
|
|
187
|
-
aptget: 'apt',
|
|
188
|
-
// YUM
|
|
189
|
-
yum: 'yum',
|
|
190
|
-
// DNF
|
|
191
|
-
dnf: 'dnf',
|
|
192
|
-
// Chocolatey
|
|
193
|
-
choco: 'choco',
|
|
194
|
-
chocolatey: 'choco',
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const lookupKey = pm.name.toLowerCase().trim()
|
|
198
|
-
const pmKey = PACKAGE_MANAGER_ALIASES[lookupKey]
|
|
199
|
-
|
|
200
|
-
if (!pmKey) {
|
|
201
|
-
// Unknown package manager, cannot install automatically
|
|
202
|
-
console.warn(
|
|
203
|
-
`Unknown package manager: ${pm.name}, skipping automatic installation`,
|
|
204
|
-
)
|
|
205
|
-
return { installed, failed: missingTools, skipped, needsPathRefresh }
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Get the packages needed for missing tools
|
|
209
|
-
const packages = await getPackagesForTools(missingTools, pmKey)
|
|
210
|
-
|
|
211
|
-
// Pattern for validating package names (prevents command injection)
|
|
212
|
-
// Allows alphanumeric, @, ., _, -, / (for scoped packages and paths)
|
|
213
|
-
const SAFE_PACKAGE_PATTERN = /^[@a-zA-Z0-9][a-zA-Z0-9._/-]*$/
|
|
214
|
-
|
|
215
|
-
// Check if running as root (no sudo needed)
|
|
216
|
-
const isRoot = process.getuid?.() === 0
|
|
217
|
-
|
|
218
|
-
for (const pkg of packages) {
|
|
219
|
-
// Validate package name to prevent command injection
|
|
220
|
-
if (!SAFE_PACKAGE_PATTERN.test(pkg.package)) {
|
|
221
|
-
console.warn(`Skipping invalid package name: ${pkg.package}`)
|
|
222
|
-
failed.push(...pkg.tools)
|
|
223
|
-
continue
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// Also validate tap if present
|
|
227
|
-
if (pkg.tap && !SAFE_PACKAGE_PATTERN.test(pkg.tap)) {
|
|
228
|
-
console.warn(`Skipping invalid tap name: ${pkg.tap}`)
|
|
229
|
-
failed.push(...pkg.tools)
|
|
230
|
-
continue
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
onProgress?.(
|
|
234
|
-
`Installing ${pkg.package} (provides: ${pkg.tools.join(', ')})...`,
|
|
235
|
-
)
|
|
236
|
-
|
|
237
|
-
try {
|
|
238
|
-
// Handle Homebrew taps
|
|
239
|
-
if (pmKey === 'brew' && pkg.tap) {
|
|
240
|
-
await execFileAsync('brew', ['tap', pkg.tap], {
|
|
241
|
-
timeout: INSTALL_TIMEOUT_MS,
|
|
242
|
-
})
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// All package managers use execFileAsync with explicit argument arrays
|
|
246
|
-
if (pmKey === 'apt') {
|
|
247
|
-
// APT: Run apt-get update and apt-get install as separate commands
|
|
248
|
-
const aptExecutable = isRoot ? 'apt-get' : 'sudo'
|
|
249
|
-
const updateArgs = isRoot ? ['update'] : ['apt-get', 'update']
|
|
250
|
-
const installArgs = isRoot
|
|
251
|
-
? ['install', '-y', pkg.package]
|
|
252
|
-
: ['apt-get', 'install', '-y', pkg.package]
|
|
253
|
-
|
|
254
|
-
await execFileAsync(aptExecutable, updateArgs, {
|
|
255
|
-
timeout: INSTALL_TIMEOUT_MS,
|
|
256
|
-
})
|
|
257
|
-
await execFileAsync(aptExecutable, installArgs, {
|
|
258
|
-
timeout: INSTALL_TIMEOUT_MS,
|
|
259
|
-
})
|
|
260
|
-
} else if (pmKey === 'brew') {
|
|
261
|
-
// Homebrew: No sudo needed
|
|
262
|
-
await execFileAsync('brew', ['install', pkg.package], {
|
|
263
|
-
timeout: INSTALL_TIMEOUT_MS,
|
|
264
|
-
})
|
|
265
|
-
} else if (pmKey === 'yum') {
|
|
266
|
-
// YUM: Needs sudo for non-root
|
|
267
|
-
const executable = isRoot ? 'yum' : 'sudo'
|
|
268
|
-
const args = isRoot
|
|
269
|
-
? ['install', '-y', pkg.package]
|
|
270
|
-
: ['yum', 'install', '-y', pkg.package]
|
|
271
|
-
await execFileAsync(executable, args, { timeout: INSTALL_TIMEOUT_MS })
|
|
272
|
-
} else if (pmKey === 'dnf') {
|
|
273
|
-
// DNF: Needs sudo for non-root
|
|
274
|
-
const executable = isRoot ? 'dnf' : 'sudo'
|
|
275
|
-
const args = isRoot
|
|
276
|
-
? ['install', '-y', pkg.package]
|
|
277
|
-
: ['dnf', 'install', '-y', pkg.package]
|
|
278
|
-
await execFileAsync(executable, args, { timeout: INSTALL_TIMEOUT_MS })
|
|
279
|
-
} else if (pmKey === 'choco') {
|
|
280
|
-
// Chocolatey: No sudo on Windows
|
|
281
|
-
await execFileAsync('choco', ['install', pkg.package, '-y'], {
|
|
282
|
-
timeout: INSTALL_TIMEOUT_MS,
|
|
283
|
-
})
|
|
284
|
-
} else {
|
|
285
|
-
// Unknown package manager - should not reach here due to earlier validation
|
|
286
|
-
failed.push(...pkg.tools)
|
|
287
|
-
continue
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// Register the installed tools
|
|
291
|
-
for (const tool of pkg.tools) {
|
|
292
|
-
const result = await findBinary(tool)
|
|
293
|
-
if (result) {
|
|
294
|
-
await configManager.setBinaryPath(
|
|
295
|
-
tool as BinaryTool,
|
|
296
|
-
result.path,
|
|
297
|
-
'system',
|
|
298
|
-
)
|
|
299
|
-
installed.push(tool)
|
|
300
|
-
} else {
|
|
301
|
-
// Package installed but binary not found in PATH
|
|
302
|
-
// This is likely a PATH refresh issue, not an installation failure
|
|
303
|
-
needsPathRefresh.push(tool)
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
} catch (error) {
|
|
307
|
-
const e = error as Error & { killed?: boolean }
|
|
308
|
-
if (e.killed) {
|
|
309
|
-
// Timeout - process was killed
|
|
310
|
-
console.error(
|
|
311
|
-
chalk.red(
|
|
312
|
-
` Installation of ${pkg.package} timed out after 5 minutes`,
|
|
313
|
-
),
|
|
314
|
-
)
|
|
315
|
-
} else {
|
|
316
|
-
console.error(
|
|
317
|
-
chalk.red(` Failed to install ${pkg.package}: ${e.message}`),
|
|
318
|
-
)
|
|
319
|
-
}
|
|
320
|
-
failed.push(...pkg.tools)
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
return { installed, failed, skipped, needsPathRefresh }
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Check for bundled client tools and install any that are missing
|
|
329
|
-
*
|
|
330
|
-
* @param engineName - Engine name (e.g., 'postgresql', 'mysql')
|
|
331
|
-
* @param binPath - Path to the extracted binary directory
|
|
332
|
-
*/
|
|
333
|
-
async function checkAndInstallClientTools(
|
|
334
|
-
engineName: string,
|
|
335
|
-
binPath: string,
|
|
336
|
-
): Promise<void> {
|
|
337
|
-
const requiredTools = await getRequiredClientTools(engineName)
|
|
338
|
-
const bundledTools = checkBundledTools(binPath, requiredTools)
|
|
339
|
-
|
|
340
|
-
if (bundledTools.length >= requiredTools.length) {
|
|
341
|
-
return // All tools are bundled
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
const clientSpinner = createSpinner('Checking client tools...')
|
|
345
|
-
clientSpinner.start()
|
|
346
|
-
|
|
347
|
-
const result = await installMissingClientTools(
|
|
348
|
-
engineName,
|
|
349
|
-
bundledTools,
|
|
350
|
-
(msg) => {
|
|
351
|
-
clientSpinner.text = msg
|
|
352
|
-
},
|
|
353
|
-
)
|
|
354
|
-
|
|
355
|
-
// Report all non-empty categories (not mutually exclusive)
|
|
356
|
-
const messages: string[] = []
|
|
357
|
-
if (result.installed.length > 0) {
|
|
358
|
-
messages.push(`installed: ${result.installed.join(', ')}`)
|
|
359
|
-
}
|
|
360
|
-
if (result.skipped.length > 0) {
|
|
361
|
-
messages.push(`already available: ${result.skipped.join(', ')}`)
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
// Determine overall status
|
|
365
|
-
const hasFailures = result.failed.length > 0
|
|
366
|
-
const hasPathIssues = result.needsPathRefresh.length > 0
|
|
367
|
-
|
|
368
|
-
if (hasFailures || hasPathIssues) {
|
|
369
|
-
// Build warning message
|
|
370
|
-
const warnings: string[] = []
|
|
371
|
-
if (result.failed.length > 0) {
|
|
372
|
-
warnings.push(`failed: ${result.failed.join(', ')}`)
|
|
373
|
-
}
|
|
374
|
-
if (result.needsPathRefresh.length > 0) {
|
|
375
|
-
warnings.push(`needs PATH refresh: ${result.needsPathRefresh.join(', ')}`)
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
if (messages.length > 0) {
|
|
379
|
-
clientSpinner.warn(`${messages.join('; ')}; ${warnings.join('; ')}`)
|
|
380
|
-
} else {
|
|
381
|
-
clientSpinner.warn(warnings.join('; '))
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
// Show additional help for PATH issues
|
|
385
|
-
if (hasPathIssues) {
|
|
386
|
-
console.log(
|
|
387
|
-
chalk.yellow(
|
|
388
|
-
' Some tools were installed but not found in PATH. Refresh your shell and re-run:',
|
|
389
|
-
),
|
|
390
|
-
)
|
|
391
|
-
console.log(chalk.gray(` spindb engines download ${engineName}`))
|
|
392
|
-
}
|
|
393
|
-
} else if (messages.length > 0) {
|
|
394
|
-
clientSpinner.succeed(messages.join('; '))
|
|
395
|
-
} else {
|
|
396
|
-
clientSpinner.succeed('All client tools available')
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// List subcommand action
|
|
401
|
-
async function listEngines(options: { json?: boolean }): Promise<void> {
|
|
402
|
-
const engines = await getInstalledEngines()
|
|
403
|
-
|
|
404
|
-
if (options.json) {
|
|
405
|
-
const enginesWithMetadata = await Promise.all(
|
|
406
|
-
engines.map(async (e) => ({
|
|
407
|
-
...e,
|
|
408
|
-
...(await getEngineMetadata(e.engine)),
|
|
409
|
-
})),
|
|
410
|
-
)
|
|
411
|
-
console.log(JSON.stringify(enginesWithMetadata, null, 2))
|
|
412
|
-
return
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
if (engines.length === 0) {
|
|
416
|
-
console.log(uiInfo('No engines installed yet.'))
|
|
417
|
-
console.log(
|
|
418
|
-
chalk.gray(
|
|
419
|
-
' Database engines are downloaded automatically when you create a container.',
|
|
420
|
-
),
|
|
421
|
-
)
|
|
422
|
-
console.log(
|
|
423
|
-
chalk.gray(
|
|
424
|
-
' Or download manually: spindb engines download <engine> <version>',
|
|
425
|
-
),
|
|
426
|
-
)
|
|
427
|
-
return
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// Sort engines alphabetically by engine name
|
|
431
|
-
const sortedEngines = [...engines].sort((a, b) =>
|
|
432
|
-
a.engine.localeCompare(b.engine),
|
|
433
|
-
)
|
|
434
|
-
|
|
435
|
-
// Table header
|
|
436
|
-
// Icon is 5 chars, longest engine name is 11 (meilisearch/cockroachdb), so 18 total for ENGINE column
|
|
437
|
-
console.log()
|
|
438
|
-
console.log(
|
|
439
|
-
chalk.gray(' ') +
|
|
440
|
-
chalk.bold.white('ENGINE'.padEnd(18)) +
|
|
441
|
-
chalk.bold.white('VERSION'.padEnd(12)) +
|
|
442
|
-
chalk.bold.white('SOURCE'.padEnd(18)) +
|
|
443
|
-
chalk.bold.white('SIZE'),
|
|
444
|
-
)
|
|
445
|
-
console.log(chalk.gray(' ' + '─'.repeat(59)))
|
|
446
|
-
|
|
447
|
-
// Display all engines in alphabetical order
|
|
448
|
-
for (const engine of sortedEngines) {
|
|
449
|
-
const platformInfo = `${engine.platform}-${engine.arch}`
|
|
450
|
-
|
|
451
|
-
console.log(
|
|
452
|
-
chalk.gray(' ') +
|
|
453
|
-
getEngineIcon(engine.engine) +
|
|
454
|
-
chalk.cyan(engine.engine.padEnd(13)) +
|
|
455
|
-
chalk.yellow(engine.version.padEnd(12)) +
|
|
456
|
-
chalk.gray(platformInfo.padEnd(18)) +
|
|
457
|
-
chalk.white(formatBytes(engine.sizeBytes)),
|
|
458
|
-
)
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
console.log(chalk.gray(' ' + '─'.repeat(59)))
|
|
462
|
-
|
|
463
|
-
// Summary - group by engine name (already sorted)
|
|
464
|
-
console.log()
|
|
465
|
-
|
|
466
|
-
// Engine display name map for summary
|
|
467
|
-
const ENGINE_DISPLAY_NAMES: Record<string, string> = {
|
|
468
|
-
clickhouse: 'ClickHouse',
|
|
469
|
-
cockroachdb: 'CockroachDB',
|
|
470
|
-
couchdb: 'CouchDB',
|
|
471
|
-
duckdb: 'DuckDB',
|
|
472
|
-
ferretdb: 'FerretDB',
|
|
473
|
-
influxdb: 'InfluxDB',
|
|
474
|
-
mariadb: 'MariaDB',
|
|
475
|
-
meilisearch: 'Meilisearch',
|
|
476
|
-
mongodb: 'MongoDB',
|
|
477
|
-
mysql: 'MySQL',
|
|
478
|
-
postgresql: 'PostgreSQL',
|
|
479
|
-
qdrant: 'Qdrant',
|
|
480
|
-
questdb: 'QuestDB',
|
|
481
|
-
redis: 'Redis',
|
|
482
|
-
sqlite: 'SQLite',
|
|
483
|
-
surrealdb: 'SurrealDB',
|
|
484
|
-
typedb: 'TypeDB',
|
|
485
|
-
valkey: 'Valkey',
|
|
486
|
-
weaviate: 'Weaviate',
|
|
487
|
-
tigerbeetle: 'TigerBeetle',
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
// Group engines by name for summary
|
|
491
|
-
const engineGroups = new Map<string, typeof sortedEngines>()
|
|
492
|
-
for (const engine of sortedEngines) {
|
|
493
|
-
const group = engineGroups.get(engine.engine) || []
|
|
494
|
-
group.push(engine)
|
|
495
|
-
engineGroups.set(engine.engine, group)
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
for (const [engineName, group] of engineGroups) {
|
|
499
|
-
const displayName = ENGINE_DISPLAY_NAMES[engineName] || engineName
|
|
500
|
-
const totalSize = group.reduce((acc, e) => acc + e.sizeBytes, 0)
|
|
501
|
-
console.log(
|
|
502
|
-
chalk.gray(
|
|
503
|
-
` ${displayName}: ${group.length} version(s), ${formatBytes(totalSize)}`,
|
|
504
|
-
),
|
|
505
|
-
)
|
|
506
|
-
}
|
|
507
|
-
console.log()
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
// Delete subcommand action
|
|
511
|
-
async function deleteEngine(
|
|
512
|
-
engine: string | undefined,
|
|
513
|
-
version: string | undefined,
|
|
514
|
-
options: { yes?: boolean },
|
|
515
|
-
): Promise<void> {
|
|
516
|
-
// Get PostgreSQL engines only (MySQL can't be deleted via spindb)
|
|
517
|
-
const pgEngines = await getInstalledPostgresEngines()
|
|
518
|
-
|
|
519
|
-
if (pgEngines.length === 0) {
|
|
520
|
-
console.log(uiWarning('No deletable engines found.'))
|
|
521
|
-
console.log(
|
|
522
|
-
chalk.gray(
|
|
523
|
-
' Engine deletion is currently supported for PostgreSQL only.',
|
|
524
|
-
),
|
|
525
|
-
)
|
|
526
|
-
return
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
let engineName = engine
|
|
530
|
-
let engineVersion = version
|
|
531
|
-
|
|
532
|
-
// Interactive selection if not provided
|
|
533
|
-
if (!engineName || !engineVersion) {
|
|
534
|
-
const choices = pgEngines.map((e) => ({
|
|
535
|
-
name: `${getEngineIcon(e.engine)}${e.engine} ${e.version} ${chalk.gray(`(${formatBytes(e.sizeBytes)})`)}`,
|
|
536
|
-
value: `${e.engine}:${e.version}:${e.path}`,
|
|
537
|
-
}))
|
|
538
|
-
|
|
539
|
-
const { selected } = await inquirer.prompt<{ selected: string }>([
|
|
540
|
-
{
|
|
541
|
-
type: 'list',
|
|
542
|
-
name: 'selected',
|
|
543
|
-
message: 'Select engine to delete:',
|
|
544
|
-
choices,
|
|
545
|
-
},
|
|
546
|
-
])
|
|
547
|
-
|
|
548
|
-
const [eng, ver] = selected.split(':')
|
|
549
|
-
engineName = eng
|
|
550
|
-
engineVersion = ver
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
// Find the engine
|
|
554
|
-
const targetEngine = pgEngines.find(
|
|
555
|
-
(e) => e.engine === engineName && e.version === engineVersion,
|
|
556
|
-
)
|
|
557
|
-
|
|
558
|
-
if (!targetEngine) {
|
|
559
|
-
console.error(uiError(`Engine "${engineName} ${engineVersion}" not found`))
|
|
560
|
-
process.exit(1)
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
// Check if any containers are using this engine version (for warning only)
|
|
564
|
-
const containers = await containerManager.list()
|
|
565
|
-
const usingContainers = containers.filter(
|
|
566
|
-
(c) => c.engine === engineName && c.version === engineVersion,
|
|
567
|
-
)
|
|
568
|
-
|
|
569
|
-
// Check for running containers using this engine
|
|
570
|
-
const runningContainers = usingContainers.filter(
|
|
571
|
-
(c) => c.status === 'running',
|
|
572
|
-
)
|
|
573
|
-
|
|
574
|
-
// Confirm deletion (warn about containers)
|
|
575
|
-
if (!options.yes) {
|
|
576
|
-
if (usingContainers.length > 0) {
|
|
577
|
-
const runningCount = runningContainers.length
|
|
578
|
-
const stoppedCount = usingContainers.length - runningCount
|
|
579
|
-
|
|
580
|
-
if (runningCount > 0) {
|
|
581
|
-
console.log(
|
|
582
|
-
uiWarning(
|
|
583
|
-
`${runningCount} running container(s) will be stopped: ${runningContainers.map((c) => c.name).join(', ')}`,
|
|
584
|
-
),
|
|
585
|
-
)
|
|
586
|
-
}
|
|
587
|
-
if (stoppedCount > 0) {
|
|
588
|
-
const stoppedContainers = usingContainers.filter(
|
|
589
|
-
(c) => c.status !== 'running',
|
|
590
|
-
)
|
|
591
|
-
console.log(
|
|
592
|
-
chalk.gray(
|
|
593
|
-
` ${stoppedCount} stopped container(s) will be orphaned: ${stoppedContainers.map((c) => c.name).join(', ')}`,
|
|
594
|
-
),
|
|
595
|
-
)
|
|
596
|
-
}
|
|
597
|
-
console.log(
|
|
598
|
-
chalk.gray(
|
|
599
|
-
' You can re-download the engine later to use these containers.',
|
|
600
|
-
),
|
|
601
|
-
)
|
|
602
|
-
console.log()
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// Check for cross-engine dependencies (QuestDB depends on PostgreSQL's psql)
|
|
606
|
-
if (engineName === Engine.PostgreSQL) {
|
|
607
|
-
const questdbContainers = containers.filter(
|
|
608
|
-
(c) => c.engine === Engine.QuestDB,
|
|
609
|
-
)
|
|
610
|
-
if (questdbContainers.length > 0) {
|
|
611
|
-
console.log(
|
|
612
|
-
uiWarning(
|
|
613
|
-
`${questdbContainers.length} QuestDB container(s) depend on PostgreSQL's psql for backup/restore:`,
|
|
614
|
-
),
|
|
615
|
-
)
|
|
616
|
-
console.log(
|
|
617
|
-
chalk.gray(` ${questdbContainers.map((c) => c.name).join(', ')}`),
|
|
618
|
-
)
|
|
619
|
-
console.log(
|
|
620
|
-
chalk.gray(
|
|
621
|
-
' Deleting PostgreSQL will break backup/restore for these containers.',
|
|
622
|
-
),
|
|
623
|
-
)
|
|
624
|
-
console.log()
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
const confirmed = await promptConfirm(
|
|
629
|
-
`Delete ${engineName} ${engineVersion}? This cannot be undone.`,
|
|
630
|
-
false,
|
|
631
|
-
)
|
|
632
|
-
|
|
633
|
-
if (!confirmed) {
|
|
634
|
-
console.log(uiWarning('Deletion cancelled'))
|
|
635
|
-
return
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
// Stop any running containers first (while we still have the binary)
|
|
640
|
-
if (runningContainers.length > 0) {
|
|
641
|
-
const stopSpinner = createSpinner(
|
|
642
|
-
`Stopping ${runningContainers.length} running container(s)...`,
|
|
643
|
-
)
|
|
644
|
-
stopSpinner.start()
|
|
645
|
-
|
|
646
|
-
const engine = getEngine(Engine.PostgreSQL)
|
|
647
|
-
const failedToStop: string[] = []
|
|
648
|
-
|
|
649
|
-
for (const container of runningContainers) {
|
|
650
|
-
stopSpinner.text = `Stopping ${container.name}...`
|
|
651
|
-
try {
|
|
652
|
-
await engine.stop(container)
|
|
653
|
-
await containerManager.updateConfig(container.name, {
|
|
654
|
-
status: 'stopped',
|
|
655
|
-
})
|
|
656
|
-
} catch (error) {
|
|
657
|
-
// Log the original failure before attempting fallback
|
|
658
|
-
const err = error as Error
|
|
659
|
-
console.error(
|
|
660
|
-
chalk.gray(
|
|
661
|
-
` Failed to stop ${container.name} via engine.stop: ${err.message}`,
|
|
662
|
-
),
|
|
663
|
-
)
|
|
664
|
-
// Try fallback kill
|
|
665
|
-
const killed = await processManager.killProcess(container.name, {
|
|
666
|
-
engine: container.engine,
|
|
667
|
-
})
|
|
668
|
-
if (killed) {
|
|
669
|
-
await containerManager.updateConfig(container.name, {
|
|
670
|
-
status: 'stopped',
|
|
671
|
-
})
|
|
672
|
-
} else {
|
|
673
|
-
failedToStop.push(container.name)
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
if (failedToStop.length > 0) {
|
|
679
|
-
stopSpinner.warn(
|
|
680
|
-
`Could not stop ${failedToStop.length} container(s): ${failedToStop.join(', ')}`,
|
|
681
|
-
)
|
|
682
|
-
console.log(
|
|
683
|
-
chalk.yellow(
|
|
684
|
-
' These containers may still be running. Deleting the engine could leave them in a broken state.',
|
|
685
|
-
),
|
|
686
|
-
)
|
|
687
|
-
|
|
688
|
-
if (!options.yes) {
|
|
689
|
-
const continueAnyway = await promptConfirm(
|
|
690
|
-
'Continue with engine deletion anyway?',
|
|
691
|
-
false,
|
|
692
|
-
)
|
|
693
|
-
if (!continueAnyway) {
|
|
694
|
-
console.log(uiWarning('Deletion cancelled'))
|
|
695
|
-
return
|
|
696
|
-
}
|
|
697
|
-
} else {
|
|
698
|
-
console.log(
|
|
699
|
-
chalk.yellow(' Proceeding with deletion (--yes specified)'),
|
|
700
|
-
)
|
|
701
|
-
}
|
|
702
|
-
} else {
|
|
703
|
-
stopSpinner.succeed(`Stopped ${runningContainers.length} container(s)`)
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
// Delete the engine
|
|
708
|
-
const spinner = createSpinner(`Deleting ${engineName} ${engineVersion}...`)
|
|
709
|
-
spinner.start()
|
|
710
|
-
|
|
711
|
-
try {
|
|
712
|
-
await rm(targetEngine.path, { recursive: true, force: true })
|
|
713
|
-
spinner.succeed(`Deleted ${engineName} ${engineVersion}`)
|
|
714
|
-
} catch (error) {
|
|
715
|
-
const e = error as Error
|
|
716
|
-
spinner.fail(`Failed to delete: ${e.message}`)
|
|
717
|
-
process.exit(1)
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
// Install an engine via system package manager (currently unused, kept for future use)
|
|
722
|
-
async function _installEngineViaPackageManager(
|
|
723
|
-
engine: string,
|
|
724
|
-
displayName: string,
|
|
725
|
-
): Promise<void> {
|
|
726
|
-
// Check if already installed
|
|
727
|
-
const statuses = await checkEngineDependencies(engine)
|
|
728
|
-
const allInstalled = statuses.every((s) => s.installed)
|
|
729
|
-
|
|
730
|
-
if (allInstalled) {
|
|
731
|
-
console.log(uiInfo(`${displayName} is already installed.`))
|
|
732
|
-
for (const status of statuses) {
|
|
733
|
-
if (status.path) {
|
|
734
|
-
console.log(chalk.gray(` ${status.dependency.binary}: ${status.path}`))
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
return
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
// Detect package manager
|
|
741
|
-
const packageManager = await detectPackageManager()
|
|
742
|
-
|
|
743
|
-
if (!packageManager) {
|
|
744
|
-
console.error(uiError('No supported package manager found.'))
|
|
745
|
-
console.log()
|
|
746
|
-
console.log(chalk.yellow('Manual installation instructions:'))
|
|
747
|
-
const missingDeps = statuses.filter((s) => !s.installed)
|
|
748
|
-
displayManualInstallInstructions(missingDeps)
|
|
749
|
-
process.exit(1)
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
console.log(uiInfo(`Installing ${displayName} via ${packageManager.name}...`))
|
|
753
|
-
console.log()
|
|
754
|
-
|
|
755
|
-
// Install missing dependencies
|
|
756
|
-
const results = await installEngineDependencies(engine, packageManager)
|
|
757
|
-
|
|
758
|
-
// Report results
|
|
759
|
-
const succeeded = results.filter((r) => r.success)
|
|
760
|
-
const failed = results.filter((r) => !r.success)
|
|
761
|
-
|
|
762
|
-
if (succeeded.length > 0) {
|
|
763
|
-
console.log()
|
|
764
|
-
console.log(uiSuccess(`${displayName} installed successfully.`))
|
|
765
|
-
|
|
766
|
-
// Show installed paths
|
|
767
|
-
const newStatuses = await checkEngineDependencies(engine)
|
|
768
|
-
for (const status of newStatuses) {
|
|
769
|
-
if (status.installed && status.path) {
|
|
770
|
-
console.log(chalk.gray(` ${status.dependency.binary}: ${status.path}`))
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
if (failed.length > 0) {
|
|
776
|
-
console.log()
|
|
777
|
-
console.error(uiError('Some components failed to install:'))
|
|
778
|
-
for (const result of failed) {
|
|
779
|
-
console.error(chalk.red(` ${result.dependency.name}: ${result.error}`))
|
|
780
|
-
}
|
|
781
|
-
process.exit(1)
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
// Check if some dependencies couldn't be installed because the package manager
|
|
785
|
-
// doesn't have a package definition for them (e.g., Redis on Windows with Chocolatey)
|
|
786
|
-
if (results.length === 0) {
|
|
787
|
-
const stillMissing = statuses.filter((s) => !s.installed)
|
|
788
|
-
if (stillMissing.length > 0) {
|
|
789
|
-
console.log()
|
|
790
|
-
console.log(
|
|
791
|
-
uiWarning(
|
|
792
|
-
`${packageManager.name} doesn't have packages for ${displayName}.`,
|
|
793
|
-
),
|
|
794
|
-
)
|
|
795
|
-
console.log()
|
|
796
|
-
console.log(chalk.yellow('Manual installation required:'))
|
|
797
|
-
displayManualInstallInstructions(stillMissing)
|
|
798
|
-
process.exit(1)
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
// Main engines command
|
|
804
|
-
export const enginesCommand = new Command('engines')
|
|
805
|
-
.description('Manage installed database engines')
|
|
806
|
-
.option('--json', 'Output as JSON')
|
|
807
|
-
.passThroughOptions()
|
|
808
|
-
.action(async (options: { json?: boolean }) => {
|
|
809
|
-
try {
|
|
810
|
-
// Default action: list installed engines (same as 'engines list')
|
|
811
|
-
await listEngines(options)
|
|
812
|
-
} catch (error) {
|
|
813
|
-
const e = error as Error
|
|
814
|
-
console.error(uiError(e.message))
|
|
815
|
-
process.exit(1)
|
|
816
|
-
}
|
|
817
|
-
})
|
|
818
|
-
|
|
819
|
-
// Delete subcommand
|
|
820
|
-
enginesCommand
|
|
821
|
-
.command('delete [engine] [version]')
|
|
822
|
-
.description('Delete an installed engine version')
|
|
823
|
-
.option('-y, --yes', 'Skip confirmation')
|
|
824
|
-
.action(
|
|
825
|
-
async (
|
|
826
|
-
engine: string | undefined,
|
|
827
|
-
version: string | undefined,
|
|
828
|
-
options: { yes?: boolean },
|
|
829
|
-
) => {
|
|
830
|
-
try {
|
|
831
|
-
await deleteEngine(engine, version, options)
|
|
832
|
-
} catch (error) {
|
|
833
|
-
const e = error as Error
|
|
834
|
-
console.error(uiError(e.message))
|
|
835
|
-
process.exit(1)
|
|
836
|
-
}
|
|
837
|
-
},
|
|
838
|
-
)
|
|
839
|
-
|
|
840
|
-
// Download subcommand
|
|
841
|
-
enginesCommand
|
|
842
|
-
.command('download <engine> [version]')
|
|
843
|
-
.description('Download/install engine binaries')
|
|
844
|
-
.action(async (engineName: string, version?: string) => {
|
|
845
|
-
try {
|
|
846
|
-
const normalizedEngine = engineName.toLowerCase()
|
|
847
|
-
|
|
848
|
-
// PostgreSQL: download binaries
|
|
849
|
-
if (['postgresql', 'pg', 'postgres'].includes(normalizedEngine)) {
|
|
850
|
-
if (!version) {
|
|
851
|
-
console.error(uiError('PostgreSQL requires a version (e.g., 17)'))
|
|
852
|
-
process.exit(1)
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
const engine = getEngine(Engine.PostgreSQL)
|
|
856
|
-
|
|
857
|
-
const spinner = createSpinner(
|
|
858
|
-
`Checking PostgreSQL ${version} binaries...`,
|
|
859
|
-
)
|
|
860
|
-
spinner.start()
|
|
861
|
-
|
|
862
|
-
// Always call ensureBinaries - it handles cached binaries gracefully
|
|
863
|
-
// and registers client tool paths in config (needed for dependency checks)
|
|
864
|
-
let wasCached = false
|
|
865
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
866
|
-
if (stage === 'cached') {
|
|
867
|
-
wasCached = true
|
|
868
|
-
spinner.text = `PostgreSQL ${version} binaries ready (cached)`
|
|
869
|
-
} else {
|
|
870
|
-
spinner.text = message
|
|
871
|
-
}
|
|
872
|
-
})
|
|
873
|
-
|
|
874
|
-
if (wasCached) {
|
|
875
|
-
spinner.succeed(`PostgreSQL ${version} binaries already installed`)
|
|
876
|
-
} else {
|
|
877
|
-
spinner.succeed(`PostgreSQL ${version} binaries downloaded`)
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
// Show the path for reference
|
|
881
|
-
const { platform, arch } = platformService.getPlatformInfo()
|
|
882
|
-
const fullVersion = postgresqlBinaryManager.getFullVersion(version)
|
|
883
|
-
const binPath = paths.getBinaryPath({
|
|
884
|
-
engine: 'postgresql',
|
|
885
|
-
version: fullVersion,
|
|
886
|
-
platform,
|
|
887
|
-
arch,
|
|
888
|
-
})
|
|
889
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
890
|
-
|
|
891
|
-
// Check for bundled client tools and install missing ones
|
|
892
|
-
await checkAndInstallClientTools('postgresql', binPath)
|
|
893
|
-
return
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
// MySQL: download from hostdb
|
|
897
|
-
if (['mysql'].includes(normalizedEngine)) {
|
|
898
|
-
if (!version) {
|
|
899
|
-
console.error(uiError('MySQL requires a version (e.g., 8.0, 8.4, 9)'))
|
|
900
|
-
process.exit(1)
|
|
901
|
-
}
|
|
902
|
-
|
|
903
|
-
const engine = getEngine(Engine.MySQL)
|
|
904
|
-
|
|
905
|
-
const spinner = createSpinner(`Checking MySQL ${version} binaries...`)
|
|
906
|
-
spinner.start()
|
|
907
|
-
|
|
908
|
-
let wasCached = false
|
|
909
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
910
|
-
if (stage === 'cached') {
|
|
911
|
-
wasCached = true
|
|
912
|
-
spinner.text = `MySQL ${version} binaries ready (cached)`
|
|
913
|
-
} else {
|
|
914
|
-
spinner.text = message
|
|
915
|
-
}
|
|
916
|
-
})
|
|
917
|
-
|
|
918
|
-
if (wasCached) {
|
|
919
|
-
spinner.succeed(`MySQL ${version} binaries already installed`)
|
|
920
|
-
} else {
|
|
921
|
-
spinner.succeed(`MySQL ${version} binaries downloaded`)
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
const { platform: mysqlPlatform, arch: mysqlArch } =
|
|
925
|
-
platformService.getPlatformInfo()
|
|
926
|
-
const mysqlFullVersion = mysqlBinaryManager.getFullVersion(version)
|
|
927
|
-
const mysqlBinPath = paths.getBinaryPath({
|
|
928
|
-
engine: 'mysql',
|
|
929
|
-
version: mysqlFullVersion,
|
|
930
|
-
platform: mysqlPlatform,
|
|
931
|
-
arch: mysqlArch,
|
|
932
|
-
})
|
|
933
|
-
console.log(chalk.gray(` Location: ${mysqlBinPath}`))
|
|
934
|
-
|
|
935
|
-
// Check for bundled client tools and install missing ones
|
|
936
|
-
await checkAndInstallClientTools('mysql', mysqlBinPath)
|
|
937
|
-
return
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
// MariaDB: download from hostdb
|
|
941
|
-
if (['mariadb', 'maria'].includes(normalizedEngine)) {
|
|
942
|
-
if (!version) {
|
|
943
|
-
console.error(
|
|
944
|
-
uiError('MariaDB requires a version (e.g., 10.11, 11.4, 11.8)'),
|
|
945
|
-
)
|
|
946
|
-
process.exit(1)
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
const engine = getEngine(Engine.MariaDB)
|
|
950
|
-
|
|
951
|
-
const spinner = createSpinner(`Checking MariaDB ${version} binaries...`)
|
|
952
|
-
spinner.start()
|
|
953
|
-
|
|
954
|
-
let wasCached = false
|
|
955
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
956
|
-
if (stage === 'cached') {
|
|
957
|
-
wasCached = true
|
|
958
|
-
spinner.text = `MariaDB ${version} binaries ready (cached)`
|
|
959
|
-
} else {
|
|
960
|
-
spinner.text = message
|
|
961
|
-
}
|
|
962
|
-
})
|
|
963
|
-
|
|
964
|
-
if (wasCached) {
|
|
965
|
-
spinner.succeed(`MariaDB ${version} binaries already installed`)
|
|
966
|
-
} else {
|
|
967
|
-
spinner.succeed(`MariaDB ${version} binaries downloaded`)
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
const { platform: mariadbPlatform, arch: mariadbArch } =
|
|
971
|
-
platformService.getPlatformInfo()
|
|
972
|
-
const mariadbFullVersion = mariadbBinaryManager.getFullVersion(version)
|
|
973
|
-
const mariadbBinPath = paths.getBinaryPath({
|
|
974
|
-
engine: 'mariadb',
|
|
975
|
-
version: mariadbFullVersion,
|
|
976
|
-
platform: mariadbPlatform,
|
|
977
|
-
arch: mariadbArch,
|
|
978
|
-
})
|
|
979
|
-
console.log(chalk.gray(` Location: ${mariadbBinPath}`))
|
|
980
|
-
|
|
981
|
-
// Check for bundled client tools and install missing ones
|
|
982
|
-
await checkAndInstallClientTools('mariadb', mariadbBinPath)
|
|
983
|
-
return
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
if (['sqlite', 'sqlite3'].includes(normalizedEngine)) {
|
|
987
|
-
if (!version) {
|
|
988
|
-
console.error(uiError('SQLite requires a version (e.g., 3)'))
|
|
989
|
-
process.exit(1)
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
const engine = getEngine(Engine.SQLite)
|
|
993
|
-
|
|
994
|
-
const spinner = createSpinner(`Checking SQLite ${version} binaries...`)
|
|
995
|
-
spinner.start()
|
|
996
|
-
|
|
997
|
-
let wasCached = false
|
|
998
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
999
|
-
if (stage === 'cached') {
|
|
1000
|
-
wasCached = true
|
|
1001
|
-
spinner.text = `SQLite ${version} binaries ready (cached)`
|
|
1002
|
-
} else {
|
|
1003
|
-
spinner.text = message
|
|
1004
|
-
}
|
|
1005
|
-
})
|
|
1006
|
-
|
|
1007
|
-
if (wasCached) {
|
|
1008
|
-
spinner.succeed(`SQLite ${version} binaries already installed`)
|
|
1009
|
-
} else {
|
|
1010
|
-
spinner.succeed(`SQLite ${version} binaries downloaded`)
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
const { platform: sqlitePlatform, arch: sqliteArch } =
|
|
1014
|
-
platformService.getPlatformInfo()
|
|
1015
|
-
const sqliteFullVersion = sqliteBinaryManager.getFullVersion(version)
|
|
1016
|
-
const sqliteBinPath = paths.getBinaryPath({
|
|
1017
|
-
engine: 'sqlite',
|
|
1018
|
-
version: sqliteFullVersion,
|
|
1019
|
-
platform: sqlitePlatform,
|
|
1020
|
-
arch: sqliteArch,
|
|
1021
|
-
})
|
|
1022
|
-
console.log(chalk.gray(` Location: ${sqliteBinPath}`))
|
|
1023
|
-
return
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
if (['duckdb', 'duck'].includes(normalizedEngine)) {
|
|
1027
|
-
if (!version) {
|
|
1028
|
-
console.error(uiError('DuckDB requires a version (e.g., 1)'))
|
|
1029
|
-
process.exit(1)
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
const engine = getEngine(Engine.DuckDB)
|
|
1033
|
-
|
|
1034
|
-
const spinner = createSpinner(`Checking DuckDB ${version} binaries...`)
|
|
1035
|
-
spinner.start()
|
|
1036
|
-
|
|
1037
|
-
let wasCached = false
|
|
1038
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1039
|
-
if (stage === 'cached') {
|
|
1040
|
-
wasCached = true
|
|
1041
|
-
spinner.text = `DuckDB ${version} binaries ready (cached)`
|
|
1042
|
-
} else {
|
|
1043
|
-
spinner.text = message
|
|
1044
|
-
}
|
|
1045
|
-
})
|
|
1046
|
-
|
|
1047
|
-
if (wasCached) {
|
|
1048
|
-
spinner.succeed(`DuckDB ${version} binaries already installed`)
|
|
1049
|
-
} else {
|
|
1050
|
-
spinner.succeed(`DuckDB ${version} binaries downloaded`)
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1053
|
-
const { platform: duckdbPlatform, arch: duckdbArch } =
|
|
1054
|
-
platformService.getPlatformInfo()
|
|
1055
|
-
const duckdbFullVersion = duckdbBinaryManager.getFullVersion(version)
|
|
1056
|
-
const duckdbBinPath = paths.getBinaryPath({
|
|
1057
|
-
engine: 'duckdb',
|
|
1058
|
-
version: duckdbFullVersion,
|
|
1059
|
-
platform: duckdbPlatform,
|
|
1060
|
-
arch: duckdbArch,
|
|
1061
|
-
})
|
|
1062
|
-
console.log(chalk.gray(` Location: ${duckdbBinPath}`))
|
|
1063
|
-
return
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
if (['mongodb', 'mongo'].includes(normalizedEngine)) {
|
|
1067
|
-
if (!version) {
|
|
1068
|
-
console.error(uiError('MongoDB requires a version (e.g., 7.0, 8.0)'))
|
|
1069
|
-
process.exit(1)
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
const engine = getEngine(Engine.MongoDB)
|
|
1073
|
-
|
|
1074
|
-
const spinner = createSpinner(`Checking MongoDB ${version} binaries...`)
|
|
1075
|
-
spinner.start()
|
|
1076
|
-
|
|
1077
|
-
// Always call ensureBinaries - it handles cached binaries gracefully
|
|
1078
|
-
let wasCached = false
|
|
1079
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1080
|
-
if (stage === 'cached') {
|
|
1081
|
-
wasCached = true
|
|
1082
|
-
spinner.text = `MongoDB ${version} binaries ready (cached)`
|
|
1083
|
-
} else {
|
|
1084
|
-
spinner.text = message
|
|
1085
|
-
}
|
|
1086
|
-
})
|
|
1087
|
-
|
|
1088
|
-
if (wasCached) {
|
|
1089
|
-
spinner.succeed(`MongoDB ${version} binaries already installed`)
|
|
1090
|
-
} else {
|
|
1091
|
-
spinner.succeed(`MongoDB ${version} binaries downloaded`)
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
// Show the path for reference
|
|
1095
|
-
const { platform, arch } = platformService.getPlatformInfo()
|
|
1096
|
-
const fullVersion = mongodbBinaryManager.getFullVersion(version)
|
|
1097
|
-
const binPath = paths.getBinaryPath({
|
|
1098
|
-
engine: 'mongodb',
|
|
1099
|
-
version: fullVersion,
|
|
1100
|
-
platform,
|
|
1101
|
-
arch,
|
|
1102
|
-
})
|
|
1103
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1104
|
-
|
|
1105
|
-
// Check for bundled client tools and install missing ones
|
|
1106
|
-
await checkAndInstallClientTools('mongodb', binPath)
|
|
1107
|
-
return
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
if (normalizedEngine === 'redis') {
|
|
1111
|
-
if (!version) {
|
|
1112
|
-
console.error(uiError('Redis requires a version (e.g., 8)'))
|
|
1113
|
-
process.exit(1)
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
const engine = getEngine(Engine.Redis)
|
|
1117
|
-
|
|
1118
|
-
const spinner = createSpinner(`Checking Redis ${version} binaries...`)
|
|
1119
|
-
spinner.start()
|
|
1120
|
-
|
|
1121
|
-
// Always call ensureBinaries - it handles cached binaries gracefully
|
|
1122
|
-
let wasCached = false
|
|
1123
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1124
|
-
if (stage === 'cached') {
|
|
1125
|
-
wasCached = true
|
|
1126
|
-
spinner.text = `Redis ${version} binaries ready (cached)`
|
|
1127
|
-
} else {
|
|
1128
|
-
spinner.text = message
|
|
1129
|
-
}
|
|
1130
|
-
})
|
|
1131
|
-
|
|
1132
|
-
if (wasCached) {
|
|
1133
|
-
spinner.succeed(`Redis ${version} binaries already installed`)
|
|
1134
|
-
} else {
|
|
1135
|
-
spinner.succeed(`Redis ${version} binaries downloaded`)
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
// Show the path for reference
|
|
1139
|
-
const { platform: redisPlatform, arch: redisArch } =
|
|
1140
|
-
platformService.getPlatformInfo()
|
|
1141
|
-
const redisFullVersion = redisBinaryManager.getFullVersion(version)
|
|
1142
|
-
const binPath = paths.getBinaryPath({
|
|
1143
|
-
engine: 'redis',
|
|
1144
|
-
version: redisFullVersion,
|
|
1145
|
-
platform: redisPlatform,
|
|
1146
|
-
arch: redisArch,
|
|
1147
|
-
})
|
|
1148
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1149
|
-
|
|
1150
|
-
// Check for bundled client tools and install missing ones
|
|
1151
|
-
await checkAndInstallClientTools('redis', binPath)
|
|
1152
|
-
return
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
if (normalizedEngine === 'valkey') {
|
|
1156
|
-
if (!version) {
|
|
1157
|
-
console.error(uiError('Valkey requires a version (e.g., 9)'))
|
|
1158
|
-
process.exit(1)
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
const engine = getEngine(Engine.Valkey)
|
|
1162
|
-
|
|
1163
|
-
const spinner = createSpinner(`Checking Valkey ${version} binaries...`)
|
|
1164
|
-
spinner.start()
|
|
1165
|
-
|
|
1166
|
-
// Always call ensureBinaries - it handles cached binaries gracefully
|
|
1167
|
-
let wasCached = false
|
|
1168
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1169
|
-
if (stage === 'cached') {
|
|
1170
|
-
wasCached = true
|
|
1171
|
-
spinner.text = `Valkey ${version} binaries ready (cached)`
|
|
1172
|
-
} else {
|
|
1173
|
-
spinner.text = message
|
|
1174
|
-
}
|
|
1175
|
-
})
|
|
1176
|
-
|
|
1177
|
-
if (wasCached) {
|
|
1178
|
-
spinner.succeed(`Valkey ${version} binaries already installed`)
|
|
1179
|
-
} else {
|
|
1180
|
-
spinner.succeed(`Valkey ${version} binaries downloaded`)
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
// Show the path for reference
|
|
1184
|
-
const { platform: valkeyPlatform, arch: valkeyArch } =
|
|
1185
|
-
platformService.getPlatformInfo()
|
|
1186
|
-
const valkeyFullVersion = valkeyBinaryManager.getFullVersion(version)
|
|
1187
|
-
const binPath = paths.getBinaryPath({
|
|
1188
|
-
engine: 'valkey',
|
|
1189
|
-
version: valkeyFullVersion,
|
|
1190
|
-
platform: valkeyPlatform,
|
|
1191
|
-
arch: valkeyArch,
|
|
1192
|
-
})
|
|
1193
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1194
|
-
|
|
1195
|
-
// Check for bundled client tools and install missing ones
|
|
1196
|
-
await checkAndInstallClientTools('valkey', binPath)
|
|
1197
|
-
return
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
if (['clickhouse', 'ch'].includes(normalizedEngine)) {
|
|
1201
|
-
// Check platform support
|
|
1202
|
-
const { platform } = platformService.getPlatformInfo()
|
|
1203
|
-
if (platform === Platform.Win32) {
|
|
1204
|
-
console.error(
|
|
1205
|
-
uiError('ClickHouse is not supported on Windows via hostdb'),
|
|
1206
|
-
)
|
|
1207
|
-
console.log(
|
|
1208
|
-
chalk.gray(
|
|
1209
|
-
' ClickHouse binaries are only available for macOS and Linux.',
|
|
1210
|
-
),
|
|
1211
|
-
)
|
|
1212
|
-
process.exit(1)
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
if (!version) {
|
|
1216
|
-
console.error(uiError('ClickHouse requires a version (e.g., 25.12)'))
|
|
1217
|
-
process.exit(1)
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
const engine = getEngine(Engine.ClickHouse)
|
|
1221
|
-
|
|
1222
|
-
const spinner = createSpinner(
|
|
1223
|
-
`Checking ClickHouse ${version} binaries...`,
|
|
1224
|
-
)
|
|
1225
|
-
spinner.start()
|
|
1226
|
-
|
|
1227
|
-
let wasCached = false
|
|
1228
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1229
|
-
if (stage === 'cached') {
|
|
1230
|
-
wasCached = true
|
|
1231
|
-
spinner.text = `ClickHouse ${version} binaries ready (cached)`
|
|
1232
|
-
} else {
|
|
1233
|
-
spinner.text = message
|
|
1234
|
-
}
|
|
1235
|
-
})
|
|
1236
|
-
|
|
1237
|
-
if (wasCached) {
|
|
1238
|
-
spinner.succeed(`ClickHouse ${version} binaries already installed`)
|
|
1239
|
-
} else {
|
|
1240
|
-
spinner.succeed(`ClickHouse ${version} binaries downloaded`)
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
// Show the path for reference
|
|
1244
|
-
const { platform: chPlatform, arch: chArch } =
|
|
1245
|
-
platformService.getPlatformInfo()
|
|
1246
|
-
const chFullVersion = clickhouseBinaryManager.getFullVersion(version)
|
|
1247
|
-
const binPath = paths.getBinaryPath({
|
|
1248
|
-
engine: 'clickhouse',
|
|
1249
|
-
version: chFullVersion,
|
|
1250
|
-
platform: chPlatform,
|
|
1251
|
-
arch: chArch,
|
|
1252
|
-
})
|
|
1253
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1254
|
-
|
|
1255
|
-
// Check for bundled client tools and install missing ones
|
|
1256
|
-
await checkAndInstallClientTools('clickhouse', binPath)
|
|
1257
|
-
return
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
if (['qdrant', 'qd'].includes(normalizedEngine)) {
|
|
1261
|
-
if (!version) {
|
|
1262
|
-
console.error(uiError('Qdrant requires a version (e.g., 1)'))
|
|
1263
|
-
process.exit(1)
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
const engine = getEngine(Engine.Qdrant)
|
|
1267
|
-
|
|
1268
|
-
const spinner = createSpinner(`Checking Qdrant ${version} binaries...`)
|
|
1269
|
-
spinner.start()
|
|
1270
|
-
|
|
1271
|
-
let wasCached = false
|
|
1272
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1273
|
-
if (stage === 'cached') {
|
|
1274
|
-
wasCached = true
|
|
1275
|
-
spinner.text = `Qdrant ${version} binaries ready (cached)`
|
|
1276
|
-
} else {
|
|
1277
|
-
spinner.text = message
|
|
1278
|
-
}
|
|
1279
|
-
})
|
|
1280
|
-
|
|
1281
|
-
if (wasCached) {
|
|
1282
|
-
spinner.succeed(`Qdrant ${version} binaries already installed`)
|
|
1283
|
-
} else {
|
|
1284
|
-
spinner.succeed(`Qdrant ${version} binaries downloaded`)
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
// Show the path for reference
|
|
1288
|
-
const { platform: qdrantPlatform, arch: qdrantArch } =
|
|
1289
|
-
platformService.getPlatformInfo()
|
|
1290
|
-
const qdrantFullVersion = qdrantBinaryManager.getFullVersion(version)
|
|
1291
|
-
const binPath = paths.getBinaryPath({
|
|
1292
|
-
engine: 'qdrant',
|
|
1293
|
-
version: qdrantFullVersion,
|
|
1294
|
-
platform: qdrantPlatform,
|
|
1295
|
-
arch: qdrantArch,
|
|
1296
|
-
})
|
|
1297
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1298
|
-
|
|
1299
|
-
// Skip client tools check for Qdrant - it's a REST API server
|
|
1300
|
-
// with no CLI client tools (uses HTTP/gRPC protocols instead)
|
|
1301
|
-
return
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
if (['meilisearch', 'meili', 'ms'].includes(normalizedEngine)) {
|
|
1305
|
-
if (!version) {
|
|
1306
|
-
console.error(uiError('Meilisearch requires a version (e.g., 1)'))
|
|
1307
|
-
process.exit(1)
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
const engine = getEngine(Engine.Meilisearch)
|
|
1311
|
-
|
|
1312
|
-
const spinner = createSpinner(
|
|
1313
|
-
`Checking Meilisearch ${version} binaries...`,
|
|
1314
|
-
)
|
|
1315
|
-
spinner.start()
|
|
1316
|
-
|
|
1317
|
-
let wasCached = false
|
|
1318
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1319
|
-
if (stage === 'cached') {
|
|
1320
|
-
wasCached = true
|
|
1321
|
-
spinner.text = `Meilisearch ${version} binaries ready (cached)`
|
|
1322
|
-
} else {
|
|
1323
|
-
spinner.text = message
|
|
1324
|
-
}
|
|
1325
|
-
})
|
|
1326
|
-
|
|
1327
|
-
if (wasCached) {
|
|
1328
|
-
spinner.succeed(`Meilisearch ${version} binaries already installed`)
|
|
1329
|
-
} else {
|
|
1330
|
-
spinner.succeed(`Meilisearch ${version} binaries downloaded`)
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
// Show the path for reference
|
|
1334
|
-
const { platform: meilisearchPlatform, arch: meilisearchArch } =
|
|
1335
|
-
platformService.getPlatformInfo()
|
|
1336
|
-
const meilisearchFullVersion =
|
|
1337
|
-
meilisearchBinaryManager.getFullVersion(version)
|
|
1338
|
-
const binPath = paths.getBinaryPath({
|
|
1339
|
-
engine: 'meilisearch',
|
|
1340
|
-
version: meilisearchFullVersion,
|
|
1341
|
-
platform: meilisearchPlatform,
|
|
1342
|
-
arch: meilisearchArch,
|
|
1343
|
-
})
|
|
1344
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1345
|
-
|
|
1346
|
-
// Skip client tools check for Meilisearch - it's a REST API server
|
|
1347
|
-
// with no CLI client tools (uses HTTP protocols instead)
|
|
1348
|
-
return
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
if (['ferretdb', 'ferret'].includes(normalizedEngine)) {
|
|
1352
|
-
const { platform } = platformService.getPlatformInfo()
|
|
1353
|
-
|
|
1354
|
-
if (!version) {
|
|
1355
|
-
// Auto-select v1 on Windows (v2 not supported)
|
|
1356
|
-
if (platform === Platform.Win32) {
|
|
1357
|
-
version = '1'
|
|
1358
|
-
console.log(
|
|
1359
|
-
chalk.gray(
|
|
1360
|
-
' Auto-selecting FerretDB v1 (v2 is not available on Windows)',
|
|
1361
|
-
),
|
|
1362
|
-
)
|
|
1363
|
-
} else {
|
|
1364
|
-
console.error(uiError('FerretDB requires a version (e.g., 1 or 2)'))
|
|
1365
|
-
process.exit(1)
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
// Block v2 on Windows with helpful message
|
|
1370
|
-
if (platform === Platform.Win32 && !isV1(version)) {
|
|
1371
|
-
console.error(
|
|
1372
|
-
uiError(
|
|
1373
|
-
'FerretDB v2 is not supported on Windows (postgresql-documentdb has startup issues)',
|
|
1374
|
-
),
|
|
1375
|
-
)
|
|
1376
|
-
console.log(
|
|
1377
|
-
chalk.gray(
|
|
1378
|
-
' Use FerretDB v1 instead, which uses plain PostgreSQL:',
|
|
1379
|
-
),
|
|
1380
|
-
)
|
|
1381
|
-
console.log(chalk.cyan(' spindb engines download ferretdb 1'))
|
|
1382
|
-
process.exit(1)
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
const engine = getEngine(Engine.FerretDB)
|
|
1386
|
-
const v1 = isV1(version)
|
|
1387
|
-
|
|
1388
|
-
const spinner = createSpinner(
|
|
1389
|
-
`Checking FerretDB ${version} binaries...`,
|
|
1390
|
-
)
|
|
1391
|
-
spinner.start()
|
|
1392
|
-
|
|
1393
|
-
let wasCached = false
|
|
1394
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1395
|
-
if (stage === 'cached') {
|
|
1396
|
-
wasCached = true
|
|
1397
|
-
spinner.text = `FerretDB ${version} binaries ready (cached)`
|
|
1398
|
-
} else {
|
|
1399
|
-
spinner.text = message
|
|
1400
|
-
}
|
|
1401
|
-
})
|
|
1402
|
-
|
|
1403
|
-
if (wasCached) {
|
|
1404
|
-
spinner.succeed(`FerretDB ${version} binaries already installed`)
|
|
1405
|
-
} else {
|
|
1406
|
-
spinner.succeed(`FerretDB ${version} binaries downloaded`)
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
// Show the path for reference
|
|
1410
|
-
const { platform: ferretPlatform, arch: ferretArch } =
|
|
1411
|
-
platformService.getPlatformInfo()
|
|
1412
|
-
const ferretFullVersion = ferretdbBinaryManager.getFullVersion(version)
|
|
1413
|
-
const binPath = ferretdbBinaryManager.getFerretDBBinaryPath(
|
|
1414
|
-
ferretFullVersion,
|
|
1415
|
-
ferretPlatform,
|
|
1416
|
-
ferretArch,
|
|
1417
|
-
)
|
|
1418
|
-
console.log(chalk.gray(` FerretDB location: ${binPath}`))
|
|
1419
|
-
|
|
1420
|
-
// Show backend location (version-dependent)
|
|
1421
|
-
if (v1) {
|
|
1422
|
-
const pgFullVersion = postgresqlBinaryManager.getFullVersion(
|
|
1423
|
-
DEFAULT_V1_POSTGRESQL_VERSION,
|
|
1424
|
-
)
|
|
1425
|
-
const pgPath = paths.getBinaryPath({
|
|
1426
|
-
engine: 'postgresql',
|
|
1427
|
-
version: pgFullVersion,
|
|
1428
|
-
platform: ferretPlatform,
|
|
1429
|
-
arch: ferretArch,
|
|
1430
|
-
})
|
|
1431
|
-
console.log(chalk.gray(` PostgreSQL backend location: ${pgPath}`))
|
|
1432
|
-
} else {
|
|
1433
|
-
const fullDocumentDBVersion = normalizeDocumentDBVersion(
|
|
1434
|
-
DEFAULT_DOCUMENTDB_VERSION,
|
|
1435
|
-
)
|
|
1436
|
-
const documentdbPath = ferretdbBinaryManager.getDocumentDBBinaryPath(
|
|
1437
|
-
fullDocumentDBVersion,
|
|
1438
|
-
ferretPlatform,
|
|
1439
|
-
ferretArch,
|
|
1440
|
-
)
|
|
1441
|
-
console.log(
|
|
1442
|
-
chalk.gray(` postgresql-documentdb location: ${documentdbPath}`),
|
|
1443
|
-
)
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
// Skip client tools check - FerretDB uses MongoDB client tools (mongosh)
|
|
1447
|
-
// which are installed separately via: spindb engines download mongodb
|
|
1448
|
-
console.log(
|
|
1449
|
-
chalk.gray(
|
|
1450
|
-
' Note: Use mongosh to connect (install via: spindb engines download mongodb)',
|
|
1451
|
-
),
|
|
1452
|
-
)
|
|
1453
|
-
return
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
|
-
if (['couchdb', 'couch'].includes(normalizedEngine)) {
|
|
1457
|
-
if (!version) {
|
|
1458
|
-
console.error(uiError('CouchDB requires a version (e.g., 3)'))
|
|
1459
|
-
process.exit(1)
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
const engine = getEngine(Engine.CouchDB)
|
|
1463
|
-
|
|
1464
|
-
const spinner = createSpinner(`Checking CouchDB ${version} binaries...`)
|
|
1465
|
-
spinner.start()
|
|
1466
|
-
|
|
1467
|
-
let wasCached = false
|
|
1468
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1469
|
-
if (stage === 'cached') {
|
|
1470
|
-
wasCached = true
|
|
1471
|
-
spinner.text = `CouchDB ${version} binaries ready (cached)`
|
|
1472
|
-
} else {
|
|
1473
|
-
spinner.text = message
|
|
1474
|
-
}
|
|
1475
|
-
})
|
|
1476
|
-
|
|
1477
|
-
if (wasCached) {
|
|
1478
|
-
spinner.succeed(`CouchDB ${version} binaries already installed`)
|
|
1479
|
-
} else {
|
|
1480
|
-
spinner.succeed(`CouchDB ${version} binaries downloaded`)
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
|
-
// Show the path for reference
|
|
1484
|
-
const { platform: couchdbPlatform, arch: couchdbArch } =
|
|
1485
|
-
platformService.getPlatformInfo()
|
|
1486
|
-
const couchdbFullVersion = couchdbBinaryManager.getFullVersion(version)
|
|
1487
|
-
const binPath = paths.getBinaryPath({
|
|
1488
|
-
engine: 'couchdb',
|
|
1489
|
-
version: couchdbFullVersion,
|
|
1490
|
-
platform: couchdbPlatform,
|
|
1491
|
-
arch: couchdbArch,
|
|
1492
|
-
})
|
|
1493
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1494
|
-
|
|
1495
|
-
// Skip client tools check for CouchDB - it's a REST API server
|
|
1496
|
-
// with no CLI client tools (uses HTTP protocols instead)
|
|
1497
|
-
return
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
if (['cockroachdb', 'crdb'].includes(normalizedEngine)) {
|
|
1501
|
-
if (!version) {
|
|
1502
|
-
console.error(uiError('CockroachDB requires a version (e.g., 25)'))
|
|
1503
|
-
process.exit(1)
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
const engine = getEngine(Engine.CockroachDB)
|
|
1507
|
-
|
|
1508
|
-
const spinner = createSpinner(
|
|
1509
|
-
`Checking CockroachDB ${version} binaries...`,
|
|
1510
|
-
)
|
|
1511
|
-
spinner.start()
|
|
1512
|
-
|
|
1513
|
-
let wasCached = false
|
|
1514
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1515
|
-
if (stage === 'cached') {
|
|
1516
|
-
wasCached = true
|
|
1517
|
-
spinner.text = `CockroachDB ${version} binaries ready (cached)`
|
|
1518
|
-
} else {
|
|
1519
|
-
spinner.text = message
|
|
1520
|
-
}
|
|
1521
|
-
})
|
|
1522
|
-
|
|
1523
|
-
if (wasCached) {
|
|
1524
|
-
spinner.succeed(`CockroachDB ${version} binaries already installed`)
|
|
1525
|
-
} else {
|
|
1526
|
-
spinner.succeed(`CockroachDB ${version} binaries downloaded`)
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
// Show the path for reference
|
|
1530
|
-
const { platform: cockroachdbPlatform, arch: cockroachdbArch } =
|
|
1531
|
-
platformService.getPlatformInfo()
|
|
1532
|
-
const cockroachdbFullVersion =
|
|
1533
|
-
cockroachdbBinaryManager.getFullVersion(version)
|
|
1534
|
-
const binPath = paths.getBinaryPath({
|
|
1535
|
-
engine: 'cockroachdb',
|
|
1536
|
-
version: cockroachdbFullVersion,
|
|
1537
|
-
platform: cockroachdbPlatform,
|
|
1538
|
-
arch: cockroachdbArch,
|
|
1539
|
-
})
|
|
1540
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1541
|
-
|
|
1542
|
-
// Skip client tools check for CockroachDB - the cockroach binary is both server and client
|
|
1543
|
-
return
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
if (['surrealdb', 'surreal'].includes(normalizedEngine)) {
|
|
1547
|
-
if (!version) {
|
|
1548
|
-
console.error(uiError('SurrealDB requires a version (e.g., 2)'))
|
|
1549
|
-
process.exit(1)
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
const engine = getEngine(Engine.SurrealDB)
|
|
1553
|
-
|
|
1554
|
-
const spinner = createSpinner(
|
|
1555
|
-
`Checking SurrealDB ${version} binaries...`,
|
|
1556
|
-
)
|
|
1557
|
-
spinner.start()
|
|
1558
|
-
|
|
1559
|
-
let wasCached = false
|
|
1560
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1561
|
-
if (stage === 'cached') {
|
|
1562
|
-
wasCached = true
|
|
1563
|
-
spinner.text = `SurrealDB ${version} binaries ready (cached)`
|
|
1564
|
-
} else {
|
|
1565
|
-
spinner.text = message
|
|
1566
|
-
}
|
|
1567
|
-
})
|
|
1568
|
-
|
|
1569
|
-
if (wasCached) {
|
|
1570
|
-
spinner.succeed(`SurrealDB ${version} binaries already installed`)
|
|
1571
|
-
} else {
|
|
1572
|
-
spinner.succeed(`SurrealDB ${version} binaries downloaded`)
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
|
-
// Show the path for reference
|
|
1576
|
-
const { platform: surrealdbPlatform, arch: surrealdbArch } =
|
|
1577
|
-
platformService.getPlatformInfo()
|
|
1578
|
-
const surrealdbFullVersion =
|
|
1579
|
-
surrealdbBinaryManager.getFullVersion(version)
|
|
1580
|
-
const binPath = paths.getBinaryPath({
|
|
1581
|
-
engine: 'surrealdb',
|
|
1582
|
-
version: surrealdbFullVersion,
|
|
1583
|
-
platform: surrealdbPlatform,
|
|
1584
|
-
arch: surrealdbArch,
|
|
1585
|
-
})
|
|
1586
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1587
|
-
|
|
1588
|
-
// Skip client tools check for SurrealDB - the surreal binary is both server and client
|
|
1589
|
-
return
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
if (['questdb', 'quest'].includes(normalizedEngine)) {
|
|
1593
|
-
if (!version) {
|
|
1594
|
-
console.error(uiError('QuestDB requires a version (e.g., 9)'))
|
|
1595
|
-
process.exit(1)
|
|
1596
|
-
}
|
|
1597
|
-
|
|
1598
|
-
const engine = getEngine(Engine.QuestDB)
|
|
1599
|
-
|
|
1600
|
-
const spinner = createSpinner(`Checking QuestDB ${version} binaries...`)
|
|
1601
|
-
spinner.start()
|
|
1602
|
-
|
|
1603
|
-
let wasCached = false
|
|
1604
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1605
|
-
if (stage === 'cached') {
|
|
1606
|
-
wasCached = true
|
|
1607
|
-
spinner.text = `QuestDB ${version} binaries ready (cached)`
|
|
1608
|
-
} else {
|
|
1609
|
-
spinner.text = message
|
|
1610
|
-
}
|
|
1611
|
-
})
|
|
1612
|
-
|
|
1613
|
-
if (wasCached) {
|
|
1614
|
-
spinner.succeed(`QuestDB ${version} binaries already installed`)
|
|
1615
|
-
} else {
|
|
1616
|
-
spinner.succeed(`QuestDB ${version} binaries downloaded`)
|
|
1617
|
-
}
|
|
1618
|
-
|
|
1619
|
-
// Show the path for reference
|
|
1620
|
-
const { platform: questdbPlatform, arch: questdbArch } =
|
|
1621
|
-
platformService.getPlatformInfo()
|
|
1622
|
-
const questdbFullVersion = questdbBinaryManager.getFullVersion(version)
|
|
1623
|
-
const binPath = paths.getBinaryPath({
|
|
1624
|
-
engine: 'questdb',
|
|
1625
|
-
version: questdbFullVersion,
|
|
1626
|
-
platform: questdbPlatform,
|
|
1627
|
-
arch: questdbArch,
|
|
1628
|
-
})
|
|
1629
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1630
|
-
|
|
1631
|
-
// Skip client tools check for QuestDB - uses psql or Web Console
|
|
1632
|
-
return
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
if (['typedb', 'tdb'].includes(normalizedEngine)) {
|
|
1636
|
-
if (!version) {
|
|
1637
|
-
console.error(uiError('TypeDB requires a version (e.g., 3)'))
|
|
1638
|
-
process.exit(1)
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
|
-
const { platform, arch } = platformService.getPlatformInfo()
|
|
1642
|
-
const platformKey = `${platform}-${arch}`
|
|
1643
|
-
const supportedPlatforms = new Set([
|
|
1644
|
-
'darwin-x64',
|
|
1645
|
-
'darwin-arm64',
|
|
1646
|
-
'linux-x64',
|
|
1647
|
-
'linux-arm64',
|
|
1648
|
-
'win32-x64',
|
|
1649
|
-
])
|
|
1650
|
-
if (!supportedPlatforms.has(platformKey)) {
|
|
1651
|
-
console.error(
|
|
1652
|
-
uiError(
|
|
1653
|
-
`TypeDB binaries are not available for ${platformKey}. Supported: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64.`,
|
|
1654
|
-
),
|
|
1655
|
-
)
|
|
1656
|
-
process.exit(1)
|
|
1657
|
-
}
|
|
1658
|
-
|
|
1659
|
-
const engine = getEngine(Engine.TypeDB)
|
|
1660
|
-
|
|
1661
|
-
const spinner = createSpinner(`Checking TypeDB ${version} binaries...`)
|
|
1662
|
-
spinner.start()
|
|
1663
|
-
|
|
1664
|
-
let wasCached = false
|
|
1665
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1666
|
-
if (stage === 'cached') {
|
|
1667
|
-
wasCached = true
|
|
1668
|
-
spinner.text = `TypeDB ${version} binaries ready (cached)`
|
|
1669
|
-
} else {
|
|
1670
|
-
spinner.text = message
|
|
1671
|
-
}
|
|
1672
|
-
})
|
|
1673
|
-
|
|
1674
|
-
if (wasCached) {
|
|
1675
|
-
spinner.succeed(`TypeDB ${version} binaries already installed`)
|
|
1676
|
-
} else {
|
|
1677
|
-
spinner.succeed(`TypeDB ${version} binaries downloaded`)
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
// Show the path for reference
|
|
1681
|
-
const { platform: typedbPlatform, arch: typedbArch } =
|
|
1682
|
-
platformService.getPlatformInfo()
|
|
1683
|
-
const typedbFullVersion = typedbBinaryManager.getFullVersion(version)
|
|
1684
|
-
const binPath = paths.getBinaryPath({
|
|
1685
|
-
engine: 'typedb',
|
|
1686
|
-
version: typedbFullVersion,
|
|
1687
|
-
platform: typedbPlatform,
|
|
1688
|
-
arch: typedbArch,
|
|
1689
|
-
})
|
|
1690
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1691
|
-
|
|
1692
|
-
// Skip client tools check - TypeDB console is bundled
|
|
1693
|
-
return
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
if (['influxdb', 'influx'].includes(normalizedEngine)) {
|
|
1697
|
-
if (!version) {
|
|
1698
|
-
console.error(uiError('InfluxDB requires a version (e.g., 3)'))
|
|
1699
|
-
process.exit(1)
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
const engine = getEngine(Engine.InfluxDB)
|
|
1703
|
-
|
|
1704
|
-
const spinner = createSpinner(
|
|
1705
|
-
`Checking InfluxDB ${version} binaries...`,
|
|
1706
|
-
)
|
|
1707
|
-
spinner.start()
|
|
1708
|
-
|
|
1709
|
-
let wasCached = false
|
|
1710
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1711
|
-
if (stage === 'cached') {
|
|
1712
|
-
wasCached = true
|
|
1713
|
-
spinner.text = `InfluxDB ${version} binaries ready (cached)`
|
|
1714
|
-
} else {
|
|
1715
|
-
spinner.text = message
|
|
1716
|
-
}
|
|
1717
|
-
})
|
|
1718
|
-
|
|
1719
|
-
if (wasCached) {
|
|
1720
|
-
spinner.succeed(`InfluxDB ${version} binaries already installed`)
|
|
1721
|
-
} else {
|
|
1722
|
-
spinner.succeed(`InfluxDB ${version} binaries downloaded`)
|
|
1723
|
-
}
|
|
1724
|
-
|
|
1725
|
-
// Show the path for reference
|
|
1726
|
-
const { platform: influxdbPlatform, arch: influxdbArch } =
|
|
1727
|
-
platformService.getPlatformInfo()
|
|
1728
|
-
const influxdbFullVersion =
|
|
1729
|
-
influxdbBinaryManager.getFullVersion(version)
|
|
1730
|
-
const binPath = paths.getBinaryPath({
|
|
1731
|
-
engine: 'influxdb',
|
|
1732
|
-
version: influxdbFullVersion,
|
|
1733
|
-
platform: influxdbPlatform,
|
|
1734
|
-
arch: influxdbArch,
|
|
1735
|
-
})
|
|
1736
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1737
|
-
|
|
1738
|
-
// Skip client tools check for InfluxDB - it's a REST API server
|
|
1739
|
-
// with no CLI client tools (uses HTTP protocols instead)
|
|
1740
|
-
return
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
if (['weaviate', 'wv'].includes(normalizedEngine)) {
|
|
1744
|
-
if (!version) {
|
|
1745
|
-
console.error(uiError('Weaviate requires a version (e.g., 1)'))
|
|
1746
|
-
process.exit(1)
|
|
1747
|
-
}
|
|
1748
|
-
|
|
1749
|
-
const engine = getEngine(Engine.Weaviate)
|
|
1750
|
-
|
|
1751
|
-
const spinner = createSpinner(
|
|
1752
|
-
`Checking Weaviate ${version} binaries...`,
|
|
1753
|
-
)
|
|
1754
|
-
spinner.start()
|
|
1755
|
-
|
|
1756
|
-
let wasCached = false
|
|
1757
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1758
|
-
if (stage === 'cached') {
|
|
1759
|
-
wasCached = true
|
|
1760
|
-
spinner.text = `Weaviate ${version} binaries ready (cached)`
|
|
1761
|
-
} else {
|
|
1762
|
-
spinner.text = message
|
|
1763
|
-
}
|
|
1764
|
-
})
|
|
1765
|
-
|
|
1766
|
-
if (wasCached) {
|
|
1767
|
-
spinner.succeed(`Weaviate ${version} binaries already installed`)
|
|
1768
|
-
} else {
|
|
1769
|
-
spinner.succeed(`Weaviate ${version} binaries downloaded`)
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
// Show the path for reference
|
|
1773
|
-
const { platform: weaviatePlatform, arch: weaviateArch } =
|
|
1774
|
-
platformService.getPlatformInfo()
|
|
1775
|
-
const weaviateFullVersion =
|
|
1776
|
-
weaviateBinaryManager.getFullVersion(version)
|
|
1777
|
-
const binPath = paths.getBinaryPath({
|
|
1778
|
-
engine: 'weaviate',
|
|
1779
|
-
version: weaviateFullVersion,
|
|
1780
|
-
platform: weaviatePlatform,
|
|
1781
|
-
arch: weaviateArch,
|
|
1782
|
-
})
|
|
1783
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1784
|
-
|
|
1785
|
-
// Skip client tools check for Weaviate - it's a REST API server
|
|
1786
|
-
// with no CLI client tools (uses HTTP protocols instead)
|
|
1787
|
-
return
|
|
1788
|
-
}
|
|
1789
|
-
|
|
1790
|
-
if (['tigerbeetle', 'tb'].includes(normalizedEngine)) {
|
|
1791
|
-
if (!version) {
|
|
1792
|
-
console.error(uiError('TigerBeetle requires a version (e.g., 0.16)'))
|
|
1793
|
-
process.exit(1)
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
const engine = getEngine(Engine.TigerBeetle)
|
|
1797
|
-
|
|
1798
|
-
const spinner = createSpinner(
|
|
1799
|
-
`Checking TigerBeetle ${version} binaries...`,
|
|
1800
|
-
)
|
|
1801
|
-
spinner.start()
|
|
1802
|
-
|
|
1803
|
-
let wasCached = false
|
|
1804
|
-
await engine.ensureBinaries(version, ({ stage, message }) => {
|
|
1805
|
-
if (stage === 'cached') {
|
|
1806
|
-
wasCached = true
|
|
1807
|
-
spinner.text = `TigerBeetle ${version} binaries ready (cached)`
|
|
1808
|
-
} else {
|
|
1809
|
-
spinner.text = message
|
|
1810
|
-
}
|
|
1811
|
-
})
|
|
1812
|
-
|
|
1813
|
-
if (wasCached) {
|
|
1814
|
-
spinner.succeed(`TigerBeetle ${version} binaries already installed`)
|
|
1815
|
-
} else {
|
|
1816
|
-
spinner.succeed(`TigerBeetle ${version} binaries downloaded`)
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
// Show the path for reference
|
|
1820
|
-
const { platform: tbPlatform, arch: tbArch } =
|
|
1821
|
-
platformService.getPlatformInfo()
|
|
1822
|
-
const tbFullVersion = tigerbeetleBinaryManager.getFullVersion(version)
|
|
1823
|
-
const binPath = paths.getBinaryPath({
|
|
1824
|
-
engine: 'tigerbeetle',
|
|
1825
|
-
version: tbFullVersion,
|
|
1826
|
-
platform: tbPlatform,
|
|
1827
|
-
arch: tbArch,
|
|
1828
|
-
})
|
|
1829
|
-
console.log(chalk.gray(` Location: ${binPath}`))
|
|
1830
|
-
|
|
1831
|
-
return
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
console.error(
|
|
1835
|
-
uiError(
|
|
1836
|
-
`Unknown engine "${engineName}". Supported: ${ALL_ENGINES.join(', ')}`,
|
|
1837
|
-
),
|
|
1838
|
-
)
|
|
1839
|
-
process.exit(1)
|
|
1840
|
-
} catch (error) {
|
|
1841
|
-
const e = error as Error
|
|
1842
|
-
console.error(uiError(e.message))
|
|
1843
|
-
process.exit(1)
|
|
1844
|
-
}
|
|
1845
|
-
})
|
|
1846
|
-
|
|
1847
|
-
// List subcommand (explicit alias for default action)
|
|
1848
|
-
enginesCommand
|
|
1849
|
-
.command('list')
|
|
1850
|
-
.description('List installed database engines')
|
|
1851
|
-
.option('--json', 'Output as JSON')
|
|
1852
|
-
.action(async (options: { json?: boolean }) => {
|
|
1853
|
-
try {
|
|
1854
|
-
await listEngines(options)
|
|
1855
|
-
} catch (error) {
|
|
1856
|
-
const e = error as Error
|
|
1857
|
-
console.error(uiError(e.message))
|
|
1858
|
-
process.exit(1)
|
|
1859
|
-
}
|
|
1860
|
-
})
|
|
1861
|
-
|
|
1862
|
-
// Supported subcommand - list all supported engines from engines.json
|
|
1863
|
-
enginesCommand
|
|
1864
|
-
.command('supported')
|
|
1865
|
-
.description('List all supported database engines')
|
|
1866
|
-
.option('--json', 'Output as JSON')
|
|
1867
|
-
.option('--all', 'Include pending and planned engines')
|
|
1868
|
-
.action(async (options: { json?: boolean; all?: boolean }) => {
|
|
1869
|
-
try {
|
|
1870
|
-
const rawData = await loadEnginesJson()
|
|
1871
|
-
const { platform, arch } = platformService.getPlatformInfo()
|
|
1872
|
-
const platformKey = `${platform}-${arch}`
|
|
1873
|
-
const enginesData = filterEnginesByPlatform(rawData, platformKey)
|
|
1874
|
-
|
|
1875
|
-
if (options.json) {
|
|
1876
|
-
// Output full JSON
|
|
1877
|
-
console.log(JSON.stringify(enginesData, null, 2))
|
|
1878
|
-
return
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
// Simple list output
|
|
1882
|
-
const entries = Object.entries(enginesData.engines) as [
|
|
1883
|
-
string,
|
|
1884
|
-
EngineConfig,
|
|
1885
|
-
][]
|
|
1886
|
-
|
|
1887
|
-
for (const [name, config] of entries) {
|
|
1888
|
-
// Skip non-integrated unless --all flag is set
|
|
1889
|
-
if (!options.all && config.status !== 'integrated') {
|
|
1890
|
-
continue
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
if (options.all) {
|
|
1894
|
-
// Show status in parentheses
|
|
1895
|
-
const statusColor =
|
|
1896
|
-
config.status === 'integrated'
|
|
1897
|
-
? chalk.green
|
|
1898
|
-
: config.status === 'pending'
|
|
1899
|
-
? chalk.blue
|
|
1900
|
-
: chalk.gray
|
|
1901
|
-
console.log(
|
|
1902
|
-
`${config.icon} ${name} ${statusColor(`(${config.status})`)}`,
|
|
1903
|
-
)
|
|
1904
|
-
} else {
|
|
1905
|
-
// Just engine name with icon
|
|
1906
|
-
console.log(`${config.icon} ${name}`)
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
} catch (error) {
|
|
1910
|
-
const e = error as Error
|
|
1911
|
-
console.error(uiError(e.message))
|
|
1912
|
-
process.exit(1)
|
|
1913
|
-
}
|
|
1914
|
-
})
|