Drivers
On this page
Python driver
Python 3.10+ (stdlib only — socket, ssl, decimal, json; no external dependencies). MIT. Package version 0.0.1. Driver package versions are independent of the engine version.
The distribution is bzync-nextsql; the import name is nextsql. Source: `drivers/python` — you can also vendor it straight from the tree (sys.path.insert(0, "drivers/python")).
Remote TLS:
For --require-client-key, pass key=client_root_32_bytes (a bytes object). Never put keys or passwords in a URL.
Types#
None ↔ SQL NULL; bool/int/float/decimal.Decimal/str map as expected (int/float/Decimal all encode as DECIMAL); uuid.UUID for UUID columns; datetime.datetime for TIMESTAMPTZ (naive datetimes are treated as UTC); a list[float] (or nextsql.Vector for sparse vectors) for VECTOR/SPARSEVECTOR; dict/list for JSON (encoded as a JSON string parameter, decoded from the server's binary JSON on the way back); nextsql.Point/Box/Line/Polygon for the WGS84 shapes; nextsql.Geometry for GEOMETRY/GEOGRAPHY; datetime.date / time plus nextsql.Interval for temporal values; nextsql.EnumValue / StructValue / MapValue for ENUM and collections. Field-encryption helpers are not in this driver.
Cluster routing#
nextsql.connect_cluster(nextsql.Config(nodes=[...], read_consistency=nextsql.READ_BOUNDED)) returns a Cluster that sends eligible reads to a healthy follower and everything else to the leader, failing over on a leader change. See HA / consistency.