docs / drivers-ruby
On this page
Ruby driver
Ruby 3.0+ (stdlib only — socket, openssl, bigdecimal, json; no gem dependencies). Path: `drivers/ruby`. Not published as a gem — require it from this tree directly.
Remote TLS:
For --require-client-key, pass key: client_root_32_bytes (a binary String). Never put keys or passwords in a URL.
Types
nil ↔ SQL NULL; true/false/Integer/Float/BigDecimal/String map as expected (Integer/Float/BigDecimal all encode as DECIMAL); a formatted String for UUID columns (no dedicated UUID class in the standard library); Time for TIMESTAMPTZ; an Array of numbers (or NextSQL::Vector for sparse vectors) for VECTOR/SPARSEVECTOR; Hash/Array 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 spatial types.
Cluster routing
NextSQL.connect_cluster(NextSQL::Config.new(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.