caiiiycuk / postgresql-to-sqlite

pg2sqlite is easy to use solution to create sqlite database from postgresql dump
MIT License
132 stars 11 forks source link

bug: when having a table named "order" it fails to create #17

Closed scratchmex closed 11 months ago

scratchmex commented 1 year ago

when having a table named "order" it fails to create the table because the statement does not have the quotes

22:53:12.172 [main] ERROR com.github.caiiiycuk.pg2sqlite.Boot$ -
Create Table - Exception:
        [SQLITE_ERROR] SQL error or missing database (near "order": syntax error)
        [SQL] 'CREATE TABLE order ([id]);'
        [LINE #767] CREATE TABLE "order" (     id integer NOT NULL );,

the sql statement should be CREATE TABLE "order"

I fixed it by replacing "order" with "order_t"

scratchmex commented 11 months ago

just an off-topic follow-up on this. I ended up doing my implementation in rust for fun haha if you like to take a look I would appreciate it

https://github.com/scratchmex/pgdump2sqlite