nexusql 0.9.2 → 0.9.3
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 +15 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3654,7 +3654,18 @@ async function gen(options = {}) {
|
|
|
3654
3654
|
try {
|
|
3655
3655
|
spinner.start("Installing extensions...");
|
|
3656
3656
|
await tempDb.installExtensions(config.extensions);
|
|
3657
|
-
|
|
3657
|
+
if (config.extensions.includes("vector")) {
|
|
3658
|
+
const vectorCheck = await tempDb.query(
|
|
3659
|
+
"SELECT typname FROM pg_type WHERE typname = 'vector'"
|
|
3660
|
+
);
|
|
3661
|
+
if (vectorCheck.rows.length === 0) {
|
|
3662
|
+
spinner.fail("Vector extension installed but vector type not found!");
|
|
3663
|
+
throw new Error(
|
|
3664
|
+
"pgvector extension was installed but the 'vector' type is not available. This usually means pgvector is not properly installed on your PostgreSQL server."
|
|
3665
|
+
);
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3668
|
+
spinner.succeed("Installed db extensions");
|
|
3658
3669
|
spinner.start("Loading schema into temp database...");
|
|
3659
3670
|
await tempDb.exec(targetSql);
|
|
3660
3671
|
spinner.succeed("Loaded schema into temp database");
|
|
@@ -3693,6 +3704,9 @@ ${commentSql}` : `-- Comment changes
|
|
|
3693
3704
|
${commentSql}`;
|
|
3694
3705
|
}
|
|
3695
3706
|
spinner.succeed("Checked comment changes");
|
|
3707
|
+
} catch (error) {
|
|
3708
|
+
spinner.fail("Failed to generate migration diff");
|
|
3709
|
+
throw error;
|
|
3696
3710
|
} finally {
|
|
3697
3711
|
spinner.start("Cleaning up temp database...");
|
|
3698
3712
|
try {
|