Skip to content

Add support for arbirary database connection string #5

@dislogical

Description

@dislogical

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:

  1. Replace usages of sqlx::SqlitePool with sqlx::AnyPool
  2. Refactor the --database parameter to accept the full connection string, not just the part after sqlite:
  3. 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?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions