Git Product home page Git Product logo

dbdesigner.id's People

Contributors

dependabot[bot] avatar didin1453fatih avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbdesigner.id's Issues

Exporting to SQLite

Would you like to add export functionality to SQLite?

Here's a sketched example of a generator, made based on your own diagram structure

function toSQLite(diagram) {
    return `${Object.keys(diagram)
        .map(
            (tableKey) => `
CREATE TABLE ${diagram[tableKey].table_name} (
    ${Object.keys(diagram[tableKey].coloumns)
        .map(
            (columnKey) =>
                `${diagram[tableKey].coloumns[columnKey].coloumn_name} ${
                    diagram[tableKey].coloumns[columnKey].dataType
                } ${diagram[tableKey].coloumns[columnKey].primaryKey ? "PRIMARY KEY" : ""}${
                    diagram[tableKey].coloumns[columnKey].primaryKey &&
                    diagram[tableKey].coloumns[columnKey].autoIncrement
                        ? " AUTOINCREMENT"
                        : ""
                }${diagram[tableKey].coloumns[columnKey].notNull ? " NOT NULL" : ""}${
                    diagram[tableKey].coloumns[columnKey].unique ? " UNIQUE" : ""
                }`
        )
        .concat(
            Object.keys(diagram[tableKey].coloumns)
                .filter((columnKey) => diagram[tableKey].coloumns[columnKey].foreignKey)
                .map((columnKey, index) => {
                    var association =
                        diagram[tableKey].association[diagram[tableKey].coloumns[columnKey].association_belong_id];
                    return `CONSTRAINT fk_${diagram[tableKey].table_name}_${diagram[association.table_id].table_name}_${
                        index + 1
                    } FOREIGN KEY (${diagram[tableKey].coloumns[columnKey].coloumn_name}) REFERENCES ${
                        diagram[association.table_id].table_name
                    } (${diagram[association.table_id].coloumns[association.targetKey].coloumn_name})`;
                })
        )
        .join(",\n    ")}
);`
        )
        .join("\n\n")}`;
}

An example of generating code from your diagram structure:

var diagram = {
    "3559740f-4fc7-4a58-8088-a6813e22696b": {
        table_name: "ies_group",
        widthTable: 213,
        heightTable: 0,
        point: { x: 356, y: 95 },
        coloumns: {
            coloumn_car_id_885ddad7_c509_4d5e_ab2e_dc5cb06d0e35: {
                coloumn_name: "id_ies_group",
                comment: "",
                dataType: "INTEGER",
                default: "",
                primaryKey: true,
                notNull: false,
                unique: false,
                foreignKey: false,
                unsigned: false,
                zeroFill: false,
                autoIncrement: true,
                style: { shadowBlur: 0, shadowColor: "#00D2FF" },
                association_belong_id: null,
                association_has_id: ["assoc_Source_bca2a6ca-cddd-4765-b8cb-617c6a1bbb6f"],
            },
            "614a69f3-56bd-483e-bf86-bfc5da481587": {
                coloumn_name: "ies_group_name",
                comment: "",
                dataType: "TEXT",
                default: "",
                primaryKey: false,
                notNull: false,
                unique: false,
                foreignKey: false,
                unsigned: false,
                zeroFill: false,
                autoIncrement: false,
                style: { shadowBlur: 0, shadowColor: "green" },
                association_belong_id: null,
                association_has_id: [],
            },
        },
        association: {
            "assoc_Source_bca2a6ca-cddd-4765-b8cb-617c6a1bbb6f": {
                connector_id: "conn_car_number_driver_idb26b82c8-d673-4590-90c5-89b19fb4ab5c",
                type: "has",
                table: "c0661ebf-848c-4cb9-9631-5fd79f1ed8b1",
                table_id: "c0661ebf-848c-4cb9-9631-5fd79f1ed8b1",
                foreignKey: "0cb79ff1-382b-4fea-bb9b-c41eb3f59e34",
                foreignKey_id: "0cb79ff1-382b-4fea-bb9b-c41eb3f59e34",
                sourceKey: "id",
                sourceKey_id: "coloumn_car_id_885ddad7_c509_4d5e_ab2e_dc5cb06d0e35",
                point: { x: 0, y: 40 },
            },
        },
    },
    "c0661ebf-848c-4cb9-9631-5fd79f1ed8b1": {
        table_name: "ies_user",
        widthTable: 199,
        heightTable: 0,
        point: { x: 26, y: 50 },
        coloumns: {
            coloumn_car_id_885ddad7_c509_4d5e_ab2e_dc5cb06d0e35: {
                coloumn_name: "id_ies_user",
                comment: "",
                dataType: "INTEGER",
                default: "",
                primaryKey: true,
                notNull: false,
                unique: false,
                foreignKey: false,
                unsigned: false,
                zeroFill: false,
                autoIncrement: true,
                style: { shadowBlur: 0, shadowColor: "green" },
                association_belong_id: null,
                association_has_id: [],
            },
            "a7d702a1-a0a7-4872-9263-264f1251bf04": {
                coloumn_name: "surname",
                comment: "",
                dataType: "TEXT",
                default: "",
                primaryKey: false,
                notNull: false,
                unique: false,
                foreignKey: false,
                unsigned: false,
                zeroFill: false,
                autoIncrement: false,
                style: { shadowBlur: 0, shadowColor: "green" },
                association_belong_id: null,
                association_has_id: [],
            },
            "058ca8d5-5167-4040-81af-0f5c6a1d9934": {
                coloumn_name: "name",
                comment: "",
                dataType: "TEXT",
                default: "",
                primaryKey: false,
                notNull: false,
                unique: false,
                foreignKey: false,
                unsigned: false,
                zeroFill: false,
                autoIncrement: false,
                style: { shadowBlur: 0, shadowColor: "green" },
                association_belong_id: null,
                association_has_id: [],
            },
            "590d2d29-4ce7-495a-beb0-3d019a473253": {
                coloumn_name: "patronymic",
                comment: "",
                dataType: "TEXT",
                default: "",
                primaryKey: false,
                notNull: false,
                unique: false,
                foreignKey: false,
                unsigned: false,
                zeroFill: false,
                autoIncrement: false,
                style: { shadowBlur: 0, shadowColor: "green" },
                association_belong_id: null,
                association_has_id: [],
            },
            "0cb79ff1-382b-4fea-bb9b-c41eb3f59e34": {
                coloumn_name: "id_ies_group",
                comment: "",
                dataType: "INTEGER",
                default: "",
                primaryKey: false,
                notNull: false,
                unique: false,
                foreignKey: true,
                unsigned: false,
                zeroFill: false,
                autoIncrement: false,
                style: { shadowBlur: 0, shadowColor: "#00D2FF" },
                association_belong_id: "assoc_Foreign_a9cc4bb3-f08c-45d7-9652-725be4f61767",
                association_has_id: [],
            },
            "cc88f304-7d7b-49b8-9f84-d32ef3141d7c": {
                coloumn_name: "user_name",
                comment: "",
                dataType: "TEXT",
                default: "",
                primaryKey: false,
                notNull: true,
                unique: true,
                foreignKey: false,
                unsigned: false,
                zeroFill: false,
                autoIncrement: false,
                style: { shadowBlur: 0, shadowColor: "green" },
                association_belong_id: null,
                association_has_id: [],
            },
            "44fac1ae-e045-4602-9741-a5ea07e42ef9": {
                coloumn_name: "password",
                comment: "",
                dataType: "TEXT",
                default: "",
                primaryKey: false,
                notNull: true,
                unique: false,
                foreignKey: false,
                unsigned: false,
                zeroFill: false,
                autoIncrement: false,
                style: { shadowBlur: 0, shadowColor: "green" },
                association_belong_id: null,
                association_has_id: [],
            },
        },
        association: {
            "assoc_Foreign_a9cc4bb3-f08c-45d7-9652-725be4f61767": {
                connector_id: "conn_car_number_driver_idb26b82c8-d673-4590-90c5-89b19fb4ab5c",
                type: "belong",
                table: "3559740f-4fc7-4a58-8088-a6813e22696b",
                table_id: "3559740f-4fc7-4a58-8088-a6813e22696b",
                foreignKey: "0cb79ff1-382b-4fea-bb9b-c41eb3f59e34",
                foreignKey_id: "0cb79ff1-382b-4fea-bb9b-c41eb3f59e34",
                targetKey: "coloumn_car_id_885ddad7_c509_4d5e_ab2e_dc5cb06d0e35",
                targetKey_id: "coloumn_car_id_885ddad7_c509_4d5e_ab2e_dc5cb06d0e35",
                point: { x: 0, y: 120 },
            },
        },
    },
};

console.log(toSQLite(diagram));
/******************************************************************
CREATE TABLE ies_group (
    id_ies_group INTEGER PRIMARY KEY AUTOINCREMENT,
    ies_group_name TEXT 
);


CREATE TABLE ies_user (
    id_ies_user INTEGER PRIMARY KEY AUTOINCREMENT,
    surname TEXT ,
    name TEXT ,
    patronymic TEXT ,
    id_ies_group INTEGER ,
    user_name TEXT  NOT NULL UNIQUE,
    password TEXT  NOT NULL,
    CONSTRAINT fk_ies_user_ies_group_1 FOREIGN KEY (id_ies_group) REFERENCES ies_group (id_ies_group)
);
*/

Increase allowed POST payload size

In the current implementation I got hit with a PayLoadTooLargeError that didn't become apparent until I reloaded one of my diagrams and I had lost a big chunk of my work.

This is what I did, in my own local environment, to make things work again:

diff --git a/backend/extension/core/event/onWebBeforeLoad.event.js b/backend/extension/core/event/onWebBeforeLoad.event.js
index a8e0211..527b3a0 100644
--- a/backend/extension/core/event/onWebBeforeLoad.event.js
+++ b/backend/extension/core/event/onWebBeforeLoad.event.js
@@ -44,7 +44,7 @@ module.exports = {
 
     await app.use(bodyParser.urlencoded({ extended: false }));
     console.log("ON yyy");
-    await app.use(bodyParser.json());
+    await app.use(bodyParser.json({limit: '100Mb'}));
     await app.use(bearerToken({
       headerKey: 'Bearer'
     }));

The change I did to the code isn't someting I recommend for anything going into production. I just set it to a very high value to avoid issues with this in the future.

Remove or comment out Google Tags/UA info from source

I can understand the need/want to track usage on a centrally hosted server for you as the code repository owner.

However, unless this can be easily overridden or if you have an intention to fully disclose the metrics collected or if you explain clearly what you intend to do with the data and how to easily remove it, I'd personally request this be removed or commented out from the source.

Oi

Obrigada pela otima aplicacao desenvolvida.

Can't move tables around.

Is there any option to move the tables around? I am trying to left click on table's header and then drag it but it doesn't work.

Error 500 when starting

Hi,

I encounter this problem when running npm run serve on the web interface :
image

Endpoint : http://localhost:8081/back-office/api/v1/account/read
Error : Proxy error: Could not proxy request /back-office/api/v1/account/read from localhost:8081 to http://localhost:81 (ECONNREFUSED).

Thanks for the help

Code is complex and need to refactor.

Many of bug code is fix. but i need every one can contribute in this project. But his project is like noodle and it make every one head danche to do it.

Mysql Import!

hello, thanks for this tool, can you add an import option to import tables from MySql.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.