RamiAwar / dataline

Chat with your data - AI data analysis and visualization on CSV, Postgres, MySQL, Snowflake, SQLite...
https://dataline.app
GNU General Public License v3.0
502 stars 49 forks source link

Remove default pragma FK ON for migrations #261

Closed anthony2261 closed 1 month ago

anthony2261 commented 1 month ago

@RamiAwar Initial migration should not be affected because it's just creating tables and not data. The role of the pragma command is to enforce FK validation, not creating or removing constraints. I.E. if we have a table with a column that foreign keys to another table, this will always be the case regardless of the pragma FK status. The difference is that if the pragma is off, we are able to create an entry with a non-existing FK and sqlite will not throw an error, but if pragma is on we will get an error

RamiAwar commented 1 month ago

Add a contribution guide to the repository


anthony2261 commented 1 month ago

@RamiAwar would be good to include why the Pragma command was removed and more importantly what to lookout for if the contributor decides to add pragma fk on: the potential loss of data

RamiAwar commented 1 month ago

We should also include it in the PR description here (not just in the readme).

At this point SQLite needs it's own readme of gotchas lol. Maybe we link those articles somewhere. It's really a lot of headaches but the portability is worth it...