[Python] how to read sql database with polars

Discussão em 'Python' iniciado por Stack, Setembro 16, 2024.

  1. Stack

    Stack Membro Participativo

    i am trying to read sql database that contains a username and a password. I did:

    import polars as pl

    server = serveur # confidential
    user = user # confidential
    password = password # confidential
    database= database # confidential

    conn_str =f"mssql://{user}:{password}@{server}/{database}?encrypt=true"

    query = "SELECT * FROM [dbo].[my_table]"
    df = pl.read_database(query=query, connection_uri=conn_str)


    I get an error message which is :

    TypeError: read_database() got an unexpected keyword argument 'connection_uri'


    How is it then possible to read a sql database from polars

    Trying to read sql database from Polars

    Continue reading...

Compartilhe esta Página