onstove.OnStove.set_postgres#

OnStove.set_postgres(dbname: str, user: str, password: str)#

Wrapper function to set a connection to a PostgreSQL database using the psycopg2.connect class.

It stores the connection into the conn attribute, which can be used to read layers directly from the database.

Warning

The PostgreSQL database connection is only functional for vector layers. Compatibility with raster layers will be available in future releases.

Parameters:
dbname: str

name of the database.

user: str

User name of the postgres connection.

password: str

Password to authenticate the user.