rugs
rugs copied to clipboard
Add support for arbirary database connection string
It would be nice to be able to pass DATABASE_URL
as an environment variable to the docker container in order to use an external database for enhanced robustness. This would allow us to run this tool in the cloud without requiring any on-disk persistence.
It seems like this should be possible by:
- Replace usages of
sqlx::SqlitePool
withsqlx::AnyPool
- Refactor the --database parameter to accept the full connection string, not just the part after
sqlite:
- Add an
ENV
entry to the Dockerfile to set a default and allow for overrides
I gave it a shot locally, but I don't know enough about sqlx to make the swap. I ran into issues with the query_scalar
macro returning a QueryScalar for the Sqlite driver and not the Any driver (I think this has to do with the files in the .sqlx folder?).