nexusql 0.6.0 → 0.6.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 +17 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.js +15 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2096,10 +2096,9 @@ var MigrationRunner = class {
|
|
|
2096
2096
|
};
|
|
2097
2097
|
|
|
2098
2098
|
// src/lib/dbml.ts
|
|
2099
|
-
import {
|
|
2099
|
+
import { exporter } from "@dbml/core";
|
|
2100
2100
|
function dbmlToSql(dbmlContent) {
|
|
2101
|
-
const
|
|
2102
|
-
const sql = ModelExporter.export(database, "postgres");
|
|
2101
|
+
const sql = exporter.export(dbmlContent, "postgres");
|
|
2103
2102
|
return { sql };
|
|
2104
2103
|
}
|
|
2105
2104
|
|
|
@@ -3697,7 +3696,11 @@ function getReadline() {
|
|
|
3697
3696
|
if (!rl) {
|
|
3698
3697
|
rl = readline.createInterface({
|
|
3699
3698
|
input: process.stdin,
|
|
3700
|
-
output: process.stdout
|
|
3699
|
+
output: process.stdout,
|
|
3700
|
+
terminal: process.stdin.isTTY ?? false
|
|
3701
|
+
});
|
|
3702
|
+
rl.on("close", () => {
|
|
3703
|
+
rl = null;
|
|
3701
3704
|
});
|
|
3702
3705
|
}
|
|
3703
3706
|
return rl;
|
|
@@ -3709,8 +3712,14 @@ function closePrompts() {
|
|
|
3709
3712
|
}
|
|
3710
3713
|
}
|
|
3711
3714
|
function question(query) {
|
|
3712
|
-
return new Promise((resolve2) => {
|
|
3713
|
-
getReadline()
|
|
3715
|
+
return new Promise((resolve2, reject) => {
|
|
3716
|
+
const readline2 = getReadline();
|
|
3717
|
+
const closeHandler = () => {
|
|
3718
|
+
reject(new Error("Readline closed unexpectedly"));
|
|
3719
|
+
};
|
|
3720
|
+
readline2.once("close", closeHandler);
|
|
3721
|
+
readline2.question(query, (answer) => {
|
|
3722
|
+
readline2.removeListener("close", closeHandler);
|
|
3714
3723
|
resolve2(answer);
|
|
3715
3724
|
});
|
|
3716
3725
|
});
|