Connecting via pyocient
pyocient is a module that supports direct connections to in a Command Line Interface (CLI) as well as in Python programs that follow the Python Database API Specification 2.0. After you install pyocient, you can easily establish Ocient connections to run queries and commands.
pyocient is installed using pip.
pyocient is started by invoking it from the command line with a connection string. It includes many options to configure the connection and client similar to the JDBC driver. Learn more about supported options in the Ocient Python Module: pyocient.
In this example, assume a SQL node exists at 10.10.1.1, uses the default port 4050, and is setup with default self-signed certificates for TLS.
To connect to the system database, replace the example username and password with your credentials, set your IP address, and run the following command from your command line:
The -f table option instructs pyocient to output results as a table instead of JSON.
Example Response:
Success!
Next, run a simple query against the system tables:
Example Response:
For more details on using the pyocient driver, see the Ocient Python Module: pyocient.