[Python] Connection string to read and write database with different engines

Discussão em 'Python' iniciado por Stack, Agosto 28, 2025.

  1. Stack

    Stack Membro Participativo

    In polars, there is the engine connextorx for pl.read_database_uri and adbc for pl.write_database. Unfortunately, it's not supported to use the engine adbc to both read and write. In the case of a postgresql database: Is it possible to use the same connection string for both engines when the connection string looks as follows?

    "postgresql://scott:tiger@localhost:5432/mydatabase?options=-c%20default_transaction_read_only%3DTrue"


    The essential part is that read_only should be True. I just know that adbc accepts the part options=-c%20default_transaction_read_only%3DTrue. If it is not possible to use such a connection string for both engines, what would be the closest alternative?

    Continue reading...

Compartilhe esta Página