SQream DB Python Driver

The SQream DB Python Driver (pysqream.py) is a native Python that can communicate with an existing SQream DB installation.

Features

  • Self contained
  • Works on Python 2.7+ or 3.4+
  • Uses standard library modules only, no external libraries needed

Requirements

Python 2.7 / 3.4+

While it'll probably work, this driver was not tested on Python2 versions below 2.7, and Python3 versions below 3.4

Getting started

Example code

import pysqream

con = pysqream.connector()

''' 
Order of paramteres and default values  for connect(): 
host='127.0.0.1', port=5000, database='master', user='sqream', password='sqream', clustered=False, timeout=10000 
'''

con.connect('192.168.0.44')  

q=con.query

q('create or replace table t(x int, y varchar(10))')   # or con.query(" ... ")
q("insert into t values (67, 'iddqd')")
q("select * from t")

result = con.cols_to_rows()     #after running a query with results
print(result)

# Output:  [(67, 'iddqd')]

con.close()

Notes

  • The connection instance holds results for the last query
  • The query command itself returns column objects
  • Use con.cols_to_rows() to get the actual results for the last query as a list of rows.
  • 137
  • 04-Jan-2018
  • 910 Views