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/ports.ts
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander'
|
|
2
|
-
import chalk from 'chalk'
|
|
3
|
-
import { existsSync } from 'fs'
|
|
4
|
-
import { containerManager } from '../../core/container-manager'
|
|
5
|
-
import { processManager } from '../../core/process-manager'
|
|
6
|
-
import { getPgwebStatus } from '../../core/pgweb-utils'
|
|
7
|
-
import { uiError, uiInfo } from '../ui/theme'
|
|
8
|
-
import { getEngineIcon } from '../constants'
|
|
9
|
-
import { Engine, type ContainerConfig } from '../../types'
|
|
10
|
-
import { loadEnginesJson } from '../../config/engines-registry'
|
|
11
|
-
|
|
12
|
-
function getSecondaryPorts(
|
|
13
|
-
config: ContainerConfig,
|
|
14
|
-
): Array<{ port: number; label: string }> {
|
|
15
|
-
const ports: Array<{ port: number; label: string }> = []
|
|
16
|
-
switch (config.engine) {
|
|
17
|
-
case 'cockroachdb':
|
|
18
|
-
ports.push({ port: config.port + 1, label: 'HTTP UI' })
|
|
19
|
-
break
|
|
20
|
-
case 'clickhouse':
|
|
21
|
-
ports.push({ port: config.port + 1, label: 'HTTP' })
|
|
22
|
-
break
|
|
23
|
-
case 'qdrant':
|
|
24
|
-
ports.push({ port: config.port + 1, label: 'gRPC' })
|
|
25
|
-
break
|
|
26
|
-
case 'typedb':
|
|
27
|
-
ports.push({ port: config.port + 6271, label: 'HTTP' })
|
|
28
|
-
break
|
|
29
|
-
case 'questdb':
|
|
30
|
-
ports.push({ port: config.port + 188, label: 'HTTP Console' })
|
|
31
|
-
ports.push({ port: config.port + 197, label: 'ILP' })
|
|
32
|
-
break
|
|
33
|
-
case 'ferretdb':
|
|
34
|
-
if (config.backendPort) {
|
|
35
|
-
ports.push({ port: config.backendPort, label: 'PostgreSQL backend' })
|
|
36
|
-
}
|
|
37
|
-
break
|
|
38
|
-
}
|
|
39
|
-
return ports
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export type PortEntry = { port: number; label: string }
|
|
43
|
-
|
|
44
|
-
export async function getContainerPorts(config: ContainerConfig): Promise<{
|
|
45
|
-
status: 'running' | 'stopped' | 'available' | 'missing'
|
|
46
|
-
ports: PortEntry[]
|
|
47
|
-
}> {
|
|
48
|
-
const isFileBasedDB =
|
|
49
|
-
config.engine === Engine.SQLite || config.engine === Engine.DuckDB
|
|
50
|
-
|
|
51
|
-
if (isFileBasedDB) {
|
|
52
|
-
const fileExists = existsSync(config.database)
|
|
53
|
-
return {
|
|
54
|
-
status: fileExists ? 'available' : 'missing',
|
|
55
|
-
ports: [],
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const isRunning = await processManager.isRunning(config.name, {
|
|
60
|
-
engine: config.engine,
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
const enginesJson = await loadEnginesJson()
|
|
64
|
-
const engineConfig = enginesJson.engines[config.engine]
|
|
65
|
-
const displayName = engineConfig?.displayName || config.engine
|
|
66
|
-
|
|
67
|
-
const ports: PortEntry[] = [{ port: config.port, label: displayName }]
|
|
68
|
-
|
|
69
|
-
// Add secondary ports
|
|
70
|
-
ports.push(...getSecondaryPorts(config))
|
|
71
|
-
|
|
72
|
-
// Check for pgweb (PG-wire-protocol engines only)
|
|
73
|
-
if (
|
|
74
|
-
config.engine === 'postgresql' ||
|
|
75
|
-
config.engine === 'cockroachdb' ||
|
|
76
|
-
config.engine === 'ferretdb'
|
|
77
|
-
) {
|
|
78
|
-
const pgweb = await getPgwebStatus(config.name, config.engine)
|
|
79
|
-
if (pgweb.running && pgweb.port) {
|
|
80
|
-
ports.push({ port: pgweb.port, label: 'pgweb' })
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return {
|
|
85
|
-
status: isRunning ? 'running' : 'stopped',
|
|
86
|
-
ports,
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export const portsCommand = new Command('ports')
|
|
91
|
-
.description('Show ports used by containers')
|
|
92
|
-
.argument('[name]', 'Container name (shows all if omitted)')
|
|
93
|
-
.option('--json', 'Output as JSON')
|
|
94
|
-
.option('--running', 'Only show running containers')
|
|
95
|
-
.action(
|
|
96
|
-
async (
|
|
97
|
-
name: string | undefined,
|
|
98
|
-
options: { json?: boolean; running?: boolean },
|
|
99
|
-
) => {
|
|
100
|
-
try {
|
|
101
|
-
let containers: ContainerConfig[]
|
|
102
|
-
|
|
103
|
-
if (name) {
|
|
104
|
-
const config = await containerManager.getConfig(name)
|
|
105
|
-
if (!config) {
|
|
106
|
-
if (options.json) {
|
|
107
|
-
console.log(
|
|
108
|
-
JSON.stringify({ error: `Container "${name}" not found` }),
|
|
109
|
-
)
|
|
110
|
-
} else {
|
|
111
|
-
console.error(uiError(`Container "${name}" not found`))
|
|
112
|
-
}
|
|
113
|
-
process.exit(1)
|
|
114
|
-
}
|
|
115
|
-
containers = [config]
|
|
116
|
-
} else {
|
|
117
|
-
containers = await containerManager.list()
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Gather port info for all containers
|
|
121
|
-
const results = await Promise.all(
|
|
122
|
-
containers.map(async (config) => {
|
|
123
|
-
const { status, ports } = await getContainerPorts(config)
|
|
124
|
-
return { config, status, ports }
|
|
125
|
-
}),
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
// Filter to running only if requested
|
|
129
|
-
const filtered = options.running
|
|
130
|
-
? results.filter((r) => r.status === 'running')
|
|
131
|
-
: results
|
|
132
|
-
|
|
133
|
-
if (options.json) {
|
|
134
|
-
const jsonOutput = filtered.map((r) => ({
|
|
135
|
-
name: r.config.name,
|
|
136
|
-
engine: r.config.engine,
|
|
137
|
-
status: r.status,
|
|
138
|
-
ports: r.ports,
|
|
139
|
-
}))
|
|
140
|
-
console.log(JSON.stringify(jsonOutput, null, 2))
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (filtered.length === 0) {
|
|
145
|
-
console.log(
|
|
146
|
-
uiInfo(
|
|
147
|
-
options.running
|
|
148
|
-
? 'No running containers found.'
|
|
149
|
-
: 'No containers found. Create one with: spindb create',
|
|
150
|
-
),
|
|
151
|
-
)
|
|
152
|
-
return
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
console.log()
|
|
156
|
-
console.log(
|
|
157
|
-
chalk.gray(' ') +
|
|
158
|
-
chalk.bold.white('NAME'.padEnd(22)) +
|
|
159
|
-
chalk.bold.white('ENGINE'.padEnd(18)) +
|
|
160
|
-
chalk.bold.white('STATUS'.padEnd(12)) +
|
|
161
|
-
chalk.bold.white('PORT(S)'),
|
|
162
|
-
)
|
|
163
|
-
console.log(chalk.gray(' ' + '─'.repeat(78)))
|
|
164
|
-
|
|
165
|
-
for (const { config, status, ports } of filtered) {
|
|
166
|
-
const engineIcon = getEngineIcon(config.engine)
|
|
167
|
-
const engineName = config.engine.padEnd(13)
|
|
168
|
-
|
|
169
|
-
const statusDisplay =
|
|
170
|
-
status === 'running'
|
|
171
|
-
? chalk.green('● running'.padEnd(12))
|
|
172
|
-
: status === 'available'
|
|
173
|
-
? chalk.blue('● available'.padEnd(12))
|
|
174
|
-
: status === 'missing'
|
|
175
|
-
? chalk.gray('○ missing'.padEnd(12))
|
|
176
|
-
: chalk.gray('○ stopped'.padEnd(12))
|
|
177
|
-
|
|
178
|
-
let portDisplay: string
|
|
179
|
-
if (ports.length === 0) {
|
|
180
|
-
portDisplay = chalk.gray('—')
|
|
181
|
-
} else {
|
|
182
|
-
const parts = ports.map((p, i) =>
|
|
183
|
-
i === 0
|
|
184
|
-
? String(p.port)
|
|
185
|
-
: `${p.port} ${chalk.gray(`(${p.label})`)}`,
|
|
186
|
-
)
|
|
187
|
-
portDisplay = parts.join(chalk.gray(', '))
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
console.log(
|
|
191
|
-
chalk.gray(' ') +
|
|
192
|
-
chalk.cyan(config.name.padEnd(22)) +
|
|
193
|
-
engineIcon +
|
|
194
|
-
chalk.white(engineName) +
|
|
195
|
-
statusDisplay +
|
|
196
|
-
portDisplay,
|
|
197
|
-
)
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
console.log()
|
|
201
|
-
} catch (error) {
|
|
202
|
-
const e = error as Error
|
|
203
|
-
if (options.json) {
|
|
204
|
-
console.log(JSON.stringify({ error: e.message }))
|
|
205
|
-
} else {
|
|
206
|
-
console.error(uiError(e.message))
|
|
207
|
-
}
|
|
208
|
-
process.exit(1)
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
)
|
package/cli/commands/pull.ts
DELETED
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pull Command
|
|
3
|
-
*
|
|
4
|
-
* Pulls remote database data into a local container, with optional backup
|
|
5
|
-
* of the original local data.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* spindb pull <container> --from <url> # Replace mode
|
|
9
|
-
* spindb pull <container> --from <url> --as <name> # Clone mode
|
|
10
|
-
* spindb pull <container> --from <url> --no-backup -f # Replace without backup
|
|
11
|
-
* spindb pull <container> --from <url> --dry-run # Preview changes
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { Command } from 'commander'
|
|
15
|
-
import chalk from 'chalk'
|
|
16
|
-
import { pullManager } from '../../core/pull-manager'
|
|
17
|
-
import { containerManager } from '../../core/container-manager'
|
|
18
|
-
import { createSpinner } from '../ui/spinner'
|
|
19
|
-
import { promptConfirm } from '../ui/prompts'
|
|
20
|
-
import { uiError } from '../ui/theme'
|
|
21
|
-
|
|
22
|
-
export const pullCommand = new Command('pull')
|
|
23
|
-
.description('Pull remote database data into local container')
|
|
24
|
-
.argument('<container>', 'Container name')
|
|
25
|
-
.option('--from <url>', 'Remote database connection string')
|
|
26
|
-
.option('--from-env <name>', 'Read remote URL from environment variable')
|
|
27
|
-
.option('-d, --database <name>', 'Target database (default: primary)')
|
|
28
|
-
.option('--as <name>', 'Clone to new database instead of replacing')
|
|
29
|
-
.option('--no-backup', 'Skip backup when replacing (dangerous)')
|
|
30
|
-
.option('--post-script <path>', 'Run script after pull completes')
|
|
31
|
-
.option('--dry-run', 'Preview changes without executing')
|
|
32
|
-
.option('-f, --force', 'Skip confirmation prompts')
|
|
33
|
-
.option('-j, --json', 'Output as JSON')
|
|
34
|
-
.action(
|
|
35
|
-
async (
|
|
36
|
-
container: string,
|
|
37
|
-
options: {
|
|
38
|
-
from?: string
|
|
39
|
-
fromEnv?: string
|
|
40
|
-
database?: string
|
|
41
|
-
as?: string
|
|
42
|
-
backup: boolean // Commander inverts --no-backup to backup: false
|
|
43
|
-
postScript?: string
|
|
44
|
-
dryRun?: boolean
|
|
45
|
-
force?: boolean
|
|
46
|
-
json?: boolean
|
|
47
|
-
},
|
|
48
|
-
) => {
|
|
49
|
-
try {
|
|
50
|
-
// Resolve remote URL from --from or --from-env
|
|
51
|
-
let fromUrl = options.from
|
|
52
|
-
if (options.fromEnv) {
|
|
53
|
-
fromUrl = process.env[options.fromEnv]
|
|
54
|
-
if (!fromUrl) {
|
|
55
|
-
const errorMsg = `Environment variable "${options.fromEnv}" is not set or empty`
|
|
56
|
-
if (options.json) {
|
|
57
|
-
console.log(JSON.stringify({ error: errorMsg }))
|
|
58
|
-
} else {
|
|
59
|
-
console.error(uiError(errorMsg))
|
|
60
|
-
}
|
|
61
|
-
process.exit(1)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Must specify either --from or --from-env
|
|
66
|
-
if (!fromUrl) {
|
|
67
|
-
const errorMsg =
|
|
68
|
-
'Must specify either --from <url> or --from-env <name>'
|
|
69
|
-
if (options.json) {
|
|
70
|
-
console.log(JSON.stringify({ error: errorMsg }))
|
|
71
|
-
} else {
|
|
72
|
-
console.error(uiError(errorMsg))
|
|
73
|
-
console.log(
|
|
74
|
-
chalk.dim(' Usage: spindb pull <container> --from <url>'),
|
|
75
|
-
)
|
|
76
|
-
console.log(
|
|
77
|
-
chalk.dim(
|
|
78
|
-
' spindb pull <container> --from-env CLONE_FROM_DATABASE_URL',
|
|
79
|
-
),
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
process.exit(1)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Validate container exists
|
|
86
|
-
const config = await containerManager.getConfig(container)
|
|
87
|
-
if (!config) {
|
|
88
|
-
if (options.json) {
|
|
89
|
-
console.log(
|
|
90
|
-
JSON.stringify({ error: `Container "${container}" not found` }),
|
|
91
|
-
)
|
|
92
|
-
} else {
|
|
93
|
-
console.error(uiError(`Container "${container}" not found`))
|
|
94
|
-
}
|
|
95
|
-
process.exit(1)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Validate dangerous combinations
|
|
99
|
-
if (
|
|
100
|
-
!options.backup &&
|
|
101
|
-
!options.force &&
|
|
102
|
-
!options.dryRun &&
|
|
103
|
-
!options.as
|
|
104
|
-
) {
|
|
105
|
-
if (options.json) {
|
|
106
|
-
console.log(
|
|
107
|
-
JSON.stringify({
|
|
108
|
-
error:
|
|
109
|
-
'Cannot use --no-backup without --force. Use --force to confirm.',
|
|
110
|
-
}),
|
|
111
|
-
)
|
|
112
|
-
process.exit(1)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const confirmed = await promptConfirm(
|
|
116
|
-
'This will overwrite your database WITHOUT creating a backup. Continue?',
|
|
117
|
-
false,
|
|
118
|
-
)
|
|
119
|
-
if (!confirmed) {
|
|
120
|
-
console.log(chalk.gray('Aborted.'))
|
|
121
|
-
process.exit(0)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const spinner =
|
|
126
|
-
options.json || options.dryRun
|
|
127
|
-
? null
|
|
128
|
-
: createSpinner('Pulling remote data...')
|
|
129
|
-
|
|
130
|
-
spinner?.start()
|
|
131
|
-
|
|
132
|
-
// Show progress updates
|
|
133
|
-
const updateSpinner = (message: string) => {
|
|
134
|
-
if (spinner) {
|
|
135
|
-
spinner.text = message
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (!options.json && !options.dryRun) {
|
|
140
|
-
updateSpinner('Validating container...')
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const result = await pullManager.pull(container, {
|
|
144
|
-
database: options.database,
|
|
145
|
-
fromUrl: fromUrl,
|
|
146
|
-
asDatabase: options.as,
|
|
147
|
-
noBackup: !options.backup,
|
|
148
|
-
postScript: options.postScript,
|
|
149
|
-
dryRun: options.dryRun,
|
|
150
|
-
force: options.force,
|
|
151
|
-
json: options.json,
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
spinner?.succeed(result.message)
|
|
155
|
-
|
|
156
|
-
if (options.json) {
|
|
157
|
-
console.log(JSON.stringify(result))
|
|
158
|
-
} else if (!options.dryRun) {
|
|
159
|
-
console.log('')
|
|
160
|
-
console.log(chalk.green('Pull complete!'))
|
|
161
|
-
console.log('')
|
|
162
|
-
console.log(` ${chalk.dim('Mode:')} ${result.mode}`)
|
|
163
|
-
console.log(
|
|
164
|
-
` ${chalk.dim('Database:')} ${chalk.cyan(result.database)}`,
|
|
165
|
-
)
|
|
166
|
-
if (result.backupDatabase) {
|
|
167
|
-
console.log(
|
|
168
|
-
` ${chalk.dim('Backup:')} ${chalk.cyan(result.backupDatabase)}`,
|
|
169
|
-
)
|
|
170
|
-
}
|
|
171
|
-
console.log(
|
|
172
|
-
` ${chalk.dim('Source:')} ${chalk.gray(result.source)}`,
|
|
173
|
-
)
|
|
174
|
-
console.log('')
|
|
175
|
-
|
|
176
|
-
if (result.mode === 'replace') {
|
|
177
|
-
console.log(chalk.dim('Your connection string is unchanged:'))
|
|
178
|
-
console.log(chalk.white(` ${result.databaseUrl}`))
|
|
179
|
-
} else {
|
|
180
|
-
console.log(
|
|
181
|
-
chalk.yellow('Update your .env to use the new database:'),
|
|
182
|
-
)
|
|
183
|
-
console.log(chalk.white(` DATABASE_URL=${result.databaseUrl}`))
|
|
184
|
-
}
|
|
185
|
-
console.log('')
|
|
186
|
-
console.log(
|
|
187
|
-
chalk.bgYellow.black(
|
|
188
|
-
' Restart your dev server to use the new data. ',
|
|
189
|
-
),
|
|
190
|
-
)
|
|
191
|
-
console.log('')
|
|
192
|
-
} else {
|
|
193
|
-
// Dry run output
|
|
194
|
-
console.log('')
|
|
195
|
-
console.log(chalk.yellow('DRY RUN - No changes made'))
|
|
196
|
-
console.log('')
|
|
197
|
-
console.log('Would perform:')
|
|
198
|
-
console.log(` ${chalk.dim('Mode:')} ${result.mode}`)
|
|
199
|
-
console.log(
|
|
200
|
-
` ${chalk.dim('Database:')} ${chalk.cyan(result.database)}`,
|
|
201
|
-
)
|
|
202
|
-
if (result.backupDatabase) {
|
|
203
|
-
console.log(
|
|
204
|
-
` ${chalk.dim('Backup:')} ${chalk.cyan(result.backupDatabase)}`,
|
|
205
|
-
)
|
|
206
|
-
}
|
|
207
|
-
console.log(
|
|
208
|
-
` ${chalk.dim('Source:')} ${chalk.gray(result.source)}`,
|
|
209
|
-
)
|
|
210
|
-
console.log('')
|
|
211
|
-
}
|
|
212
|
-
} catch (error) {
|
|
213
|
-
const e = error as Error
|
|
214
|
-
|
|
215
|
-
if (options.json) {
|
|
216
|
-
console.log(JSON.stringify({ error: e.message }))
|
|
217
|
-
} else {
|
|
218
|
-
console.error(uiError(e.message))
|
|
219
|
-
}
|
|
220
|
-
process.exit(1)
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
)
|
package/cli/commands/query.ts
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander'
|
|
2
|
-
import { existsSync } from 'fs'
|
|
3
|
-
import chalk from 'chalk'
|
|
4
|
-
import { containerManager } from '../../core/container-manager'
|
|
5
|
-
import { processManager } from '../../core/process-manager'
|
|
6
|
-
import { getEngine } from '../../engines'
|
|
7
|
-
import { promptInstallDependencies } from '../ui/prompts'
|
|
8
|
-
import { uiError, uiWarning } from '../ui/theme'
|
|
9
|
-
import { getMissingDependencies } from '../../core/dependency-manager'
|
|
10
|
-
import { Engine, isFileBasedEngine, type QueryResult } from '../../types'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Format a QueryResult as a table for terminal output
|
|
14
|
-
*/
|
|
15
|
-
function formatTable(result: QueryResult): string {
|
|
16
|
-
if (result.columns.length === 0 || result.rows.length === 0) {
|
|
17
|
-
return '(0 rows)'
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Calculate column widths
|
|
21
|
-
const widths: number[] = result.columns.map((col) => col.length)
|
|
22
|
-
|
|
23
|
-
for (const row of result.rows) {
|
|
24
|
-
for (let i = 0; i < result.columns.length; i++) {
|
|
25
|
-
const col = result.columns[i]
|
|
26
|
-
const value = formatValue(row[col])
|
|
27
|
-
widths[i] = Math.max(widths[i], value.length)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Build header
|
|
32
|
-
const header = result.columns
|
|
33
|
-
.map((col, i) => col.padEnd(widths[i]))
|
|
34
|
-
.join(' | ')
|
|
35
|
-
|
|
36
|
-
// Build separator
|
|
37
|
-
const separator = widths.map((w) => '-'.repeat(w)).join('-+-')
|
|
38
|
-
|
|
39
|
-
// Build rows
|
|
40
|
-
const rows = result.rows.map((row) =>
|
|
41
|
-
result.columns
|
|
42
|
-
.map((col, i) => formatValue(row[col]).padEnd(widths[i]))
|
|
43
|
-
.join(' | '),
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
// Combine
|
|
47
|
-
const lines = [header, separator, ...rows]
|
|
48
|
-
|
|
49
|
-
// Add row count
|
|
50
|
-
const countMsg =
|
|
51
|
-
result.rowCount === 1 ? '(1 row)' : `(${result.rowCount} rows)`
|
|
52
|
-
lines.push('')
|
|
53
|
-
lines.push(countMsg)
|
|
54
|
-
|
|
55
|
-
return lines.join('\n')
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Format a value for display
|
|
60
|
-
*/
|
|
61
|
-
function formatValue(value: unknown): string {
|
|
62
|
-
if (value === null || value === undefined) {
|
|
63
|
-
return 'NULL'
|
|
64
|
-
}
|
|
65
|
-
if (typeof value === 'object') {
|
|
66
|
-
return JSON.stringify(value)
|
|
67
|
-
}
|
|
68
|
-
return String(value)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export const queryCommand = new Command('query')
|
|
72
|
-
.description('Execute a query and return results')
|
|
73
|
-
.argument('<name>', 'Container name')
|
|
74
|
-
.argument('<query>', 'Query to execute')
|
|
75
|
-
.option('-d, --database <name>', 'Target database (defaults to primary)')
|
|
76
|
-
.option('--json', 'Output results as JSON')
|
|
77
|
-
.action(
|
|
78
|
-
async (
|
|
79
|
-
name: string,
|
|
80
|
-
query: string,
|
|
81
|
-
options: { database?: string; json?: boolean },
|
|
82
|
-
) => {
|
|
83
|
-
try {
|
|
84
|
-
const containerName = name
|
|
85
|
-
|
|
86
|
-
const config = await containerManager.getConfig(containerName)
|
|
87
|
-
if (!config) {
|
|
88
|
-
if (options.json) {
|
|
89
|
-
console.log(
|
|
90
|
-
JSON.stringify({
|
|
91
|
-
error: `Container "${containerName}" not found`,
|
|
92
|
-
}),
|
|
93
|
-
)
|
|
94
|
-
} else {
|
|
95
|
-
console.error(uiError(`Container "${containerName}" not found`))
|
|
96
|
-
}
|
|
97
|
-
process.exit(1)
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
const { engine: engineName } = config
|
|
101
|
-
|
|
102
|
-
// File-based databases: check file exists instead of running status
|
|
103
|
-
if (isFileBasedEngine(engineName)) {
|
|
104
|
-
if (!existsSync(config.database)) {
|
|
105
|
-
if (options.json) {
|
|
106
|
-
console.log(
|
|
107
|
-
JSON.stringify({
|
|
108
|
-
error: `Database file not found: ${config.database}`,
|
|
109
|
-
}),
|
|
110
|
-
)
|
|
111
|
-
} else {
|
|
112
|
-
console.error(
|
|
113
|
-
uiError(`Database file not found: ${config.database}`),
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
process.exit(1)
|
|
117
|
-
}
|
|
118
|
-
} else {
|
|
119
|
-
// Server databases need to be running
|
|
120
|
-
const running = await processManager.isRunning(containerName, {
|
|
121
|
-
engine: engineName,
|
|
122
|
-
})
|
|
123
|
-
if (!running) {
|
|
124
|
-
if (options.json) {
|
|
125
|
-
console.log(
|
|
126
|
-
JSON.stringify({
|
|
127
|
-
error: `Container "${containerName}" is not running`,
|
|
128
|
-
}),
|
|
129
|
-
)
|
|
130
|
-
} else {
|
|
131
|
-
console.error(
|
|
132
|
-
uiError(
|
|
133
|
-
`Container "${containerName}" is not running. Start it first with: spindb start ${containerName}`,
|
|
134
|
-
),
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
process.exit(1)
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const engine = getEngine(engineName)
|
|
142
|
-
|
|
143
|
-
let missingDeps = await getMissingDependencies(engineName)
|
|
144
|
-
if (missingDeps.length > 0) {
|
|
145
|
-
if (options.json) {
|
|
146
|
-
console.log(
|
|
147
|
-
JSON.stringify({
|
|
148
|
-
error: `Missing tools: ${missingDeps.map((d) => d.name).join(', ')}`,
|
|
149
|
-
}),
|
|
150
|
-
)
|
|
151
|
-
process.exit(1)
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
console.log(
|
|
155
|
-
uiWarning(
|
|
156
|
-
`Missing tools: ${missingDeps.map((d) => d.name).join(', ')}`,
|
|
157
|
-
),
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
// Install all missing dependencies
|
|
161
|
-
for (const dep of missingDeps) {
|
|
162
|
-
const installed = await promptInstallDependencies(
|
|
163
|
-
dep.binary,
|
|
164
|
-
engineName,
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
if (!installed) {
|
|
168
|
-
process.exit(1)
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
missingDeps = await getMissingDependencies(engineName)
|
|
173
|
-
if (missingDeps.length > 0) {
|
|
174
|
-
console.error(
|
|
175
|
-
uiError(
|
|
176
|
-
`Still missing tools: ${missingDeps.map((d) => d.name).join(', ')}`,
|
|
177
|
-
),
|
|
178
|
-
)
|
|
179
|
-
process.exit(1)
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
console.log(chalk.green(' ✓ All required tools are now available'))
|
|
183
|
-
console.log()
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const database = options.database || config.database
|
|
187
|
-
|
|
188
|
-
// Execute the query
|
|
189
|
-
const result = await engine.executeQuery(config, query, { database })
|
|
190
|
-
|
|
191
|
-
// Output results
|
|
192
|
-
if (options.json) {
|
|
193
|
-
// JSON mode: output just the rows array
|
|
194
|
-
console.log(JSON.stringify(result.rows, null, 2))
|
|
195
|
-
} else {
|
|
196
|
-
// Table mode
|
|
197
|
-
console.log(formatTable(result))
|
|
198
|
-
}
|
|
199
|
-
} catch (error) {
|
|
200
|
-
const e = error as Error
|
|
201
|
-
|
|
202
|
-
// Map of tool patterns to their engines
|
|
203
|
-
const toolPatternToEngine: Record<string, Engine> = {
|
|
204
|
-
'psql not found': Engine.PostgreSQL,
|
|
205
|
-
'mysql not found': Engine.MySQL,
|
|
206
|
-
'mysql client not found': Engine.MySQL,
|
|
207
|
-
'redis-cli not found': Engine.Redis,
|
|
208
|
-
'mongosh not found': Engine.MongoDB,
|
|
209
|
-
'sqlite3 not found': Engine.SQLite,
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
const matchingPattern = Object.keys(toolPatternToEngine).find((p) =>
|
|
213
|
-
e.message.toLowerCase().includes(p.toLowerCase()),
|
|
214
|
-
)
|
|
215
|
-
|
|
216
|
-
if (matchingPattern && !options.json) {
|
|
217
|
-
const missingTool = matchingPattern
|
|
218
|
-
.replace(' not found', '')
|
|
219
|
-
.replace(' client', '')
|
|
220
|
-
const toolEngine = toolPatternToEngine[matchingPattern]
|
|
221
|
-
const installed = await promptInstallDependencies(
|
|
222
|
-
missingTool,
|
|
223
|
-
toolEngine,
|
|
224
|
-
)
|
|
225
|
-
if (installed) {
|
|
226
|
-
console.log(
|
|
227
|
-
chalk.yellow(' Please re-run your command to continue.'),
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
process.exit(1)
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
if (options.json) {
|
|
234
|
-
console.log(JSON.stringify({ error: e.message }))
|
|
235
|
-
} else {
|
|
236
|
-
console.error(uiError(e.message))
|
|
237
|
-
}
|
|
238
|
-
process.exit(1)
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
)
|