dbmate 2.0.1 → 2.1.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/README.md CHANGED
@@ -510,10 +510,10 @@ You can customize the name of this table using the `--migrations-table` flag or
510
510
 
511
511
  Why another database schema migration tool? Dbmate was inspired by many other tools, primarily [Active Record Migrations](http://guides.rubyonrails.org/active_record_migrations.html), with the goals of being trivial to configure, and language & framework independent. Here is a comparison between dbmate and other popular migration tools.
512
512
 
513
- | | [dbmate](https://github.com/amacneil/dbmate) | [goose](https://github.com/pressly/goose) | [sql-migrate](https://github.com/rubenv/sql-migrate) | [golang-migrate](https://github.com/golang-migrate/migrate) | [activerecord](http://guides.rubyonrails.org/active_record_migrations.html) | [sequelize](http://docs.sequelizejs.com/manual/tutorial/migrations.html) | [flyway](https://flywaydb.org/) |
514
- | ------------------------------------------------------------ | :------------------------------------------: | :---------------------------------------: | :--------------------------------------------------: | :---------------------------------------------------------: | :-------------------------------------------------------------------------: | :----------------------------------------------------------------------: | :-----------------------------: |
513
+ | | [dbmate](https://github.com/amacneil/dbmate) | [goose](https://github.com/pressly/goose) | [sql-migrate](https://github.com/rubenv/sql-migrate) | [golang-migrate](https://github.com/golang-migrate/migrate) | [activerecord](http://guides.rubyonrails.org/active_record_migrations.html) | [sequelize](http://docs.sequelizejs.com/manual/tutorial/migrations.html) | [flyway](https://flywaydb.org/) | [sqitch](https://sqitch.org/) |
514
+ | ------------------------------------------------------------ | :------------------------------------------: | :---------------------------------------: | :--------------------------------------------------: | :---------------------------------------------------------: | :-------------------------------------------------------------------------: | :----------------------------------------------------------------------: | :-----------------------------: | :---------------------------: |
515
515
  | **Features** |
516
- | Plain SQL migration files | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | :white_check_mark: |
516
+ | Plain SQL migration files | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | :white_check_mark: | :white_check_mark: |
517
517
  | Support for creating and dropping databases | :white_check_mark: | | | | :white_check_mark: | | |
518
518
  | Support for saving schema dump files | :white_check_mark: | | | | :white_check_mark: | | |
519
519
  | Timestamp-versioned migration files | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
@@ -522,11 +522,11 @@ Why another database schema migration tool? Dbmate was inspired by many other to
522
522
  | Database connection string loaded from environment variables | :white_check_mark: | | | | | | :white_check_mark: |
523
523
  | Automatically load .env file | :white_check_mark: | | | | | | |
524
524
  | No separate configuration file | :white_check_mark: | | | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
525
- | Language/framework independent | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: |
525
+ | Language/framework independent | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: | :white_check_mark: |
526
526
  | **Drivers** |
527
- | PostgreSQL | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
528
- | MySQL | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
529
- | SQLite | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
527
+ | PostgreSQL | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
528
+ | MySQL | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
529
+ | SQLite | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
530
530
  | CliсkHouse | :white_check_mark: | | | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
531
531
 
532
532
  _If you notice any inaccuracies in this table, please [propose a change](https://github.com/amacneil/dbmate/edit/main/README.md)._
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import { resolveBinary } from "./resolveBinary.js";
4
+ const child = spawnSync(resolveBinary(), process.argv.slice(2), {
5
+ stdio: "inherit",
6
+ });
7
+ process.exit(child.status ?? 0);
8
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,KAAK,GAAG,SAAS,CAAC,aAAa,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC9D,KAAK,EAAE,SAAS;CACjB,CAAC,CAAC;AACH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { resolveBinary } from "./resolveBinary.js";
2
+ export { resolveBinary };
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import { resolveBinary } from "./resolveBinary.js";
2
+ export { resolveBinary };
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Resolve path to dbmate for the current platform
3
+ * */
4
+ export declare function resolveBinary(): string;
5
+ //# sourceMappingURL=resolveBinary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveBinary.d.ts","sourceRoot":"","sources":["../src/resolveBinary.ts"],"names":[],"mappings":"AAGA;;KAEK;AACL,wBAAgB,aAAa,IAAI,MAAM,CAkBtC"}
@@ -0,0 +1,24 @@
1
+ import { createRequire } from "node:module";
2
+ import { arch, platform } from "node:process";
3
+ /**
4
+ * Resolve path to dbmate for the current platform
5
+ * */
6
+ export function resolveBinary() {
7
+ const ext = platform === "win32" ? ".exe" : "";
8
+ const path = `@dbmate/${platform}-${arch}/bin/dbmate${ext}`;
9
+ try {
10
+ return createRequire(import.meta.url).resolve(path);
11
+ }
12
+ catch (err) {
13
+ if (err != undefined &&
14
+ typeof err === "object" &&
15
+ "code" in err &&
16
+ err.code === "MODULE_NOT_FOUND") {
17
+ throw new Error(`Unable to locate dbmate binary '${path}'`);
18
+ }
19
+ else {
20
+ throw err;
21
+ }
22
+ }
23
+ }
24
+ //# sourceMappingURL=resolveBinary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveBinary.js","sourceRoot":"","sources":["../src/resolveBinary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE9C;;KAEK;AACL,MAAM,UAAU,aAAa;IAC3B,MAAM,GAAG,GAAG,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/C,MAAM,IAAI,GAAG,WAAW,QAAQ,IAAI,IAAI,cAAc,GAAG,EAAE,CAAC;IAE5D,IAAI;QACF,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACrD;IAAC,OAAO,GAAG,EAAE;QACZ,IACE,GAAG,IAAI,SAAS;YAChB,OAAO,GAAG,KAAK,QAAQ;YACvB,MAAM,IAAI,GAAG;YACb,GAAG,CAAC,IAAI,KAAK,kBAAkB,EAC/B;YACA,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,GAAG,CAAC,CAAC;SAC7D;aAAM;YACL,MAAM,GAAG,CAAC;SACX;KACF;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbmate",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "A lightweight, framework-agnostic database migration tool",
5
5
  "repository": "https://github.com/amacneil/dbmate",
6
6
  "homepage": "https://github.com/amacneil/dbmate#readme",
@@ -15,15 +15,22 @@
15
15
  "schema",
16
16
  "sqlite"
17
17
  ],
18
- "bin": {
19
- "dbmate": "bin/dbmate.js"
18
+ "type": "module",
19
+ "bin": "./dist/cli.js",
20
+ "main": "./dist/index.js",
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc --build"
20
26
  },
21
27
  "optionalDependencies": {
22
- "@dbmate/linux-x64": "2.0.1",
23
- "@dbmate/linux-arm64": "2.0.1",
24
- "@dbmate/linux-arm": "2.0.1",
25
- "@dbmate/darwin-x64": "2.0.1",
26
- "@dbmate/darwin-arm64": "2.0.1",
27
- "@dbmate/win32-x64": "2.0.1"
28
+ "@dbmate/linux-ia32": "2.1.0",
29
+ "@dbmate/linux-x64": "2.1.0",
30
+ "@dbmate/linux-arm": "2.1.0",
31
+ "@dbmate/linux-arm64": "2.1.0",
32
+ "@dbmate/darwin-x64": "2.1.0",
33
+ "@dbmate/darwin-arm64": "2.1.0",
34
+ "@dbmate/win32-x64": "2.1.0"
28
35
  }
29
36
  }
package/bin/dbmate.js DELETED
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { arch, platform } = require("process");
4
- const { realpathSync } = require("fs");
5
- const { spawnSync } = require("child_process");
6
- const { fileURLToPath } = require("url");
7
- const { dirname } = require("path");
8
-
9
- const packageName = `@dbmate/${platform}-${arch}`;
10
- const binName = platform === "win32" ? "dbmate.exe" : "dbmate";
11
- let binPath = `${packageName}/bin/${binName}`;
12
-
13
- try {
14
- binPath = require.resolve(binPath);
15
- } catch (error) {
16
- console.error(`Error: Unable to locate package ${packageName}`);
17
- process.exit(1);
18
- }
19
-
20
- const child = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
21
- process.exit(child.status);