spindb 0.47.16 → 0.48.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/config/version.js +1 -1
- package/dist/config/version.js.map +1 -1
- package/dist/core/base-binary-manager.js +9 -0
- package/dist/core/base-binary-manager.js.map +1 -1
- package/dist/core/library-env.js +17 -0
- package/dist/core/library-env.js.map +1 -1
- package/dist/core/pg-binary-resolver.js +91 -0
- package/dist/core/pg-binary-resolver.js.map +1 -0
- package/dist/engines/ferretdb/restore.js +5 -8
- package/dist/engines/ferretdb/restore.js.map +1 -1
- package/dist/engines/influxdb/binary-manager.js +10 -0
- package/dist/engines/influxdb/binary-manager.js.map +1 -1
- package/dist/engines/influxdb/index.js +8 -1
- package/dist/engines/influxdb/index.js.map +1 -1
- package/dist/engines/postgresql/backup.js +1 -5
- package/dist/engines/postgresql/backup.js.map +1 -1
- package/dist/engines/postgresql/index.js +19 -53
- package/dist/engines/postgresql/index.js.map +1 -1
- package/dist/engines/postgresql/remote-version.js +1 -3
- package/dist/engines/postgresql/remote-version.js.map +1 -1
- package/dist/engines/postgresql/restore.js +2 -4
- package/dist/engines/postgresql/restore.js.map +1 -1
- package/dist/engines/postgresql/version-validator.js +33 -63
- package/dist/engines/postgresql/version-validator.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/homebrew-version-manager.js +0 -280
- package/dist/core/homebrew-version-manager.js.map +0 -1
|
@@ -9,8 +9,7 @@ import { promisify } from 'util';
|
|
|
9
9
|
import { createReadStream } from 'fs';
|
|
10
10
|
import { createInterface } from 'readline';
|
|
11
11
|
import { SpinDBError, ErrorCodes, logWarning, logDebug, } from '../../core/error-handler.js';
|
|
12
|
-
import {
|
|
13
|
-
import { detectInstalledPostgres, getDirectBinaryPath, findCompatibleVersion, } from '../../core/homebrew-version-manager.js';
|
|
12
|
+
import { getBundledBinaryPath, findCompatibleVersion, } from '../../core/pg-binary-resolver.js';
|
|
14
13
|
import { detectRemotePostgresVersion, } from './remote-version.js';
|
|
15
14
|
const execAsync = promisify(exec);
|
|
16
15
|
// =============================================================================
|
|
@@ -176,7 +175,7 @@ export async function validateRestoreCompatibility(options) {
|
|
|
176
175
|
// Check compatibility
|
|
177
176
|
const result = checkVersionCompatibility(dumpVersion, toolVersion);
|
|
178
177
|
if (!result.compatible) {
|
|
179
|
-
throw new SpinDBError(ErrorCodes.VERSION_MISMATCH, result.error, 'fatal', `
|
|
178
|
+
throw new SpinDBError(ErrorCodes.VERSION_MISMATCH, result.error, 'fatal', `Download matching PostgreSQL client tools: spindb engines download postgresql ${dumpVersion.major}`, { dumpVersion, toolVersion });
|
|
180
179
|
}
|
|
181
180
|
if (result.warning) {
|
|
182
181
|
logWarning(result.warning);
|
|
@@ -188,23 +187,25 @@ export async function getPgDumpVersion(pgDumpPath) {
|
|
|
188
187
|
return parseToolVersion(stdout);
|
|
189
188
|
}
|
|
190
189
|
/**
|
|
191
|
-
* Validate that a remote database can be dumped with the current pg_dump
|
|
190
|
+
* Validate that a remote database can be dumped with the current pg_dump.
|
|
192
191
|
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
192
|
+
* If the current pg_dump is older than the remote server, look for a newer
|
|
193
|
+
* bundled pg_dump in spindb's own binary cache. If none is available, tell
|
|
194
|
+
* the user to download one with `spindb engines download postgresql <major>`.
|
|
195
|
+
*
|
|
196
|
+
* We never inspect system-installed PostgreSQL — spindb owns all of its
|
|
197
|
+
* database binaries.
|
|
195
198
|
*/
|
|
196
199
|
export async function validateDumpCompatibility(options) {
|
|
197
200
|
const { connectionString, pgDumpPath } = options;
|
|
198
|
-
// Get local pg_dump version
|
|
199
201
|
const localVersion = await getPgDumpVersion(pgDumpPath);
|
|
200
202
|
logDebug('Local pg_dump version', { version: localVersion.full });
|
|
201
|
-
// Detect remote database version
|
|
202
203
|
const remoteVersion = await detectRemotePostgresVersion(connectionString);
|
|
203
204
|
logDebug('Remote database version', {
|
|
204
205
|
version: remoteVersion.fullVersion,
|
|
205
206
|
serverType: remoteVersion.serverType,
|
|
206
207
|
});
|
|
207
|
-
//
|
|
208
|
+
// Current pg_dump can already read the remote — no action needed.
|
|
208
209
|
if (localVersion.major >= remoteVersion.majorVersion) {
|
|
209
210
|
return {
|
|
210
211
|
compatible: true,
|
|
@@ -213,74 +214,43 @@ export async function validateDumpCompatibility(options) {
|
|
|
213
214
|
requiredAction: 'none',
|
|
214
215
|
};
|
|
215
216
|
}
|
|
216
|
-
// Version mismatch - check if we can use a direct path
|
|
217
217
|
const targetMajor = String(remoteVersion.majorVersion);
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
// Prefer the exact major match from spindb's bundled binaries.
|
|
219
|
+
const exactBundled = getBundledBinaryPath('pg_dump', targetMajor);
|
|
220
|
+
if (exactBundled) {
|
|
221
221
|
return {
|
|
222
222
|
compatible: false,
|
|
223
223
|
localToolVersion: localVersion,
|
|
224
224
|
remoteDbVersion: remoteVersion,
|
|
225
|
-
requiredAction: '
|
|
226
|
-
alternativePath:
|
|
227
|
-
|
|
225
|
+
requiredAction: 'use_bundled',
|
|
226
|
+
alternativePath: exactBundled,
|
|
227
|
+
targetMajor,
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
|
-
//
|
|
231
|
-
const compatibleVersion =
|
|
230
|
+
// Otherwise, accept any bundled major that is >= the remote.
|
|
231
|
+
const compatibleVersion = findCompatibleVersion(remoteVersion.majorVersion);
|
|
232
232
|
if (compatibleVersion) {
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
const installed = await detectInstalledPostgres();
|
|
245
|
-
const hasTarget = installed.some((v) => parseInt(v.majorVersion, 10) >= remoteVersion.majorVersion);
|
|
246
|
-
if (hasTarget) {
|
|
247
|
-
const best = installed
|
|
248
|
-
.filter((v) => parseInt(v.majorVersion, 10) >= remoteVersion.majorVersion)
|
|
249
|
-
.sort((a, b) => parseInt(a.majorVersion, 10) - parseInt(b.majorVersion, 10))[0];
|
|
250
|
-
return {
|
|
251
|
-
compatible: false,
|
|
252
|
-
localToolVersion: localVersion,
|
|
253
|
-
remoteDbVersion: remoteVersion,
|
|
254
|
-
requiredAction: 'switch_homebrew',
|
|
255
|
-
switchTarget: best.majorVersion,
|
|
256
|
-
};
|
|
233
|
+
const bundledPath = getBundledBinaryPath('pg_dump', compatibleVersion.majorVersion);
|
|
234
|
+
if (bundledPath) {
|
|
235
|
+
return {
|
|
236
|
+
compatible: false,
|
|
237
|
+
localToolVersion: localVersion,
|
|
238
|
+
remoteDbVersion: remoteVersion,
|
|
239
|
+
requiredAction: 'use_bundled',
|
|
240
|
+
alternativePath: bundledPath,
|
|
241
|
+
targetMajor: compatibleVersion.majorVersion,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
257
244
|
}
|
|
258
|
-
//
|
|
259
|
-
const installCmd = await getInstallCommand(targetMajor);
|
|
245
|
+
// No bundled binary can read this server — ask the user to download one.
|
|
260
246
|
return {
|
|
261
247
|
compatible: false,
|
|
262
248
|
localToolVersion: localVersion,
|
|
263
249
|
remoteDbVersion: remoteVersion,
|
|
264
|
-
requiredAction: '
|
|
265
|
-
|
|
250
|
+
requiredAction: 'download',
|
|
251
|
+
targetMajor,
|
|
266
252
|
error: `Your pg_dump version (${localVersion.major}) cannot dump from PostgreSQL ${remoteVersion.majorVersion}. ` +
|
|
267
|
-
`
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
export async function getInstallCommand(majorVersion) {
|
|
271
|
-
const pm = await detectPackageManager();
|
|
272
|
-
if (!pm) {
|
|
273
|
-
return `Install PostgreSQL ${majorVersion} client tools for your platform`;
|
|
274
|
-
}
|
|
275
|
-
// Versioned package names per package manager
|
|
276
|
-
const packages = {
|
|
277
|
-
brew: `postgresql@${majorVersion}`,
|
|
278
|
-
apt: `postgresql-client-${majorVersion}`,
|
|
279
|
-
yum: `postgresql${majorVersion}`,
|
|
280
|
-
dnf: `postgresql${majorVersion}`,
|
|
281
|
-
pacman: 'postgresql-libs', // Arch doesn't version packages the same way
|
|
253
|
+
`Download the matching client tools with: spindb engines download postgresql ${targetMajor}`,
|
|
282
254
|
};
|
|
283
|
-
const pkg = packages[pm.id] || `postgresql-${majorVersion}`;
|
|
284
|
-
return pm.config.installTemplate.replace('{package}', pkg);
|
|
285
255
|
}
|
|
286
256
|
//# sourceMappingURL=version-validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-validator.js","sourceRoot":"","sources":["../../../engines/postgresql/version-validator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"version-validator.js","sourceRoot":"","sources":["../../../engines/postgresql/version-validator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC1C,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,2BAA2B,GAE5B,MAAM,kBAAkB,CAAA;AAEzB,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ACzE,OAAO;QACL,UAAU,EAAE,KAAK;QACjB,gBAAgB,EAAE,YAAY;QAC9B,eAAe,EAAE,aAAa;QAC9B,cAAc,EAAE,UAAU;QAC1B,WAAW;QACX,KAAK,EACH,yBAAyB,YAAY,CAAC,KAAK,iCAAiC,aAAa,CAAC,YAAY,IAAI;YAC1G,+EAA+E,WAAW,EAAE;KAC/F,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spindb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
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.",
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PostgreSQL System Version Manager (FALLBACK / DEPRECATED)
|
|
3
|
-
*
|
|
4
|
-
* @deprecated SpinDB now downloads PostgreSQL binaries from hostdb, which include
|
|
5
|
-
* all client tools (psql, pg_dump, pg_restore). This module is a legacy fallback
|
|
6
|
-
* for users who have PostgreSQL installed via system package managers. Consider
|
|
7
|
-
* removing this module once hostdb adoption is complete.
|
|
8
|
-
*
|
|
9
|
-
* FALLBACK USE CASE:
|
|
10
|
-
* Detects PostgreSQL versions installed via system package managers:
|
|
11
|
-
* - macOS: Homebrew (/opt/homebrew/opt/postgresql@17/bin)
|
|
12
|
-
* - Linux: APT/YUM (/usr/lib/postgresql/17/bin)
|
|
13
|
-
*
|
|
14
|
-
* Used when hostdb binaries are unavailable and system tools are needed for
|
|
15
|
-
* dump/restore operations with version compatibility requirements.
|
|
16
|
-
*/
|
|
17
|
-
import { exec } from 'child_process';
|
|
18
|
-
import { promisify } from 'util';
|
|
19
|
-
import { existsSync } from 'fs';
|
|
20
|
-
import { platformService } from './platform-service.js';
|
|
21
|
-
import { Platform, Arch } from '../types/index.js';
|
|
22
|
-
import { logDebug } from './error-handler.js';
|
|
23
|
-
const execAsync = promisify(exec);
|
|
24
|
-
// PostgreSQL versions to detect on system (via Homebrew/apt)
|
|
25
|
-
// NOTE: This is for SYSTEM-INSTALLED PostgreSQL only (fallback path).
|
|
26
|
-
// Primary path uses hostdb binaries. If this module is removed, these
|
|
27
|
-
// versions become irrelevant.
|
|
28
|
-
const SUPPORTED_PG_VERSIONS = ['14', '15', '16', '17', '18'];
|
|
29
|
-
// Check if Homebrew is available on this system
|
|
30
|
-
export async function isHomebrewAvailable() {
|
|
31
|
-
const { platform } = platformService.getPlatformInfo();
|
|
32
|
-
if (platform !== Platform.Darwin)
|
|
33
|
-
return false;
|
|
34
|
-
try {
|
|
35
|
-
await execAsync('brew --version');
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
// Get the Homebrew prefix based on architecture
|
|
43
|
-
function getHomebrewPrefix() {
|
|
44
|
-
const { arch } = platformService.getPlatformInfo();
|
|
45
|
-
return arch === Arch.ARM64 ? '/opt/homebrew' : '/usr/local';
|
|
46
|
-
}
|
|
47
|
-
// Get Linux PostgreSQL bin paths (Debian/Ubuntu style)
|
|
48
|
-
function getLinuxPostgresPath(majorVersion) {
|
|
49
|
-
return `/usr/lib/postgresql/${majorVersion}/bin`;
|
|
50
|
-
}
|
|
51
|
-
// Get the currently linked PostgreSQL major version (if any)
|
|
52
|
-
export async function getCurrentLinkedVersion() {
|
|
53
|
-
const prefix = getHomebrewPrefix();
|
|
54
|
-
const pgDumpPath = `${prefix}/bin/pg_dump`;
|
|
55
|
-
if (!existsSync(pgDumpPath)) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
const { stdout } = await execAsync(`"${pgDumpPath}" --version`);
|
|
60
|
-
const match = stdout.match(/(\d+)\.(\d+)/);
|
|
61
|
-
return match ? match[1] : null;
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Detect all PostgreSQL versions installed on the system
|
|
69
|
-
* Works on both macOS (Homebrew) and Linux (APT/YUM)
|
|
70
|
-
*/
|
|
71
|
-
export async function detectInstalledPostgres() {
|
|
72
|
-
const { platform } = platformService.getPlatformInfo();
|
|
73
|
-
const installed = [];
|
|
74
|
-
// Get currently linked version (for macOS)
|
|
75
|
-
const linkedVersion = await getCurrentLinkedVersion();
|
|
76
|
-
if (platform === Platform.Darwin) {
|
|
77
|
-
// macOS: Check Homebrew installations
|
|
78
|
-
const prefix = getHomebrewPrefix();
|
|
79
|
-
for (const major of SUPPORTED_PG_VERSIONS) {
|
|
80
|
-
const binPath = `${prefix}/opt/postgresql@${major}/bin`;
|
|
81
|
-
const pgDumpPath = `${binPath}/pg_dump`;
|
|
82
|
-
if (existsSync(pgDumpPath)) {
|
|
83
|
-
try {
|
|
84
|
-
const { stdout } = await execAsync(`"${pgDumpPath}" --version`);
|
|
85
|
-
const match = stdout.match(/(\d+)\.(\d+)(?:\.(\d+))?/);
|
|
86
|
-
if (match) {
|
|
87
|
-
installed.push({
|
|
88
|
-
majorVersion: major,
|
|
89
|
-
fullVersion: match[0],
|
|
90
|
-
binPath,
|
|
91
|
-
isLinked: linkedVersion === major,
|
|
92
|
-
source: 'homebrew',
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
catch (error) {
|
|
97
|
-
logDebug(`Could not get version for postgresql@${major}`, {
|
|
98
|
-
error: error instanceof Error ? error.message : String(error),
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
else if (platform === Platform.Linux) {
|
|
105
|
-
// Linux: Check /usr/lib/postgresql/*/bin (Debian/Ubuntu style)
|
|
106
|
-
for (const major of SUPPORTED_PG_VERSIONS) {
|
|
107
|
-
const binPath = getLinuxPostgresPath(major);
|
|
108
|
-
const pgDumpPath = `${binPath}/pg_dump`;
|
|
109
|
-
if (existsSync(pgDumpPath)) {
|
|
110
|
-
try {
|
|
111
|
-
const { stdout } = await execAsync(`"${pgDumpPath}" --version`);
|
|
112
|
-
const match = stdout.match(/(\d+)\.(\d+)(?:\.(\d+))?/);
|
|
113
|
-
if (match) {
|
|
114
|
-
installed.push({
|
|
115
|
-
majorVersion: major,
|
|
116
|
-
fullVersion: match[0],
|
|
117
|
-
binPath,
|
|
118
|
-
isLinked: false, // Linux doesn't use linking like Homebrew
|
|
119
|
-
source: 'apt',
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
logDebug(`Could not get version for postgresql-${major}`, {
|
|
125
|
-
error: error instanceof Error ? error.message : String(error),
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return installed;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Get the direct path to a PostgreSQL binary for a specific major version
|
|
135
|
-
* This allows using a specific version without changing system links
|
|
136
|
-
*
|
|
137
|
-
* Works on:
|
|
138
|
-
* - macOS: /opt/homebrew/opt/postgresql@17/bin/pg_dump
|
|
139
|
-
* - Linux: /usr/lib/postgresql/17/bin/pg_dump
|
|
140
|
-
*/
|
|
141
|
-
export async function getDirectBinaryPath(tool, majorVersion) {
|
|
142
|
-
const { platform } = platformService.getPlatformInfo();
|
|
143
|
-
if (platform === Platform.Darwin) {
|
|
144
|
-
// macOS: Homebrew path
|
|
145
|
-
const prefix = getHomebrewPrefix();
|
|
146
|
-
const path = `${prefix}/opt/postgresql@${majorVersion}/bin/${tool}`;
|
|
147
|
-
if (existsSync(path))
|
|
148
|
-
return path;
|
|
149
|
-
}
|
|
150
|
-
else if (platform === Platform.Linux) {
|
|
151
|
-
// Linux: Debian/Ubuntu path
|
|
152
|
-
const path = `${getLinuxPostgresPath(majorVersion)}/${tool}`;
|
|
153
|
-
if (existsSync(path))
|
|
154
|
-
return path;
|
|
155
|
-
}
|
|
156
|
-
return null;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Find a compatible PostgreSQL version for the target major version
|
|
160
|
-
* Returns the best available version that is >= targetMajor
|
|
161
|
-
*/
|
|
162
|
-
export async function findCompatibleVersion(targetMajor) {
|
|
163
|
-
const installed = await detectInstalledPostgres();
|
|
164
|
-
// Filter versions >= target
|
|
165
|
-
const compatible = installed.filter((v) => parseInt(v.majorVersion, 10) >= targetMajor);
|
|
166
|
-
if (compatible.length === 0) {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
// Prefer the currently linked version if it's compatible
|
|
170
|
-
const linked = compatible.find((v) => v.isLinked);
|
|
171
|
-
if (linked) {
|
|
172
|
-
return linked;
|
|
173
|
-
}
|
|
174
|
-
// Otherwise return the lowest compatible version (closest to target)
|
|
175
|
-
compatible.sort((a, b) => parseInt(a.majorVersion, 10) - parseInt(b.majorVersion, 10));
|
|
176
|
-
return compatible[0];
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Switch system to use a specific PostgreSQL version
|
|
180
|
-
*
|
|
181
|
-
* - macOS: Uses `brew link` to change symlinks
|
|
182
|
-
* - Linux: Uses `update-alternatives` if available (Debian/Ubuntu)
|
|
183
|
-
*
|
|
184
|
-
* NOTE: Prefer getDirectBinaryPath() when possible to avoid side effects
|
|
185
|
-
*/
|
|
186
|
-
export async function switchHomebrewVersion(targetMajor) {
|
|
187
|
-
const { platform } = platformService.getPlatformInfo();
|
|
188
|
-
if (platform === Platform.Darwin) {
|
|
189
|
-
return switchHomebrewVersionMacOS(targetMajor);
|
|
190
|
-
}
|
|
191
|
-
else if (platform === Platform.Linux) {
|
|
192
|
-
return switchVersionLinux(targetMajor);
|
|
193
|
-
}
|
|
194
|
-
return {
|
|
195
|
-
success: false,
|
|
196
|
-
error: 'Version switching not supported on this platform',
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
// Switch PostgreSQL version on macOS using Homebrew
|
|
200
|
-
async function switchHomebrewVersionMacOS(targetMajor) {
|
|
201
|
-
if (!(await isHomebrewAvailable())) {
|
|
202
|
-
return { success: false, error: 'Homebrew not available' };
|
|
203
|
-
}
|
|
204
|
-
const installed = await detectInstalledPostgres();
|
|
205
|
-
const target = installed.find((v) => v.majorVersion === targetMajor);
|
|
206
|
-
if (!target) {
|
|
207
|
-
return {
|
|
208
|
-
success: false,
|
|
209
|
-
error: `PostgreSQL ${targetMajor} is not installed via Homebrew. Install with: brew install postgresql@${targetMajor}`,
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
if (target.isLinked) {
|
|
213
|
-
return {
|
|
214
|
-
success: true,
|
|
215
|
-
currentVersion: targetMajor,
|
|
216
|
-
previousVersion: targetMajor,
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
const previousLinked = installed.find((v) => v.isLinked);
|
|
220
|
-
try {
|
|
221
|
-
// Unlink all versions first
|
|
222
|
-
for (const ver of installed) {
|
|
223
|
-
await execAsync(`brew unlink postgresql@${ver.majorVersion} 2>/dev/null || true`);
|
|
224
|
-
}
|
|
225
|
-
// Link target version
|
|
226
|
-
await execAsync(`brew link --overwrite postgresql@${targetMajor}`);
|
|
227
|
-
logDebug('Switched Homebrew PostgreSQL version', {
|
|
228
|
-
from: previousLinked?.majorVersion,
|
|
229
|
-
to: targetMajor,
|
|
230
|
-
});
|
|
231
|
-
return {
|
|
232
|
-
success: true,
|
|
233
|
-
previousVersion: previousLinked?.majorVersion,
|
|
234
|
-
currentVersion: targetMajor,
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
catch (error) {
|
|
238
|
-
return {
|
|
239
|
-
success: false,
|
|
240
|
-
error: error instanceof Error ? error.message : String(error),
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* "Switch" PostgreSQL version on Linux (no-op verification only)
|
|
246
|
-
*
|
|
247
|
-
* Unlike macOS where Homebrew uses symlinks that need switching, Linux installs
|
|
248
|
-
* PostgreSQL versions side-by-side in versioned paths (e.g., /usr/lib/postgresql/17/bin).
|
|
249
|
-
* We access these directly via getDirectBinaryPath(), so no symlink switching is needed.
|
|
250
|
-
* This function just verifies the target version is installed.
|
|
251
|
-
*/
|
|
252
|
-
async function switchVersionLinux(targetMajor) {
|
|
253
|
-
const installed = await detectInstalledPostgres();
|
|
254
|
-
const target = installed.find((v) => v.majorVersion === targetMajor);
|
|
255
|
-
if (!target) {
|
|
256
|
-
return {
|
|
257
|
-
success: false,
|
|
258
|
-
error: `PostgreSQL ${targetMajor} is not installed. Install with: sudo apt install postgresql-client-${targetMajor}`,
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
// No action required - Linux uses versioned paths directly, no symlink switching needed
|
|
262
|
-
logDebug('Linux: Version verified, no switching required (using direct path)', {
|
|
263
|
-
version: targetMajor,
|
|
264
|
-
binPath: target.binPath,
|
|
265
|
-
});
|
|
266
|
-
return {
|
|
267
|
-
success: true,
|
|
268
|
-
currentVersion: targetMajor,
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
// Get all client tools for a specific PostgreSQL version
|
|
272
|
-
export async function getVersionedToolPaths(majorVersion) {
|
|
273
|
-
return {
|
|
274
|
-
pgDump: await getDirectBinaryPath('pg_dump', majorVersion),
|
|
275
|
-
pgRestore: await getDirectBinaryPath('pg_restore', majorVersion),
|
|
276
|
-
psql: await getDirectBinaryPath('psql', majorVersion),
|
|
277
|
-
pgBasebackup: await getDirectBinaryPath('pg_basebackup', majorVersion),
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
//# sourceMappingURL=homebrew-version-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"homebrew-version-manager.js","sourceRoot":"","sources":["../../core/homebrew-version-manager.ts"],"names":[],"mappings":"AAAA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