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 with sqlx::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?).
It would be nice to be able to pass
DATABASE_URLas 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:
sqlx::SqlitePoolwithsqlx::AnyPoolsqlite:ENVentry to the Dockerfile to set a default and allow for overridesI gave it a shot locally, but I don't know enough about sqlx to make the swap. I ran into issues with the
query_scalarmacro 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?).