Suppost postgres

This commit is contained in:
1ilit
2023-09-19 15:51:26 +03:00
parent 69aabaefa9
commit 36ad44f0db
4 changed files with 142 additions and 20 deletions

View File

@@ -37,7 +37,8 @@ import {
exitFullscreen,
ddbDiagramIsValid,
dataURItoBlob,
jsonToSQL,
jsonToMySQL,
jsonToPostgreSQL,
} from "../utils";
import {
AreaContext,
@@ -728,7 +729,21 @@ export default function ControlPanel(props) {
{
MySQL: () => {
setVisible(MODAL.CODE);
const src = jsonToSQL({
const src = jsonToMySQL({
tables: tables,
references: relationships,
});
setExportData((prev) => ({
...prev,
data: src,
extension: "sql",
}));
},
},
{
PostgreSQL: () => {
setVisible(MODAL.CODE);
const src = jsonToPostgreSQL({
tables: tables,
references: relationships,
});
@@ -739,7 +754,6 @@ export default function ControlPanel(props) {
}));
},
},
{ PostgreSQL: () => {} },
{ DBML: () => {} },
],
function: () => {},

View File

@@ -382,7 +382,7 @@ export default function Table(props) {
updateField(props.tableData.id, j, {
type: value,
default: "",
values: [],
values: f.values ? [...f.values] : [],
increment: incr,
});
} else if (isSized(value) || hasPrecision(value)) {

View File

@@ -228,7 +228,7 @@ export default function TableOverview(props) {
updateField(i, j, {
type: value,
default: "",
values: [],
values: f.values ? [...f.values] : [],
increment: incr,
});
} else if (isSized(value) || hasPrecision(value)) {