@boringsql/dryrun 0.8.2
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/README.md +36 -0
- package/bin/dryrun.js +55 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# dryrun
|
|
2
|
+
|
|
3
|
+
PostgreSQL schema/query advisor with a built-in MCP server. This npm package is
|
|
4
|
+
a thin launcher — the real binary is written in Go and ships as a
|
|
5
|
+
platform-specific dependency that npm selects automatically.
|
|
6
|
+
|
|
7
|
+
## Use as an MCP server
|
|
8
|
+
|
|
9
|
+
No install needed. Add to your MCP client config:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"dryrun": {
|
|
15
|
+
"command": "npx",
|
|
16
|
+
"args": ["-y", "@boringsql/dryrun", "mcp-serve"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`npx` fetches the package on first run and caches it; subsequent launches are
|
|
23
|
+
local. Pin a version for reproducibility: `"@boringsql/dryrun@0.8.2"`.
|
|
24
|
+
|
|
25
|
+
## CLI
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npx @boringsql/dryrun --help
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or install globally: `npm i -g @boringsql/dryrun` then `dryrun --help`.
|
|
32
|
+
|
|
33
|
+
## Supported platforms
|
|
34
|
+
|
|
35
|
+
`darwin-arm64`, `linux-x64`, `linux-arm64`. On other platforms, grab a prebuilt
|
|
36
|
+
binary from the [GitHub Releases](https://github.com/boringSQL/dryrun/releases).
|
package/bin/dryrun.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// Launcher for the dryrun Go binary. The actual binary ships inside a
|
|
5
|
+
// platform-specific optionalDependency (@boringsql/dryrun-<os>-<cpu>); npm
|
|
6
|
+
// installs only the one matching the host. We resolve it and exec, forwarding
|
|
7
|
+
// argv + stdio verbatim so MCP stdio transport passes straight through.
|
|
8
|
+
|
|
9
|
+
const { spawnSync } = require("node:child_process");
|
|
10
|
+
|
|
11
|
+
// node arch/platform -> our published platform packages
|
|
12
|
+
const SUPPORTED = {
|
|
13
|
+
"darwin arm64": "@boringsql/dryrun-darwin-arm64",
|
|
14
|
+
"darwin x64": "@boringsql/dryrun-darwin-x64",
|
|
15
|
+
"linux x64": "@boringsql/dryrun-linux-x64",
|
|
16
|
+
"linux arm64": "@boringsql/dryrun-linux-arm64",
|
|
17
|
+
"win32 x64": "@boringsql/dryrun-win32-x64",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function resolveBinary() {
|
|
21
|
+
const key = `${process.platform} ${process.arch}`;
|
|
22
|
+
const pkg = SUPPORTED[key];
|
|
23
|
+
if (!pkg) {
|
|
24
|
+
fail(
|
|
25
|
+
`unsupported platform ${key}.\n` +
|
|
26
|
+
`Supported: ${Object.keys(SUPPORTED).join(", ")}.\n` +
|
|
27
|
+
`Install a prebuilt binary from https://github.com/boringSQL/dryrun/releases instead.`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
const binName = process.platform === "win32" ? "dryrun.exe" : "dryrun";
|
|
32
|
+
return require.resolve(`${pkg}/bin/${binName}`);
|
|
33
|
+
} catch (_e) {
|
|
34
|
+
fail(
|
|
35
|
+
`the platform package ${pkg} is not installed.\n` +
|
|
36
|
+
`This usually means npm skipped optional dependencies. Reinstall without\n` +
|
|
37
|
+
`--no-optional (e.g. \`npm i @boringsql/dryrun\`), or grab a binary from\n` +
|
|
38
|
+
`https://github.com/boringSQL/dryrun/releases.`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function fail(msg) {
|
|
44
|
+
process.stderr.write(`dryrun: ${msg}\n`);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const result = spawnSync(resolveBinary(), process.argv.slice(2), {
|
|
49
|
+
stdio: "inherit",
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
if (result.error) fail(result.error.message);
|
|
53
|
+
// propagate signal-kills as the conventional 128+signal exit code
|
|
54
|
+
if (result.signal) process.exit(1);
|
|
55
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@boringsql/dryrun",
|
|
3
|
+
"version": "0.8.2",
|
|
4
|
+
"description": "dryrun — PostgreSQL schema/query advisor and MCP server. npx launcher.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"dryrun": "bin/dryrun.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/dryrun.js"
|
|
10
|
+
],
|
|
11
|
+
"optionalDependencies": {
|
|
12
|
+
"@boringsql/dryrun-darwin-arm64": "0.8.2",
|
|
13
|
+
"@boringsql/dryrun-darwin-x64": "0.8.2",
|
|
14
|
+
"@boringsql/dryrun-linux-x64": "0.8.2",
|
|
15
|
+
"@boringsql/dryrun-linux-arm64": "0.8.2",
|
|
16
|
+
"@boringsql/dryrun-win32-x64": "0.8.2"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=16"
|
|
20
|
+
},
|
|
21
|
+
"license": "BSD-2-Clause",
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/boringSQL/dryrun.git"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/boringSQL/dryrun#readme",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/boringSQL/dryrun/issues"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"postgres",
|
|
32
|
+
"postgresql",
|
|
33
|
+
"mcp",
|
|
34
|
+
"model-context-protocol",
|
|
35
|
+
"sql",
|
|
36
|
+
"schema",
|
|
37
|
+
"dryrun"
|
|
38
|
+
]
|
|
39
|
+
}
|