Skip to main content

Crate nz_rust

Crate nz_rust 

Source
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 / _ensureBufferData machinery.
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 / Node DbosTupleDesc.ts plus the shared ColumnDesc metadata type.
types

Structs§

AsyncMetadata
Catalog helpers borrowing a native client.
CatalogSnapshot
Related catalog lists retrieved in one protocol request.
ClientTypeId
Netezza client type identifiers sent during the handshake.
Decimal
Decimal represents a 128 bit representation of a fixed-precision decimal number. The finite set of values of type Decimal are 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.
NzColumnInfo
NzConstraintInfo
NzDatabaseInfo
NzDdlBatchResult
One batch DDL result; error is set when reconstruction failed.
NzDetailedColumnInfo
Column definition and optional comments used for DDL reconstruction.
NzDistributionKeyInfo
NzFunctionInfo
NzGroupInfo
Group identity returned by the catalog.
NzObjectDetailInfo
NzObjectInfo
NzOrganizeKeyInfo
NzProcedureInfo
NzQueryHistoryInfo
Available query history fields; absent values remain None.
NzSequenceInfo
Sequence identity returned by the catalog.
NzSessionInfo
NzSynonymInfo
NzTableInfo
NzTableKeyInfo
Table constraint metadata, including referenced columns for foreign keys.
NzTableSizeInfo
NzUserInfo
User identity returned by the catalog.
NzViewInfo
Pool
Pool for the standard native API (query returns rows, query_multi returns sets).
PooledRowStream
PooledTransaction
QueryResult
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.
ResultSet
One result set: the rows of a single statement plus its column metadata.
Row
One result row with column metadata and lazily materialized values.
StreamResultSet
StreamSummary
Metadata and counters returned after a streaming execution.

Traits§

QueryStreamSink
Receives rows while the protocol response is being decoded.
RowIndex
Index into a Row by ordinal or (case-insensitive) column name.

Functions§

normalize_client_type
Sanity clamp for a client-supplied client type (port of normalizeClientType).

Type Aliases§

PoolConfig