spindb 0.46.0 → 0.46.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.
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
* Resolve the absolute path to an engine's binary tool.
|
|
5
5
|
* Designed for scripting — outputs just the path for $() substitution.
|
|
6
6
|
*
|
|
7
|
+
* Note: Tool resolution is global, not version-scoped. If multiple versions
|
|
8
|
+
* of an engine are installed, the path returned is whichever version was
|
|
9
|
+
* registered most recently (typically the latest download). Tools shared
|
|
10
|
+
* between engines (e.g., mongosh for both MongoDB and FerretDB) resolve
|
|
11
|
+
* to the same binary regardless of which engine is specified.
|
|
12
|
+
*
|
|
7
13
|
* Usage:
|
|
8
14
|
* spindb bin-path postgresql # Default tool (psql)
|
|
9
15
|
* spindb bin-path postgresql --tool pg_dump # Specific tool
|
|
@@ -19,12 +25,20 @@ import { uiError } from '../ui/theme.js';
|
|
|
19
25
|
const ENGINE_ALIASES = {
|
|
20
26
|
pg: Engine.PostgreSQL,
|
|
21
27
|
postgres: Engine.PostgreSQL,
|
|
28
|
+
mysql: Engine.MySQL,
|
|
29
|
+
maria: Engine.MariaDB,
|
|
22
30
|
mongo: Engine.MongoDB,
|
|
23
31
|
cockroach: Engine.CockroachDB,
|
|
24
32
|
crdb: Engine.CockroachDB,
|
|
25
33
|
surreal: Engine.SurrealDB,
|
|
26
34
|
ferret: Engine.FerretDB,
|
|
27
35
|
quest: Engine.QuestDB,
|
|
36
|
+
meili: Engine.Meilisearch,
|
|
37
|
+
couch: Engine.CouchDB,
|
|
38
|
+
influx: Engine.InfluxDB,
|
|
39
|
+
weav: Engine.Weaviate,
|
|
40
|
+
tb: Engine.TigerBeetle,
|
|
41
|
+
lsql: Engine.LibSQL,
|
|
28
42
|
};
|
|
29
43
|
function resolveEngine(input) {
|
|
30
44
|
const normalized = input.toLowerCase();
|
|
@@ -34,6 +48,15 @@ function resolveEngine(input) {
|
|
|
34
48
|
}
|
|
35
49
|
return ENGINE_ALIASES[normalized] ?? null;
|
|
36
50
|
}
|
|
51
|
+
function exitWithError(msg, json) {
|
|
52
|
+
if (json) {
|
|
53
|
+
console.log(JSON.stringify({ error: msg }, null, 2));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
console.error(uiError(msg));
|
|
57
|
+
}
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
37
60
|
export const binPathCommand = new Command('bin-path')
|
|
38
61
|
.description('Output the absolute path to an engine binary')
|
|
39
62
|
.argument('<engine>', 'Engine name (e.g., postgresql, redis, mongodb)')
|
|
@@ -44,51 +67,23 @@ export const binPathCommand = new Command('bin-path')
|
|
|
44
67
|
const engine = resolveEngine(engineInput);
|
|
45
68
|
if (!engine) {
|
|
46
69
|
const validEngines = ALL_ENGINES.join(', ');
|
|
47
|
-
|
|
48
|
-
if (options.json) {
|
|
49
|
-
console.log(JSON.stringify({ error: errorMsg }));
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
console.error(uiError(errorMsg));
|
|
53
|
-
}
|
|
54
|
-
process.exit(1);
|
|
70
|
+
exitWithError(`Unknown engine "${engineInput}". Valid engines: ${validEngines}`, options.json);
|
|
55
71
|
}
|
|
56
72
|
const engineConfig = await getEngineConfig(engine);
|
|
57
73
|
const toolName = options.tool ?? engineConfig.clientTools[0];
|
|
58
74
|
if (!toolName) {
|
|
59
|
-
|
|
60
|
-
if (options.json) {
|
|
61
|
-
console.log(JSON.stringify({ error: errorMsg }));
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
console.error(uiError(errorMsg));
|
|
65
|
-
}
|
|
66
|
-
process.exit(1);
|
|
75
|
+
exitWithError(`Engine "${engine}" has no registered client tools. This engine uses a REST API — use spindb connect instead.`, options.json);
|
|
67
76
|
}
|
|
68
77
|
// Verify the requested tool belongs to this engine
|
|
69
78
|
if (options.tool && !engineConfig.clientTools.includes(options.tool)) {
|
|
70
79
|
const validTools = engineConfig.clientTools.join(', ');
|
|
71
|
-
|
|
72
|
-
if (options.json) {
|
|
73
|
-
console.log(JSON.stringify({ error: errorMsg }));
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
console.error(uiError(errorMsg));
|
|
77
|
-
}
|
|
78
|
-
process.exit(1);
|
|
80
|
+
exitWithError(`Tool "${options.tool}" is not a known tool for ${engine}. Available: ${validTools}`, options.json);
|
|
79
81
|
}
|
|
80
82
|
// Ensure bundled binaries are registered before lookup
|
|
81
83
|
await configManager.scanInstalledBinaries();
|
|
82
84
|
const result = await findBinary(toolName);
|
|
83
85
|
if (!result) {
|
|
84
|
-
|
|
85
|
-
if (options.json) {
|
|
86
|
-
console.log(JSON.stringify({ error: errorMsg }));
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
console.error(uiError(errorMsg));
|
|
90
|
-
}
|
|
91
|
-
process.exit(1);
|
|
86
|
+
exitWithError(`${toolName} not found. Run: spindb engines download ${engine}`, options.json);
|
|
92
87
|
}
|
|
93
88
|
if (options.json) {
|
|
94
89
|
console.log(JSON.stringify({
|
|
@@ -107,13 +102,7 @@ export const binPathCommand = new Command('bin-path')
|
|
|
107
102
|
}
|
|
108
103
|
catch (error) {
|
|
109
104
|
const e = error;
|
|
110
|
-
|
|
111
|
-
console.log(JSON.stringify({ error: e.message }));
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
console.error(uiError(e.message));
|
|
115
|
-
}
|
|
116
|
-
process.exit(1);
|
|
105
|
+
exitWithError(e.message, options.json);
|
|
117
106
|
}
|
|
118
107
|
});
|
|
119
108
|
//# sourceMappingURL=bin-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin-path.js","sourceRoot":"","sources":["../../../cli/commands/bin-path.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bin-path.js","sourceRoot":"","sources":["../../../cli/commands/bin-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH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
|
@@ -357,7 +357,7 @@
|
|
|
357
357
|
"scriptFileLabel": null,
|
|
358
358
|
"connectionScheme": "http",
|
|
359
359
|
"superuser": null,
|
|
360
|
-
"clientTools": [],
|
|
360
|
+
"clientTools": ["sqld"],
|
|
361
361
|
"licensing": "MIT",
|
|
362
362
|
"notes": "SQLite fork by Turso with server mode (sqld), HTTP API, replication support. No Windows binaries. Enhanced clients: litecli, usql.",
|
|
363
363
|
"platforms": ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64"]
|
package/dist/config/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spindb",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.1",
|
|
4
4
|
"author": "Bob Bass <bob@bbass.co>",
|
|
5
5
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
6
6
|
"description": "Zero-config Docker-free local database containers. Create, backup, and clone a variety of popular databases.",
|