Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuration of litedb root path #34

Open
loganmac opened this issue Sep 19, 2023 · 4 comments
Open

Allow configuration of litedb root path #34

loganmac opened this issue Sep 19, 2023 · 4 comments
Assignees

Comments

@loganmac
Copy link

I'm brand new to Litestack, I've just been playing with Rails + sqlite in production manually (setting the journal mode to WAL).

It would be nice if we could configure the Litesupport root outside of using an env variable so that I don't have to add yet another env variable to production, and it works the same as dev/staging.

What about using a Rails config initializer? If you are open to this idea, let's hash it out and then I'll create a PR for it.

@wolfgangrittner
Copy link

I ran into this too, and I share your sentiment of not wanting to add another env variable.
litestack defaults to using the app's db folder (see here), which is usually not shared between deploys.
Rails defaults to using the storage folder when you create a new app using sqlite as database, see here.

storage is usually shared across deploys one way or another, so would be a safer default that would just work out of the box for most setups I guess.

@oldmoe
Copy link
Owner

oldmoe commented Oct 23, 2023

I haven't had a chance to look into this issue for a good while, @loganmac and @wolfgangrittner , are you still interested in discussing a solution for this? I believe a configuration option for the root path is a good idea, my main concern would be that it needs to work with and without Rails

@oldmoe oldmoe self-assigned this Oct 23, 2023
@loganmac
Copy link
Author

I’m game! @wolfgangrittner is right in that the db/ folder is perhaps not as sensible a default as the storage/ folder for Rails 7, although with many cloud providers they supply disks that are usually recommended to be mounted to something like /var/data (I think, I’m a few months out of date from my last SQLite/rails app on Render/Fly).

I think a rails initializer that just called to the initialize options of the library would work pretty well.

@oldmoe
Copy link
Owner

oldmoe commented Oct 26, 2023

Yes, setting the environment explicitly could be an option.

I was also thinking of eventually deprecating the different .yml config files per component and instead introducing a global litestack.yml that would include both global and per component configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants