Connect to Ocient
Connect Using pyocient
the {{ocient}} {{python}} module pyocient supports direct connections to ocient systems 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 establish ocient connections to run queries and commands installation tutorial to install and run pyocient , follow these steps install pyocient install pyocient using pip pip3 install pyocient after running the pip install, pyocient is installed in the bin directory use venv to install pyocient using a virtual environment for more information, see the python venv documentation start pyocient pyocient is started 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 docid\ bi n4be0tvikotwhafxxr after installation, you can launch from a command line by typing the pyocient command pyocient ocient //example user\ example password\@10 10 1 1/system to connect to the system database, replace the example username ( example user ) and password ( example password ) with your credentials, set your ip address, t he connection example assume a sql node exists at 10 10 1 1 the example uses the default port 4050 , and is set up with default self signed certificates for tls example response ocient database™ system version \<ocient system version>, client version \<pyocient version> \> use the command quit; to exit the pyocient cli interface run a query in the pyocient cli, you can run any sql query supported by your database in this example, a query is selecting rows from the system tables select from sys tables; you can also run queries from the command line with the connection string pyocient ocient //example user\ example password\@10 10 1 1/system 'select from sys tables' example response \[ { "id" "359e21b1 770a 4860 aec9 f158d307f725", "name" "data type coverage", "schema" "loading", "database id" "f827ff7c dd94 43bf 8386 93d048344a32", "storage space id" "2ad08e7c 15d1 4861 b38b 256c4df4a191", "maximum segment size gib" 4, "description" null, "streamloader property string" null, "created at" "2023 08 08t21 22 49 622213" } ] the system cancels any queries made with the pyocient driver if you perform any of these actions fetch the entire result set close the connection execute a new query using the same connection for more information and api reference material for pyocient, see the ocient python module pyocient docid\ bi n4be0tvikotwhafxxr page related links connect to ocient docid\ lb5x4qrnpht6m9v2evhuc ocient integrations docid\ slds1ecb2mcriy 4z 6my