@pgmt/pgmt 0.4.5

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 (3) hide show
  1. package/README.md +43 -0
  2. package/bin/pgmt +51 -0
  3. package/package.json +28 -0
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # pgmt — PostgreSQL Schema-as-Code
2
+
3
+ Edit database objects like code. pgmt tracks dependencies, applies changes instantly, and generates production-ready migrations.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @pgmt/pgmt
9
+ ```
10
+
11
+ Or use without installing:
12
+
13
+ ```bash
14
+ npx @pgmt/pgmt --version
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ pgmt init --dev-url postgres://localhost/mydb --defaults
21
+ pgmt apply
22
+ pgmt migrate new "add user analytics"
23
+ ```
24
+
25
+ ## Documentation
26
+
27
+ - [Quick Start](https://pgmt.dev/docs/getting-started/quick-start)
28
+ - [CLI Reference](https://pgmt.dev/docs/cli/)
29
+ - [GitHub](https://github.com/gdpotter/pgmt)
30
+
31
+ ## Other Install Methods
32
+
33
+ ```bash
34
+ # Shell script
35
+ curl -fsSL https://pgmt.dev/install.sh | sh
36
+
37
+ # Cargo (from source)
38
+ cargo install pgmt
39
+ ```
40
+
41
+ ## License
42
+
43
+ MIT
package/bin/pgmt ADDED
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execFileSync } = require("child_process");
4
+ const path = require("path");
5
+
6
+ const PLATFORMS = {
7
+ "darwin-arm64": "@pgmt/cli-darwin-arm64",
8
+ "darwin-x64": "@pgmt/cli-darwin-x64",
9
+ "linux-arm64": "@pgmt/cli-linux-arm64",
10
+ "linux-x64": "@pgmt/cli-linux-x64",
11
+ "win32-x64": "@pgmt/cli-win32-x64",
12
+ };
13
+
14
+ const platformKey = `${process.platform}-${process.arch}`;
15
+ const pkg = PLATFORMS[platformKey];
16
+
17
+ if (!pkg) {
18
+ console.error(
19
+ `pgmt: unsupported platform ${process.platform}-${process.arch}\n` +
20
+ `Supported: ${Object.keys(PLATFORMS).join(", ")}`
21
+ );
22
+ process.exit(1);
23
+ }
24
+
25
+ let binPath;
26
+ try {
27
+ const pkgDir = path.dirname(require.resolve(`${pkg}/package.json`));
28
+ binPath = path.join(
29
+ pkgDir,
30
+ process.platform === "win32" ? "pgmt.exe" : "pgmt"
31
+ );
32
+ } catch {
33
+ console.error(
34
+ `pgmt: the platform package ${pkg} is not installed.\n\n` +
35
+ `This usually means:\n` +
36
+ ` - You're on a platform that wasn't expected\n` +
37
+ ` - npm's optional dependency resolution skipped it\n\n` +
38
+ `Try reinstalling: npm install -g pgmt\n` +
39
+ `Or install directly: curl -fsSL https://pgmt.dev/install.sh | sh`
40
+ );
41
+ process.exit(1);
42
+ }
43
+
44
+ try {
45
+ execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
46
+ } catch (e) {
47
+ if (e.status !== null) {
48
+ process.exit(e.status);
49
+ }
50
+ throw e;
51
+ }
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@pgmt/pgmt",
3
+ "version": "0.4.5",
4
+ "description": "PostgreSQL schema-as-code with dependency tracking and production-ready migrations",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/gdpotter/pgmt"
9
+ },
10
+ "homepage": "https://pgmt.dev",
11
+ "keywords": [
12
+ "postgresql",
13
+ "postgres",
14
+ "migration",
15
+ "schema",
16
+ "database"
17
+ ],
18
+ "bin": {
19
+ "pgmt": "bin/pgmt"
20
+ },
21
+ "optionalDependencies": {
22
+ "@pgmt/cli-linux-x64": "0.4.5",
23
+ "@pgmt/cli-linux-arm64": "0.4.5",
24
+ "@pgmt/cli-darwin-x64": "0.4.5",
25
+ "@pgmt/cli-darwin-arm64": "0.4.5",
26
+ "@pgmt/cli-win32-x64": "0.4.5"
27
+ }
28
+ }