spindb 0.36.2 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +19 -8
  2. package/cli/commands/create.ts +7 -0
  3. package/cli/commands/databases.ts +17 -12
  4. package/cli/commands/delete.ts +3 -0
  5. package/cli/commands/engines.ts +59 -3
  6. package/cli/commands/info.ts +5 -0
  7. package/cli/commands/list.ts +2 -0
  8. package/cli/commands/menu/backup-handlers.ts +2 -0
  9. package/cli/commands/menu/settings-handlers.ts +3 -0
  10. package/cli/commands/menu/shell-handlers.ts +23 -0
  11. package/cli/commands/restore.ts +3 -0
  12. package/cli/commands/start.ts +3 -0
  13. package/cli/commands/url.ts +4 -0
  14. package/cli/constants.ts +4 -0
  15. package/cli/helpers.ts +93 -0
  16. package/config/backup-formats.ts +14 -0
  17. package/config/engine-defaults.ts +13 -0
  18. package/config/engines.json +17 -0
  19. package/core/config-manager.ts +5 -0
  20. package/core/dependency-manager.ts +2 -0
  21. package/core/docker-exporter.ts +17 -0
  22. package/core/library-env.ts +2 -4
  23. package/engines/base-engine.ts +8 -0
  24. package/engines/index.ts +4 -0
  25. package/engines/mariadb/index.ts +5 -4
  26. package/engines/redis/index.ts +15 -4
  27. package/engines/tigerbeetle/README.md +61 -0
  28. package/engines/tigerbeetle/backup.ts +49 -0
  29. package/engines/tigerbeetle/binary-manager.ts +95 -0
  30. package/engines/tigerbeetle/binary-urls.ts +62 -0
  31. package/engines/tigerbeetle/hostdb-releases.ts +26 -0
  32. package/engines/tigerbeetle/index.ts +746 -0
  33. package/engines/tigerbeetle/restore.ts +130 -0
  34. package/engines/tigerbeetle/version-maps.ts +68 -0
  35. package/engines/tigerbeetle/version-validator.ts +126 -0
  36. package/engines/valkey/index.ts +15 -4
  37. package/package.json +2 -1
  38. package/types/index.ts +9 -0
@@ -0,0 +1,62 @@
1
+ import { normalizeVersion } from './version-maps'
2
+ import { buildHostdbUrl } from '../../core/hostdb-client'
3
+ import { Engine, Platform, type Arch } from '../../types'
4
+
5
+ /**
6
+ * Supported platform identifiers for hostdb downloads.
7
+ * TigerBeetle supports all 5 platforms.
8
+ */
9
+ const SUPPORTED_PLATFORMS = new Set([
10
+ 'darwin-arm64',
11
+ 'darwin-x64',
12
+ 'linux-arm64',
13
+ 'linux-x64',
14
+ 'win32-x64',
15
+ ])
16
+
17
+ /**
18
+ * Get the hostdb platform identifier
19
+ *
20
+ * @param platform - Node.js platform (e.g., 'darwin', 'linux', 'win32')
21
+ * @param arch - Node.js architecture (e.g., 'arm64', 'x64')
22
+ * @returns hostdb platform identifier or null if unsupported
23
+ */
24
+ export function getHostdbPlatform(
25
+ platform: Platform,
26
+ arch: Arch,
27
+ ): string | null {
28
+ const key = `${platform}-${arch}`
29
+ return SUPPORTED_PLATFORMS.has(key) ? key : null
30
+ }
31
+
32
+ /**
33
+ * Build the download URL for TigerBeetle binaries from hostdb
34
+ *
35
+ * @param version - TigerBeetle version (e.g., '0.16', '0.16.70')
36
+ * @param platform - Platform identifier (e.g., 'darwin', 'linux', 'win32')
37
+ * @param arch - Architecture identifier (e.g., 'arm64', 'x64')
38
+ * @returns Download URL for the binary
39
+ */
40
+ export function getBinaryUrl(
41
+ version: string,
42
+ platform: Platform,
43
+ arch: Arch,
44
+ ): string {
45
+ const platformKey = `${platform}-${arch}`
46
+ const hostdbPlatform = getHostdbPlatform(platform, arch)
47
+ if (!hostdbPlatform) {
48
+ const supported = Array.from(SUPPORTED_PLATFORMS).join(', ')
49
+ throw new Error(
50
+ `Unsupported platform: ${platformKey}. Supported platforms: ${supported}`,
51
+ )
52
+ }
53
+
54
+ const fullVersion = normalizeVersion(version)
55
+ const ext = platform === Platform.Win32 ? 'zip' : 'tar.gz'
56
+
57
+ return buildHostdbUrl(Engine.TigerBeetle, {
58
+ version: fullVersion,
59
+ hostdbPlatform,
60
+ extension: ext,
61
+ })
62
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * hostdb Releases Module for TigerBeetle
3
+ *
4
+ * Fetches TigerBeetle binary information from the hostdb repository at
5
+ * https://github.com/robertjbass/hostdb
6
+ */
7
+
8
+ import { createHostdbReleases } from '../../core/hostdb-releases-factory'
9
+ import {
10
+ TIGERBEETLE_VERSION_MAP,
11
+ SUPPORTED_MAJOR_VERSIONS,
12
+ } from './version-maps'
13
+ import { tigerbeetleBinaryManager } from './binary-manager'
14
+ import { Engine } from '../../types'
15
+
16
+ const hostdbReleases = createHostdbReleases({
17
+ engine: Engine.TigerBeetle,
18
+ displayName: 'TigerBeetle',
19
+ versionMap: TIGERBEETLE_VERSION_MAP,
20
+ supportedMajorVersions: SUPPORTED_MAJOR_VERSIONS,
21
+ groupingStrategy: 'xy-format',
22
+ listInstalled: () => tigerbeetleBinaryManager.listInstalled(),
23
+ })
24
+
25
+ export const fetchAvailableVersions = hostdbReleases.fetchAvailableVersions
26
+ export const getLatestVersion = hostdbReleases.getLatestVersion