dBizzy
dBizzy copied to clipboard
Preview database - do not show any entities and relations (SQLite)
trafficstars
Win10: VSCode 1.61.0, WSL Ubuntu
- Install extension.
- Run command "Preview database", choose *.sql file inside project folder.
- 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.
Thanks for letting us know - we'll look into this and hopefully have fixes by the next update!
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
