Expand description
Pure Rust driver for IBM Netezza / PureData System for Analytics.
1:1 port of the proven Node.js driver (@justybase/netezza-driver,
itself a TypeScript reimplementation of the C# JustyBase.NetezzaDriver).
The handshake, authentication (plain / MD5 / SHA256), dual text and binary
row formats, Netezza numeric decoding and the defensive protocol-sync logic
mirror the Node implementation byte for byte (validated against live
appliance captures).
The crate README contains the complete integration guide, including connection strings, pooling, metadata, bounded streaming, TLS, testing and the current C# / Node / Rust performance measurements.
Use Client in Tokio applications, blocking::Client in synchronous
code, and Pool or blocking::Pool when connections should be reused.
Older connection and reader APIs are available with the compat feature.
§Quick start
use nz_rust::{Client, NzConnectionConfig};
let config = NzConnectionConfig::new("nz-host", "JUST_DATA", "admin", "secret");
let (client, connection) = Client::connect(&config).await?;
let driver = tokio::spawn(connection);
let row = client.query_one("SELECT 1 AS one", &[]).await?;
let value: i32 = row.try_get("one")?;
println!("{value}");
client.close().await?;
driver.await??;Re-exports§
pub use config::parse_connection_string;pub use config::ConfigBuilder;pub use config::NzConnectionConfig;pub use config::SecurityLevel;pub use error::NzDatabaseError;pub use error::NzError;pub use error::NzResult;pub use export::render_value;pub use export::result_to_text;pub use export::write_result_to_txt;pub use export::TextExportSink;pub use native_async::connect;pub use native_async::Client;pub use native_async::Connection;pub use native_async::QueryEventStream;pub use native_async::QueryOptions;pub use native_async::QueryStreamEvent;pub use native_async::RowBatchStream;pub use native_async::RowStream;pub use native_async::Transaction;pub use params::substitute_bound_parameters;pub use params::NzParameter;pub use tuple_desc::ColumnDesc;pub use tuple_desc::DbosTupleDesc;pub use types::value::FromSql;pub use types::value::FromSqlRaw;pub use types::value::NzValue;pub use types::value::RawValue;pub use types::value::ToSql;pub use types::exact_numeric::NzNumeric;pub use external::ExternalFilePolicy;pub use types::temporal::NzDate;pub use types::temporal::NzInterval;pub use types::temporal::NzTime;pub use types::temporal::NzTimestamp;pub use types::temporal::NzTimetz;
Modules§
- blocking
- Blocking client with the same query semantics as the native async client.
- buffer
- Growable stream read buffer — port of the Node driver’s internal
_intBuf/_ensureBufferCapacity/_ensureBufferDatamachinery. - cancel
- Out-of-band query cancellation — port of the Node driver
cancel(). - config
- Connection configuration and
netezza:///nz://URI parsing. - error
- Driver error types.
- export
- Plain-text result export.
- external
- Explicit permission for server-requested external-table filesystem access.
- handshake
- Connection handshake — faithful port of the Node driver
Handshake.ts(itself ported from C#Handshake.cs/ nzpy). - messages
- Backend message codes and small protocol helpers.
- native_
async - Native Tokio transport and a tokio-postgres-shaped client facade.
- params
- Client-side SQL parameter substitution for Netezza.
- tuple_
desc - Binary tuple descriptor — port of C#
DbosTupleDesc.cs/ NodeDbosTupleDesc.tsplus the sharedColumnDescmetadata type. - types
Structs§
- Async
Metadata - Catalog helpers borrowing a native client.
- Catalog
Snapshot - Related catalog lists retrieved in one protocol request.
- Client
Type Id - Netezza client type identifiers sent during the handshake.
- Decimal
Decimalrepresents a 128 bit representation of a fixed-precision decimal number. The finite set of values of typeDecimalare of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.- NzColumn
Info - NzConstraint
Info - NzDatabase
Info - NzDdl
Batch Result - One batch DDL result; error is set when reconstruction failed.
- NzDetailed
Column Info - Column definition and optional comments used for DDL reconstruction.
- NzDistribution
KeyInfo - NzFunction
Info - NzGroup
Info - Group identity returned by the catalog.
- NzObject
Detail Info - NzObject
Info - NzOrganize
KeyInfo - NzProcedure
Info - NzQuery
History Info - Available query history fields; absent values remain None.
- NzSequence
Info - Sequence identity returned by the catalog.
- NzSession
Info - NzSynonym
Info - NzTable
Info - NzTable
KeyInfo - Table constraint metadata, including referenced columns for foreign keys.
- NzTable
Size Info - NzUser
Info - User identity returned by the catalog.
- NzView
Info - Pool
- Pool for the standard native API (
queryreturns rows,query_multireturns sets). - Pooled
RowStream - Pooled
Transaction - Query
Result - Buffered result of
crate::Client::query_multi: every result set of a (possibly multi-statement) batch, the accumulated affected-row count and the server notices collected while draining the response. - Result
Set - One result set: the rows of a single statement plus its column metadata.
- Row
- One result row with column metadata and lazily materialized values.
- Stream
Result Set - Stream
Summary - Metadata and counters returned after a streaming execution.
Traits§
- Query
Stream Sink - Receives rows while the protocol response is being decoded.
- RowIndex
- Index into a
Rowby ordinal or (case-insensitive) column name.
Functions§
- normalize_
client_ type - Sanity clamp for a client-supplied client type (port of
normalizeClientType).