drawdb-io / drawdb

Free, simple, and intuitive online database diagram editor and SQL generator.
https://drawdb.app
GNU Affero General Public License v3.0
20.02k stars 1.42k forks source link

[BUG] Lack of semicolon makes import silent fail #244

Closed Igorgro closed 1 week ago

Igorgro commented 1 week ago

Describe the bug When create table statement does not end with semicolon, then app silently fails

To Reproduce Steps to reproduce the behavior: Try to import the following SQL code:

CREATE TABLE books (
    id INTEGER NOT NULL
) -- notice, there is no semicolon

Expected behavior Successful import (because there is only one statement) or explicit error about missing semicolon

Screenshots

Desktop (please complete the following information):

Additional context This is the error which is printed in devtools console:

Uncaught (in promise) TypeError: r.forEach is not a function
    at Rft (index-CYj_0oVy.js:579:32130)
    at Dft (index-CYj_0oVy.js:579:40234)
    at qr (index-CYj_0oVy.js:579:42056)
    at Object.Os [as onOk] (index-CYj_0oVy.js:579:42799)
    at Object.notifyOk (index-CYj_0oVy.js:54:89416)
    at jFe.handleOk (index-CYj_0oVy.js:54:72435)
    at handleOk (index-CYj_0oVy.js:54:86230)
    at Object.Mwe (index-CYj_0oVy.js:37:9896)
    at jwe (index-CYj_0oVy.js:37:10053)
    at Fwe (index-CYj_0oVy.js:37:10113)
1ilit commented 1 week ago

Please reopen if issue still persists