Database.connect

Database.connect(print_version: bool = False)[source]

Connects to the database.

If the connection was successful and the flag print was set, it also prints the database version as a connection check.

Parameters

print_version (bool, optional) – Print the database version, default is ‘False’.

Raises

psycopg2.Error – Base exception for all kind of database errors