nexusql 0.9.1 → 0.9.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/dist/cli.js +7 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1855,6 +1855,13 @@ var Database = class _Database {
|
|
|
1855
1855
|
for (const ext of extensions) {
|
|
1856
1856
|
try {
|
|
1857
1857
|
await this.exec(`CREATE EXTENSION IF NOT EXISTS "${ext}";`);
|
|
1858
|
+
const result = await this.queryParams(
|
|
1859
|
+
`SELECT EXISTS(SELECT 1 FROM pg_extension WHERE extname = $1) as exists`,
|
|
1860
|
+
[ext]
|
|
1861
|
+
);
|
|
1862
|
+
if (!result.rows[0]?.exists) {
|
|
1863
|
+
throw new Error(`Extension "${ext}" was not installed`);
|
|
1864
|
+
}
|
|
1858
1865
|
} catch (error) {
|
|
1859
1866
|
const message = error instanceof Error ? error.message : String(error);
|
|
1860
1867
|
throw new Error(
|