nexusql 0.9.0 → 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 +14 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1855,7 +1855,20 @@ 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
|
-
|
|
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
|
+
}
|
|
1865
|
+
} catch (error) {
|
|
1866
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1867
|
+
throw new Error(
|
|
1868
|
+
`Failed to install extension "${ext}": ${message}
|
|
1869
|
+
Make sure the extension is installed on your PostgreSQL server.
|
|
1870
|
+
For pgvector: https://github.com/pgvector/pgvector#installation`
|
|
1871
|
+
);
|
|
1859
1872
|
}
|
|
1860
1873
|
}
|
|
1861
1874
|
}
|