mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-10-19 01:03:56 +00:00
Suppost postgres
This commit is contained in:
@@ -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: () => {},
|
||||
|
@@ -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)) {
|
||||
|
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user