Create a new Connection.
Parameters
----------
uri: str
user: str
password: str
host: str
port: int
dbname: str
protocol: {'binary', 'http', 'https'}
sessionid: str
bin_cert_validate: bool, optional, binary encrypted connection only
Whether to continue if there is any certificate error
bin_ca_certs: str, optional, binary encrypted connection only
Path to the CA certificate file
idpurl : str
EXPERIMENTAL Enable SAML authentication by providing
the logon page of the SAML Identity Provider.
idpformusernamefield: str
The HTML form ID for the username, defaults to 'username'.
idpformpasswordfield: str
The HTML form ID for the password, defaults to 'password'.
idpsslverify: str
Enable / disable certificate checking, defaults to True.
Returns
-------
conn: Connection
Examples
--------
You can either pass a string ``uri``, all the individual components,
or an existing sessionid excluding user, password, and database
>>> connect('heavydb://admin:HyperInteractive@localhost:6274/heavyai?'
... 'protocol=binary')
Connection(mapd://mapd:***@localhost:6274/mapd?protocol=binary)
>>> connect(user='admin', password='HyperInteractive', host='localhost',
... port=6274, dbname='heavyai')
>>> connect(user='admin', password='HyperInteractive', host='localhost',
... port=443, idpurl='https://sso.localhost/logon',
protocol='https')
>>> connect(sessionid='XihlkjhdasfsadSDoasdllMweieisdpo', host='localhost',
... port=6273, protocol='http')
Definition at line 51 of file connection.py.
Referenced by tests.conftest.con(), tests.test_cursor.mock_connection(), tests.test_connection.TestConnect.test_bad_binary_encryption_params(), tests.test_connection.TestConnect.test_bad_protocol(), tests.test_connection.TestURI.test_both_raises(), tests.test_connection.TestConnect.test_close(), tests.test_integration.TestIntegration.test_connect_binary(), tests.test_integration.TestIntegration.test_connect_http(), tests.test_integration.TestIntegration.test_connect_uri(), tests.test_integration.TestIntegration.test_connect_uri_and_others_raises(), tests.test_connection.TestConnect.test_host_specified(), tests.test_connection.TestConnect.test_raises_right_exception(), tests.test_connection.TestConnect.test_session_logon_failure(), and tests.test_connection.TestConnect.test_session_logon_success().
54 Create a new Connection.
64 protocol: {'binary', 'http', 'https'}
66 bin_cert_validate: bool, optional, binary encrypted connection only
67 Whether to continue if there is any certificate error
68 bin_ca_certs: str, optional, binary encrypted connection only
69 Path to the CA certificate file
71 EXPERIMENTAL Enable SAML authentication by providing
72 the logon page of the SAML Identity Provider.
73 idpformusernamefield: str
74 The HTML form ID for the username, defaults to 'username'.
75 idpformpasswordfield: str
76 The HTML form ID for the password, defaults to 'password'.
78 Enable / disable certificate checking, defaults to True.
86 You can either pass a string ``uri``, all the individual components,
87 or an existing sessionid excluding user, password, and database
89 >>> connect('heavydb://admin:HyperInteractive@localhost:6274/heavyai?'
90 ... 'protocol=binary')
91 Connection(mapd://mapd:***@localhost:6274/mapd?protocol=binary)
93 >>> connect(user='admin', password='HyperInteractive', host='localhost',
94 ... port=6274, dbname='heavyai')
96 >>> connect(user='admin', password='HyperInteractive', host='localhost',
97 ... port=443, idpurl='https://sso.localhost/logon',
100 >>> connect(sessionid='XihlkjhdasfsadSDoasdllMweieisdpo', host='localhost',
101 ... port=6273, protocol='http')
113 bin_cert_validate=bin_cert_validate,
114 bin_ca_certs=bin_ca_certs,
116 idpformusernamefield=idpformusernamefield,
117 idpformpasswordfield=idpformpasswordfield,
118 idpsslverify=idpsslverify,