R
Railwayβ€’5mo ago
moolox

Easy SQLite Alternative?

My app is Node.JS + Express. I love SQLite but it apparently doesn't work with Railway because the data does not persist. Is there an extremely easy alternative that is very easy to use across multiple development PCs? SQLite was nice because I have a script that automatically populates the database when my app starts. I'm willing to pay for some kind of cloud hosted database if it's easy to copy/paste a database string. Postgres has been a nightmare trying to develop locally on multiple machines. Is there a cloud solution that makes Postgres easy? Looking to keep it extremely simple like SQLite.
Solution:
I got SQLite working by creating a "/database" volume and then using this database config in my server.js file: let db = new sqlite3.Database('/database/database.db'); This is resolved. Woohoo! Very happy with this πŸ™‚...
Jump to solution
16 Replies
Percy
Percyβ€’5mo ago
Project ID: N/A
Brody
Brodyβ€’5mo ago
you can use sqlite just fine on railway, all you need to do is save the sqlite database file into a railway volume https://docs.railway.app/guides/volumes
moolox
mooloxβ€’5mo ago
Thank you so much! I was looking in the database section of the docs and didn't see SQLite as an option. I'll give this a shot ❀️
Brody
Brodyβ€’5mo ago
been using a service that uses sqlite in a volume, redeployed multiple times and ive never had any issues
moolox
mooloxβ€’5mo ago
Fantastic
Brody
Brodyβ€’5mo ago
because sqlite isnt a database offering, its something your app creates itself!
moolox
mooloxβ€’5mo ago
That makes sense!
moolox
mooloxβ€’5mo ago
So, I'm following those docs but I think the app may have updated. I don't seem to have the option to create a storage volume?
No description
Brody
Brodyβ€’5mo ago
right click on the service
moolox
mooloxβ€’5mo ago
Is this the service? I tried here too but it won't accept anything when I try to make a volume
No description
moolox
mooloxβ€’5mo ago
I tried creating a blank service too but I can't seem to make a volume
Brody
Brodyβ€’5mo ago
you are now selected on what railway refers to as a service. what have you tried entering into the mount path pop up?
moolox
mooloxβ€’5mo ago
Ah, shoot. It just has to start with a slash. My bad been a long day πŸ˜‚
Brody
Brodyβ€’5mo ago
no worries!
Solution
moolox
mooloxβ€’5mo ago
I got SQLite working by creating a "/database" volume and then using this database config in my server.js file: let db = new sqlite3.Database('/database/database.db'); This is resolved. Woohoo! Very happy with this πŸ™‚
Brody
Brodyβ€’5mo ago
aswome, glad i could help!
Want results from more Discord servers?
Add your server
More Posts