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
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TigerBeetle restore module
|
|
3
|
-
* Supports restoring from a TigerBeetle data file backup.
|
|
4
|
-
*
|
|
5
|
-
* Restore copies the backup data file into the container's data directory.
|
|
6
|
-
* The server must be stopped before restore.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { copyFile, mkdir, stat } from 'fs/promises'
|
|
10
|
-
import { existsSync } from 'fs'
|
|
11
|
-
import { join } from 'path'
|
|
12
|
-
import { logDebug } from '../../core/error-handler'
|
|
13
|
-
import type { BackupFormat, RestoreResult } from '../../types'
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Detect backup format from a file path.
|
|
17
|
-
* TigerBeetle backups are single binary data files.
|
|
18
|
-
*/
|
|
19
|
-
export async function detectBackupFormat(
|
|
20
|
-
filePath: string,
|
|
21
|
-
): Promise<BackupFormat> {
|
|
22
|
-
if (!existsSync(filePath)) {
|
|
23
|
-
throw new Error(`Backup file not found: ${filePath}`)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const stats = await stat(filePath)
|
|
27
|
-
|
|
28
|
-
// TigerBeetle data files are regular files (not directories)
|
|
29
|
-
if (stats.isFile()) {
|
|
30
|
-
if (filePath.endsWith('.tigerbeetle')) {
|
|
31
|
-
return {
|
|
32
|
-
format: 'binary',
|
|
33
|
-
description: 'TigerBeetle data file',
|
|
34
|
-
restoreCommand: 'Copy to data directory (spindb restore handles this)',
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Check for common backup naming patterns
|
|
39
|
-
return {
|
|
40
|
-
format: 'binary',
|
|
41
|
-
description: 'TigerBeetle data file (assumed from file)',
|
|
42
|
-
restoreCommand: 'Copy to data directory (spindb restore handles this)',
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
format: 'unknown',
|
|
48
|
-
description: 'Unknown backup format',
|
|
49
|
-
restoreCommand: 'Use a TigerBeetle data file (.tigerbeetle) for restore',
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Restore options for TigerBeetle
|
|
54
|
-
export type RestoreOptions = {
|
|
55
|
-
containerName: string
|
|
56
|
-
dataDir: string
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Restore from a TigerBeetle data file backup.
|
|
61
|
-
* Copies the backup file into the container's data directory.
|
|
62
|
-
*/
|
|
63
|
-
export async function restoreBackup(
|
|
64
|
-
backupPath: string,
|
|
65
|
-
options: RestoreOptions,
|
|
66
|
-
): Promise<RestoreResult> {
|
|
67
|
-
const { dataDir } = options
|
|
68
|
-
|
|
69
|
-
if (!existsSync(backupPath)) {
|
|
70
|
-
throw new Error(`Backup not found: ${backupPath}`)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const format = await detectBackupFormat(backupPath)
|
|
74
|
-
logDebug(`Detected backup format: ${format.format}`)
|
|
75
|
-
|
|
76
|
-
// Ensure data directory exists
|
|
77
|
-
if (!existsSync(dataDir)) {
|
|
78
|
-
await mkdir(dataDir, { recursive: true })
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const targetPath = join(dataDir, '0_0.tigerbeetle')
|
|
82
|
-
|
|
83
|
-
logDebug(`Restoring TigerBeetle data file to: ${targetPath}`)
|
|
84
|
-
await copyFile(backupPath, targetPath)
|
|
85
|
-
|
|
86
|
-
return {
|
|
87
|
-
format: 'binary',
|
|
88
|
-
stdout: `Restored TigerBeetle data file to ${targetPath}`,
|
|
89
|
-
code: 0,
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Parse TigerBeetle connection string
|
|
95
|
-
* Format: host:port or 127.0.0.1:port
|
|
96
|
-
*
|
|
97
|
-
* TigerBeetle uses a custom binary protocol (no URI scheme).
|
|
98
|
-
*/
|
|
99
|
-
export function parseConnectionString(connectionString: string): {
|
|
100
|
-
host: string
|
|
101
|
-
port: number
|
|
102
|
-
} {
|
|
103
|
-
if (!connectionString || typeof connectionString !== 'string') {
|
|
104
|
-
throw new Error(
|
|
105
|
-
'Invalid TigerBeetle connection string: expected a non-empty string',
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const trimmed = connectionString.trim()
|
|
110
|
-
|
|
111
|
-
// Parse host:port format
|
|
112
|
-
const parts = trimmed.split(':')
|
|
113
|
-
if (parts.length !== 2) {
|
|
114
|
-
throw new Error(
|
|
115
|
-
`Invalid TigerBeetle connection string: "${trimmed}". ` +
|
|
116
|
-
'Expected format: host:port (e.g., 127.0.0.1:3000)',
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
const host = parts[0] || '127.0.0.1'
|
|
121
|
-
const port = parseInt(parts[1], 10)
|
|
122
|
-
|
|
123
|
-
if (isNaN(port) || port <= 0 || port > 65535) {
|
|
124
|
-
throw new Error(
|
|
125
|
-
`Invalid TigerBeetle port: "${parts[1]}". Expected a number between 1 and 65535.`,
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return { host, port }
|
|
130
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TigerBeetle version validation utilities
|
|
3
|
-
* Handles version parsing, comparison, and compatibility checking
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Parse a TigerBeetle version string into components
|
|
8
|
-
* Handles formats like "0.16.70", "0.16", "v0.16.70"
|
|
9
|
-
*/
|
|
10
|
-
export function parseVersion(versionString: string): {
|
|
11
|
-
major: number
|
|
12
|
-
minor: number
|
|
13
|
-
patch: number
|
|
14
|
-
raw: string
|
|
15
|
-
} | null {
|
|
16
|
-
const cleaned = versionString.replace(/^v/, '').trim()
|
|
17
|
-
if (!cleaned) return null
|
|
18
|
-
|
|
19
|
-
const parts = cleaned.split('.')
|
|
20
|
-
|
|
21
|
-
const major = parseInt(parts[0], 10)
|
|
22
|
-
const minor = parts[1] ? parseInt(parts[1], 10) : 0
|
|
23
|
-
const patch = parts[2] ? parseInt(parts[2], 10) : 0
|
|
24
|
-
|
|
25
|
-
if (isNaN(major)) return null
|
|
26
|
-
if (parts[1] && isNaN(minor)) return null
|
|
27
|
-
if (parts[2] && isNaN(patch)) return null
|
|
28
|
-
|
|
29
|
-
return { major, minor, patch, raw: cleaned }
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Check if a TigerBeetle version is supported by SpinDB
|
|
34
|
-
* Minimum supported version: 0.16.0
|
|
35
|
-
*/
|
|
36
|
-
export function isVersionSupported(version: string): boolean {
|
|
37
|
-
const parsed = parseVersion(version)
|
|
38
|
-
if (!parsed) return false
|
|
39
|
-
|
|
40
|
-
// Support 0.16+
|
|
41
|
-
if (parsed.major === 0) {
|
|
42
|
-
return parsed.minor >= 16
|
|
43
|
-
}
|
|
44
|
-
return parsed.major >= 1
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Get major version from full version string (xy-format: 2-part)
|
|
49
|
-
* e.g., "0.16.70" -> "0.16"
|
|
50
|
-
*/
|
|
51
|
-
export function getMajorVersion(version: string): string {
|
|
52
|
-
const parsed = parseVersion(version)
|
|
53
|
-
if (!parsed) return version
|
|
54
|
-
return `${parsed.major}.${parsed.minor}`
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Get major.minor version from full version string.
|
|
59
|
-
* Intentional alias for getMajorVersion — both return the 2-part xy-format
|
|
60
|
-
* version (e.g., "0.16"). Kept as a separate export for API consistency
|
|
61
|
-
* with other engine version validators.
|
|
62
|
-
*/
|
|
63
|
-
export function getMajorMinorVersion(version: string): string {
|
|
64
|
-
return getMajorVersion(version)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Compare two TigerBeetle versions
|
|
69
|
-
* Returns: -1 if a < b, 0 if a == b, 1 if a > b, null if either version cannot be parsed
|
|
70
|
-
*/
|
|
71
|
-
export function compareVersions(a: string, b: string): number | null {
|
|
72
|
-
const parsedA = parseVersion(a)
|
|
73
|
-
const parsedB = parseVersion(b)
|
|
74
|
-
|
|
75
|
-
if (!parsedA || !parsedB) {
|
|
76
|
-
return null
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (parsedA.major !== parsedB.major) {
|
|
80
|
-
return parsedA.major < parsedB.major ? -1 : 1
|
|
81
|
-
}
|
|
82
|
-
if (parsedA.minor !== parsedB.minor) {
|
|
83
|
-
return parsedA.minor < parsedB.minor ? -1 : 1
|
|
84
|
-
}
|
|
85
|
-
if (parsedA.patch !== parsedB.patch) {
|
|
86
|
-
return parsedA.patch < parsedB.patch ? -1 : 1
|
|
87
|
-
}
|
|
88
|
-
return 0
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Check if a backup version is compatible with the restore version
|
|
93
|
-
* TigerBeetle data files are generally compatible within minor versions
|
|
94
|
-
*/
|
|
95
|
-
export function isVersionCompatible(
|
|
96
|
-
backupVersion: string,
|
|
97
|
-
restoreVersion: string,
|
|
98
|
-
): { compatible: boolean; warning?: string } {
|
|
99
|
-
const backup = parseVersion(backupVersion)
|
|
100
|
-
const restore = parseVersion(restoreVersion)
|
|
101
|
-
|
|
102
|
-
if (!backup || !restore) {
|
|
103
|
-
return {
|
|
104
|
-
compatible: true,
|
|
105
|
-
warning: 'Could not parse versions, proceeding with restore',
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Must be same major.minor for TigerBeetle
|
|
110
|
-
if (backup.major !== restore.major || backup.minor !== restore.minor) {
|
|
111
|
-
return {
|
|
112
|
-
compatible: false,
|
|
113
|
-
warning: `Cannot restore TigerBeetle ${backupVersion} data to ${restoreVersion} server. Major.minor versions must match.`,
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return { compatible: true }
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Validate that a version string matches supported format
|
|
122
|
-
*/
|
|
123
|
-
export function isValidVersionFormat(version: string): boolean {
|
|
124
|
-
const parsed = parseVersion(version)
|
|
125
|
-
return parsed !== null
|
|
126
|
-
}
|
package/engines/typedb/backup.ts
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeDB backup module
|
|
3
|
-
*
|
|
4
|
-
* TypeDB exports databases as two files: schema (.typeql) and data (.typeql).
|
|
5
|
-
* We use the console's `database export` command which creates both files.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { spawn } from 'child_process'
|
|
9
|
-
import { mkdir } from 'fs/promises'
|
|
10
|
-
import { stat } from 'fs/promises'
|
|
11
|
-
import { dirname } from 'path'
|
|
12
|
-
import { logDebug } from '../../core/error-handler'
|
|
13
|
-
import { requireTypeDBConsolePath, getConsoleBaseArgs } from './cli-utils'
|
|
14
|
-
import type { ContainerConfig, BackupOptions, BackupResult } from '../../types'
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Create a TypeQL backup using typedb console export
|
|
18
|
-
*
|
|
19
|
-
* TypeDB export creates two files derived from outputPath:
|
|
20
|
-
* - {base}-schema.typeql (schema definitions)
|
|
21
|
-
* - {base}-data.typeql (data inserts)
|
|
22
|
-
*
|
|
23
|
-
* The returned BackupResult.path is the original outputPath (base path),
|
|
24
|
-
* NOT a single backup file. Callers (e.g., restore) must derive the actual
|
|
25
|
-
* file paths using the same `-schema.typeql` / `-data.typeql` convention.
|
|
26
|
-
* See also: restore.ts restoreTypeQLBackup() which mirrors this derivation.
|
|
27
|
-
*/
|
|
28
|
-
async function createTypeQLBackup(
|
|
29
|
-
container: ContainerConfig,
|
|
30
|
-
outputPath: string,
|
|
31
|
-
database: string,
|
|
32
|
-
): Promise<BackupResult> {
|
|
33
|
-
const consolePath = await requireTypeDBConsolePath(container.version)
|
|
34
|
-
const { port } = container
|
|
35
|
-
|
|
36
|
-
// Ensure output directory exists
|
|
37
|
-
await mkdir(dirname(outputPath), { recursive: true })
|
|
38
|
-
|
|
39
|
-
// Derive schema and data paths from output path
|
|
40
|
-
const schemaPath = outputPath.endsWith('.typeql')
|
|
41
|
-
? outputPath.replace(/\.typeql$/, '-schema.typeql')
|
|
42
|
-
: outputPath + '-schema.typeql'
|
|
43
|
-
const dataPath = outputPath.endsWith('.typeql')
|
|
44
|
-
? outputPath.replace(/\.typeql$/, '-data.typeql')
|
|
45
|
-
: outputPath + '-data.typeql'
|
|
46
|
-
|
|
47
|
-
const args = [
|
|
48
|
-
...getConsoleBaseArgs(port),
|
|
49
|
-
'--command',
|
|
50
|
-
`database export ${database} ${schemaPath} ${dataPath}`,
|
|
51
|
-
]
|
|
52
|
-
|
|
53
|
-
const sanitizedArgs = args.map((a, i) =>
|
|
54
|
-
args[i - 1] === '--password' ? '***' : a,
|
|
55
|
-
)
|
|
56
|
-
logDebug(`Running: typedb_console_bin ${sanitizedArgs.join(' ')}`)
|
|
57
|
-
|
|
58
|
-
return new Promise<BackupResult>((resolve, reject) => {
|
|
59
|
-
const proc = spawn(consolePath, args, {
|
|
60
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
let stdout = ''
|
|
64
|
-
let stderr = ''
|
|
65
|
-
|
|
66
|
-
proc.stdout.on('data', (data: Buffer) => {
|
|
67
|
-
stdout += data.toString()
|
|
68
|
-
})
|
|
69
|
-
proc.stderr.on('data', (data: Buffer) => {
|
|
70
|
-
stderr += data.toString()
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
proc.on('error', reject)
|
|
74
|
-
|
|
75
|
-
proc.on('close', async (code) => {
|
|
76
|
-
if (code === 0) {
|
|
77
|
-
try {
|
|
78
|
-
// Calculate total size of both files (schema + data)
|
|
79
|
-
let schemaSize: number | null = null
|
|
80
|
-
let dataSize: number | null = null
|
|
81
|
-
const errors: string[] = []
|
|
82
|
-
try {
|
|
83
|
-
const schemaStats = await stat(schemaPath)
|
|
84
|
-
schemaSize = schemaStats.size
|
|
85
|
-
} catch (err) {
|
|
86
|
-
errors.push(`schema(${schemaPath}): ${err}`)
|
|
87
|
-
}
|
|
88
|
-
try {
|
|
89
|
-
const dataStats = await stat(dataPath)
|
|
90
|
-
dataSize = dataStats.size
|
|
91
|
-
} catch (err) {
|
|
92
|
-
errors.push(`data(${dataPath}): ${err}`)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
errors.length > 0 ||
|
|
97
|
-
schemaSize === null ||
|
|
98
|
-
dataSize === null ||
|
|
99
|
-
schemaSize === 0 ||
|
|
100
|
-
dataSize === 0
|
|
101
|
-
) {
|
|
102
|
-
reject(
|
|
103
|
-
new Error(
|
|
104
|
-
`Backup produced empty or missing files: schema=${schemaPath}, data=${dataPath}` +
|
|
105
|
-
(errors.length > 0
|
|
106
|
-
? `. Stat errors: ${errors.join('; ')}`
|
|
107
|
-
: ''),
|
|
108
|
-
),
|
|
109
|
-
)
|
|
110
|
-
return
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// path is the base outputPath; actual files are schemaPath and dataPath
|
|
114
|
-
resolve({
|
|
115
|
-
path: outputPath,
|
|
116
|
-
format: 'typeql',
|
|
117
|
-
size: schemaSize + dataSize,
|
|
118
|
-
})
|
|
119
|
-
} catch (error) {
|
|
120
|
-
reject(new Error(`Backup files not created: ${error}`))
|
|
121
|
-
}
|
|
122
|
-
} else if (code === null) {
|
|
123
|
-
const detail = stderr || stdout
|
|
124
|
-
reject(
|
|
125
|
-
new Error(
|
|
126
|
-
`typedb console export was terminated by signal${detail ? `: ${detail}` : ''}`,
|
|
127
|
-
),
|
|
128
|
-
)
|
|
129
|
-
} else {
|
|
130
|
-
const detail = stderr || stdout
|
|
131
|
-
reject(
|
|
132
|
-
new Error(
|
|
133
|
-
`typedb console export exited with code ${code}${detail ? `: ${detail}` : ''}`,
|
|
134
|
-
),
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
})
|
|
138
|
-
})
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Create a backup
|
|
143
|
-
*
|
|
144
|
-
* @param container - Container configuration
|
|
145
|
-
* @param outputPath - Path to write backup file
|
|
146
|
-
* @param options - Backup options
|
|
147
|
-
*/
|
|
148
|
-
export async function createBackup(
|
|
149
|
-
container: ContainerConfig,
|
|
150
|
-
outputPath: string,
|
|
151
|
-
options: BackupOptions,
|
|
152
|
-
): Promise<BackupResult> {
|
|
153
|
-
const database = options.database || container.database
|
|
154
|
-
|
|
155
|
-
return createTypeQLBackup(container, outputPath, database)
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Create a backup for cloning purposes
|
|
160
|
-
* Uses TypeQL format for reliability
|
|
161
|
-
*/
|
|
162
|
-
export async function createCloneBackup(
|
|
163
|
-
container: ContainerConfig,
|
|
164
|
-
outputPath: string,
|
|
165
|
-
): Promise<BackupResult> {
|
|
166
|
-
return createTypeQLBackup(container, outputPath, container.database)
|
|
167
|
-
}
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeDB Binary Manager
|
|
3
|
-
*
|
|
4
|
-
* Handles downloading, extracting, and managing TypeDB binaries from hostdb.
|
|
5
|
-
* Extends BaseBinaryManager for shared download/extraction logic.
|
|
6
|
-
*
|
|
7
|
-
* TypeDB archives extract to a `typedb/` directory with nested structure:
|
|
8
|
-
* typedb/
|
|
9
|
-
* ├── typedb (launcher script)
|
|
10
|
-
* ├── server/
|
|
11
|
-
* │ ├── typedb_server_bin (server binary)
|
|
12
|
-
* │ └── config.yml (default config)
|
|
13
|
-
* ├── console/
|
|
14
|
-
* │ └── typedb_console_bin (console binary)
|
|
15
|
-
* └── LICENSE
|
|
16
|
-
*
|
|
17
|
-
* We reorganize this preserving the relative structure the launcher expects:
|
|
18
|
-
* bin/
|
|
19
|
-
* ├── typedb (launcher)
|
|
20
|
-
* ├── server/
|
|
21
|
-
* │ └── typedb_server_bin (server binary)
|
|
22
|
-
* ├── console/
|
|
23
|
-
* │ └── typedb_console_bin (console binary)
|
|
24
|
-
* └── config.yml (moved for reference)
|
|
25
|
-
* server/
|
|
26
|
-
* └── config.yml (default config for reference)
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
import { existsSync } from 'fs'
|
|
30
|
-
import { mkdir, readdir } from 'fs/promises'
|
|
31
|
-
import { join } from 'path'
|
|
32
|
-
import {
|
|
33
|
-
BaseBinaryManager,
|
|
34
|
-
type BinaryManagerConfig,
|
|
35
|
-
} from '../../core/base-binary-manager'
|
|
36
|
-
import { moveEntry } from '../../core/fs-error-utils'
|
|
37
|
-
import { logDebug } from '../../core/error-handler'
|
|
38
|
-
import { paths } from '../../config/paths'
|
|
39
|
-
import { getBinaryUrl } from './binary-urls'
|
|
40
|
-
import { normalizeVersion } from './version-maps'
|
|
41
|
-
import { Engine, Platform, type Arch } from '../../types'
|
|
42
|
-
|
|
43
|
-
class TypeDBBinaryManager extends BaseBinaryManager {
|
|
44
|
-
protected readonly config: BinaryManagerConfig = {
|
|
45
|
-
engine: Engine.TypeDB,
|
|
46
|
-
engineName: 'typedb',
|
|
47
|
-
displayName: 'TypeDB',
|
|
48
|
-
serverBinary: 'typedb',
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
protected getBinaryUrlFromModule(
|
|
52
|
-
version: string,
|
|
53
|
-
platform: Platform,
|
|
54
|
-
arch: Arch,
|
|
55
|
-
): string {
|
|
56
|
-
return getBinaryUrl(version, platform, arch)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
protected normalizeVersionFromModule(version: string): string {
|
|
60
|
-
return normalizeVersion(version)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
protected parseVersionFromOutput(stdout: string): string | null {
|
|
64
|
-
// Try standard three-part semver (e.g., "3.8.0")
|
|
65
|
-
const threePartMatch = stdout.match(/(\d+\.\d+\.\d+)/)
|
|
66
|
-
if (threePartMatch) {
|
|
67
|
-
return threePartMatch[1]
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Fallback: two-part version (e.g., "3.8")
|
|
71
|
-
const twoPartMatch = stdout.match(/(\d+\.\d+)/)
|
|
72
|
-
if (twoPartMatch) {
|
|
73
|
-
logDebug(
|
|
74
|
-
`TypeDB version parsed as two-part: ${twoPartMatch[1]} (from: ${stdout.trim().slice(0, 100)})`,
|
|
75
|
-
)
|
|
76
|
-
return twoPartMatch[1]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
logDebug(
|
|
80
|
-
`Could not parse TypeDB version from output: ${stdout.trim().slice(0, 100)}`,
|
|
81
|
-
)
|
|
82
|
-
return null
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Override moveExtractedEntries to handle TypeDB's nested directory structure.
|
|
87
|
-
*
|
|
88
|
-
* TypeDB archives extract to: typedb/server/typedb_server_bin, typedb/console/typedb_console_bin
|
|
89
|
-
* We reorganize to: bin/typedb, bin/server/typedb_server_bin, bin/console/typedb_console_bin
|
|
90
|
-
* And preserve server/config.yml for reference.
|
|
91
|
-
*/
|
|
92
|
-
protected async moveExtractedEntries(
|
|
93
|
-
extractDir: string,
|
|
94
|
-
binPath: string,
|
|
95
|
-
): Promise<void> {
|
|
96
|
-
const entries = await readdir(extractDir, { withFileTypes: true })
|
|
97
|
-
const ext = process.platform === 'win32' ? '.exe' : ''
|
|
98
|
-
const batExt = process.platform === 'win32' ? '.bat' : ''
|
|
99
|
-
|
|
100
|
-
// Find the typedb directory (e.g., "typedb" or "typedb-3.8.0")
|
|
101
|
-
const typedbDir = entries.find(
|
|
102
|
-
(e) =>
|
|
103
|
-
e.isDirectory() &&
|
|
104
|
-
(e.name === 'typedb' || e.name.startsWith('typedb-')),
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
const sourceDir = typedbDir ? join(extractDir, typedbDir.name) : extractDir
|
|
108
|
-
|
|
109
|
-
// Create bin/ directory
|
|
110
|
-
const destBinDir = join(binPath, 'bin')
|
|
111
|
-
await mkdir(destBinDir, { recursive: true })
|
|
112
|
-
|
|
113
|
-
// Move launcher script to bin/
|
|
114
|
-
const launcherName = `typedb${batExt}`
|
|
115
|
-
const launcherPath = join(sourceDir, launcherName)
|
|
116
|
-
if (existsSync(launcherPath)) {
|
|
117
|
-
await moveEntry(launcherPath, join(destBinDir, launcherName))
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// Move server/ directory into bin/ (preserves bin/server/typedb_server_bin path the launcher expects)
|
|
121
|
-
const destServerDir = join(destBinDir, 'server')
|
|
122
|
-
await mkdir(destServerDir, { recursive: true })
|
|
123
|
-
const serverBinName = `typedb_server_bin${ext}`
|
|
124
|
-
const serverBinPath = join(sourceDir, 'server', serverBinName)
|
|
125
|
-
if (existsSync(serverBinPath)) {
|
|
126
|
-
await moveEntry(serverBinPath, join(destServerDir, serverBinName))
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Move console/ directory into bin/ (preserves bin/console/typedb_console_bin path the launcher expects)
|
|
130
|
-
const destConsoleDir = join(destBinDir, 'console')
|
|
131
|
-
await mkdir(destConsoleDir, { recursive: true })
|
|
132
|
-
const consoleBinName = `typedb_console_bin${ext}`
|
|
133
|
-
const consoleBinPath = join(sourceDir, 'console', consoleBinName)
|
|
134
|
-
if (existsSync(consoleBinPath)) {
|
|
135
|
-
await moveEntry(consoleBinPath, join(destConsoleDir, consoleBinName))
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Preserve server/config.yml as reference config
|
|
139
|
-
const configPath = join(sourceDir, 'server', 'config.yml')
|
|
140
|
-
if (existsSync(configPath)) {
|
|
141
|
-
const destRefServerDir = join(binPath, 'server')
|
|
142
|
-
await mkdir(destRefServerDir, { recursive: true })
|
|
143
|
-
await moveEntry(configPath, join(destRefServerDir, 'config.yml'))
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Move LICENSE if present
|
|
147
|
-
const licensePath = join(sourceDir, 'LICENSE')
|
|
148
|
-
if (existsSync(licensePath)) {
|
|
149
|
-
await moveEntry(licensePath, join(binPath, 'LICENSE'))
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
logDebug('TypeDB binaries reorganized to standard bin/ layout')
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Override verify to handle TypeDB's launcher script.
|
|
157
|
-
* TypeDB's main binary is a launcher script, not a direct executable.
|
|
158
|
-
* We verify the actual server binary exists instead of running --version.
|
|
159
|
-
*/
|
|
160
|
-
async verify(
|
|
161
|
-
version: string,
|
|
162
|
-
platform: Platform,
|
|
163
|
-
arch: Arch,
|
|
164
|
-
): Promise<boolean> {
|
|
165
|
-
const fullVersion = this.getFullVersion(version)
|
|
166
|
-
const binPath = paths.getBinaryPath({
|
|
167
|
-
engine: this.config.engineName,
|
|
168
|
-
version: fullVersion,
|
|
169
|
-
platform,
|
|
170
|
-
arch,
|
|
171
|
-
})
|
|
172
|
-
|
|
173
|
-
const ext = platform === Platform.Win32 ? '.exe' : ''
|
|
174
|
-
const batExt = platform === Platform.Win32 ? '.bat' : ''
|
|
175
|
-
const launcherPath = join(binPath, 'bin', `typedb${batExt}`)
|
|
176
|
-
const serverPath = join(binPath, 'bin', 'server', `typedb_server_bin${ext}`)
|
|
177
|
-
const consolePath = join(
|
|
178
|
-
binPath,
|
|
179
|
-
'bin',
|
|
180
|
-
'console',
|
|
181
|
-
`typedb_console_bin${ext}`,
|
|
182
|
-
)
|
|
183
|
-
|
|
184
|
-
if (!existsSync(launcherPath)) {
|
|
185
|
-
throw new Error(`TypeDB launcher not found at ${launcherPath}`)
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
if (!existsSync(serverPath)) {
|
|
189
|
-
throw new Error(`TypeDB server binary not found at ${serverPath}`)
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (!existsSync(consolePath)) {
|
|
193
|
-
throw new Error(`TypeDB console binary not found at ${consolePath}`)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return true
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export const typedbBinaryManager = new TypeDBBinaryManager()
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TypeDB binary URL generation
|
|
3
|
-
*
|
|
4
|
-
* Generates download URLs for TypeDB binaries from the layerbase registry.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { type Platform, type Arch, Engine } from '../../types'
|
|
8
|
-
import { normalizeVersion } from './version-maps'
|
|
9
|
-
import { buildHostdbUrl } from '../../core/hostdb-client'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Get the binary download URL for a specific version and platform
|
|
13
|
-
*
|
|
14
|
-
* URL format: https://registry.layerbase.host/typedb-{version}/typedb-{version}-{platform}-{arch}.{ext}
|
|
15
|
-
*
|
|
16
|
-
* @param version - TypeDB version (e.g., '3.8.0' or '3')
|
|
17
|
-
* @param platform - Target platform (darwin, linux, win32)
|
|
18
|
-
* @param arch - Target architecture (x64, arm64)
|
|
19
|
-
*/
|
|
20
|
-
export function getBinaryUrl(
|
|
21
|
-
version: string,
|
|
22
|
-
platform: Platform,
|
|
23
|
-
arch: Arch,
|
|
24
|
-
): string {
|
|
25
|
-
const fullVersion = normalizeVersion(version)
|
|
26
|
-
const ext = getArchiveExtension(platform)
|
|
27
|
-
|
|
28
|
-
return buildHostdbUrl(Engine.TypeDB, {
|
|
29
|
-
version: fullVersion,
|
|
30
|
-
hostdbPlatform: `${platform}-${arch}`,
|
|
31
|
-
extension: ext,
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Get the archive extension for a platform
|
|
37
|
-
*/
|
|
38
|
-
export function getArchiveExtension(platform: Platform): 'tar.gz' | 'zip' {
|
|
39
|
-
return platform === 'win32' ? 'zip' : 'tar.gz'
|
|
40
|
-
}
|