Skip to content

Allow to specify dialect/driver when calling get_connection_url #140

Closed

Description

@inikolaev

With latest SQLAlchemy 1.4 rolling out support for asyncio it would be great to support that in some way.

In order to use asyncio one needs to use a corresponding driver which is specified in the connection string, e.g.:

postgresql+asyncpg://scott:tiger@localhost/test

But in PostgresContainer it's currently hardcoded to:

postgresql+psycopg2

Don't know what the best solution could be:

  • Pass it as a constructor argument - but in this case there would be a limitation that get_connection_url will return fixed connection string, which this might not be a huge issue realistically, but feels odd, since container doesn't really care how we want to connect to it
  • Pass an argument to get_connection_url, but this messes up with an API provided by DbContainer and then other implementation should probably support this as well or at least ignore unknown parameters.

Activity

  1. orsolli commented on May 3, 2022

    @orsolli
    Contributor

    This is solved

  2. tillahoffmann commented on May 4, 2022

    @tillahoffmann
    Contributor

    #156 for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions