dBizzy icon indicating copy to clipboard operation
dBizzy copied to clipboard

Preview database - do not show any entities and relations (SQLite)

Open amokmen opened this issue 4 years ago • 2 comments
trafficstars

Win10: VSCode 1.61.0, WSL Ubuntu

  1. Install extension.
  2. Run command "Preview database", choose *.sql file inside project folder.
  3. In new opened window "Preview Database" only 2 buttons and logo with title is shown.

SQLite:

CREATE TABLE IF NOT EXISTS tblWorkers (
    workerId INTEGER PRIMARY KEY AUTOINCREMENT,
    ctime INTEGER NULL
);

CREATE TABLE IF NOT EXISTS tblCards (
    cardId INTEGER PRIMARY KEY AUTOINCREMENT,
    cardHexNumber TEXT NOT NULL UNIQUE,
    personId INTEGER NOT NULL,
    FOREIGN KEY (personId) REFERENCES tblWorkers (workerId)
);

Problem is in 'AUTOINCREMENT' probably. Or in 'TEXT'. Or in foreign key.

amokmen avatar Oct 25 '21 14:10 amokmen

Thanks for letting us know - we'll look into this and hopefully have fixes by the next update!

mcl030 avatar Oct 27 '21 22:10 mcl030

same problem as OP. Ubuntu 22.04 using oracle SQL, no diagrams at all, figured out it was because CHECK and CONSTRAINT after removing them it would generate normal table. Also generates inline comments as attributes of table

Oracle SQL

CREATE TABLE CUSTOMER_ORDER (
    ORDER_ID INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
    DATE_ORDER TIMESTAMP NOT NULL,
    DATE_DEADLINE DATE NOT NULL,
    PRICE NUMBER(10,2) DEFAULT NULL,
    PAID NUMBER(1),                                         -- 0 not paid, 1 paid
    CUSTOMER_FK  INT NOT NULL,
    ADDRESS VARCHAR(255),

    CHECK(PAID IN (0,1)),

    CONSTRAINT CUSTOMER_CONSTRAINT FOREIGN KEY (CUSTOMER_FK) REFERENCES CUSTOMER (CUSTOMER_ID)
		ON DELETE SET NULL,
);

attach picture shows after removed CONSTRAINT and CHECK image

solumath avatar Mar 29 '23 19:03 solumath