Loading...

vastorbit.connection.connect

vastorbit.connection.connect(section: str, dsn: str | None = None) None

Connects to the database.

Parameters:
  • section (str) – Name of the section in the configuration file.

  • dsn (str, optional) – Path to the file containing the credentials. If empty, the Connection File will be used.

Examples

Display all available connections:

from vastorbit.connection import available_connections

available_connections()

['VML', 'VASTDSN', 'VASTDSN_test']

Connect using the VASTDSN connection:

from vastorbit.connection import connect

connect("VASTDSN")

See also

available_connections() : Displays all available connections.
get_connection_file() : Gets the vastorbit connection file.
new_connection() : Creates a new vastorbit connection.
set_connection() : Sets the vastorbit connection.