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('mapd://admin:HyperInteractive@localhost:6274/omnisci?'
... 'protocol=binary')
Connection(mapd://mapd:***@localhost:6274/mapd?protocol=binary)
>>> connect(user='admin', password='HyperInteractive', host='localhost',
... port=6274, dbname='omnisci')
>>> 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 54 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().
57 Create a new Connection.
67 protocol: {'binary', 'http', 'https'}
69 bin_cert_validate: bool, optional, binary encrypted connection only
70 Whether to continue if there is any certificate error
71 bin_ca_certs: str, optional, binary encrypted connection only
72 Path to the CA certificate file
74 EXPERIMENTAL Enable SAML authentication by providing
75 the logon page of the SAML Identity Provider.
76 idpformusernamefield: str
77 The HTML form ID for the username, defaults to 'username'.
78 idpformpasswordfield: str
79 The HTML form ID for the password, defaults to 'password'.
81 Enable / disable certificate checking, defaults to True.
89 You can either pass a string ``uri``, all the individual components,
90 or an existing sessionid excluding user, password, and database
92 >>> connect('mapd://admin:HyperInteractive@localhost:6274/omnisci?'
93 ... 'protocol=binary')
94 Connection(mapd://mapd:***@localhost:6274/mapd?protocol=binary)
96 >>> connect(user='admin', password='HyperInteractive', host='localhost',
97 ... port=6274, dbname='omnisci')
99 >>> connect(user='admin', password='HyperInteractive', host='localhost',
100 ... port=443, idpurl='https://sso.localhost/logon',
103 >>> connect(sessionid='XihlkjhdasfsadSDoasdllMweieisdpo', host='localhost',
104 ... port=6273, protocol='http')
116 bin_cert_validate=bin_cert_validate,
117 bin_ca_certs=bin_ca_certs,
119 idpformusernamefield=idpformusernamefield,
120 idpformpasswordfield=idpformpasswordfield,
121 idpsslverify=idpsslverify,