vertica_conn

In [ ]:
vertica_conn(section: str, 
             dsn: str = "")

Reads the input DSN and creates a connection to a Vertica database.

Parameters

Name Type Optional Description
section
str
Name of the section in the configuration file.
dsn
str
Path to the file containing the credentials. If empty, the ODBCINI environment variable will be used.

Returns

conn : Database connection

Example

In [2]:
from verticapy.connect import *
# Creating a cursor
cur = vertica_conn("VerticaDSN").cursor()
# Querying
cur.execute("SELECT version();")
Out[2]:
<vertica_python.vertica.cursor.Cursor at 0x1059ac4e0>
In [3]:
cur.fetchone()
Out[3]:
['Vertica Analytic Database v10.0.0-0']

See Also

new_auto_connection Saves a connection to automatically create DB cursors.
read_auto_connect Automatically creates a connection.