3 ms·
Haha awesome! Good to see lots of people are starting to see SQLite as an option, I think it used to be misunderstood as a toy database. It'll take some time b
by harryvederci 4y ago
Haha awesome! Good to see lots of people are starting to see SQLite as an option, I think it used to be misunderstood as a toy database.
It'll take some time before I can really recommend this workflow, I'll make sure to add a blog to the withoutdistractions.com platform soon. I didn't expect this to hit the front page as it's my first "Show HN", otherwise I would have created one up front with an RSS feed.
For me I went from Postgres to one central SQLite file to the current approach. I don't what the best approach would be, but I just put a user id column in every table and instead of having an integer primary key, I have a primary key of user id + table id. Then I have some Janet logic in place to get all table + column names except for a few private ones from the user's DB file, and put those in the "global" DB file.
If anyone knows a better way to do this I'm all ears! I think SQLite has some kind of native way now to merge DB files with the same schema as well, but I think there was some limitation on the amount of tables you could apply this to. Not 100% sure, though.