@astratra/store-postgres 1.1.0 → 1.2.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/LICENSE +1 -1
- package/package.json +2 -2
- package/src/index.js +2 -2
- package/src/migrations.js +1 -1
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astratra/store-postgres",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "PostgreSQL persistence adapters for Astratra SaaS stores.",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=22"
|
|
7
7
|
},
|
|
8
8
|
"main": "src/index.js",
|
|
9
9
|
"types": "src/index.d.ts",
|
package/src/index.js
CHANGED
|
@@ -6,8 +6,8 @@ const DEFAULT_SETTINGS_TABLE = 'astratra_settings';
|
|
|
6
6
|
function loadPg() {
|
|
7
7
|
try {
|
|
8
8
|
return require('pg');
|
|
9
|
-
} catch (
|
|
10
|
-
throw new Error('@astratra/store-postgres requires pg. Install pg or pass it from an app that already depends on it.');
|
|
9
|
+
} catch (error) {
|
|
10
|
+
throw new Error('@astratra/store-postgres requires pg. Install pg or pass it from an app that already depends on it.', { cause: error });
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
package/src/migrations.js
CHANGED
|
@@ -87,7 +87,7 @@ function createPostgresMigrationRunner(options = {}) {
|
|
|
87
87
|
applied.push(migration.id);
|
|
88
88
|
} catch (error) {
|
|
89
89
|
await client.query('ROLLBACK');
|
|
90
|
-
throw new Error(`Migration "${migration.id}" failed and was rolled back: ${error.message}
|
|
90
|
+
throw new Error(`Migration "${migration.id}" failed and was rolled back: ${error.message}`, { cause: error });
|
|
91
91
|
} finally {
|
|
92
92
|
client.release();
|
|
93
93
|
}
|