@justybase/netezza-driver
v1.1.0
Published
Native TypeScript driver for IBM Netezza / PureData System for Analytics
Maintainers
Readme
IBM Netezza / PureData Driver for Node.js (TypeScript)
A native, high-performance TypeScript reimplementation of the JustyBase.NetezzaDriver.
It allows for direct connection to IBM Netezza / PureData System for Analytics databases without the need for ODBC drivers or external dependencies.
Key Features
- Pure TypeScript: No native bindings, no ODBC/CLI required.
- High Performance: Optimized for large result sets using internal buffer pooling.
- ADO.NET Style API: Familiar Connection/Command/Reader pattern.
- SSL/TLS Support: Encrypted connections to Netezza/PureData.
- Strongly Typed: Full TypeScript support for configuration and data handling.
Installation
npm install @justybase/netezza-driverQuick Start
import { NzConnection, NzCommand } from '@justybase/netezza-driver';
async function example() {
const connection = new NzConnection({
host: 'your-nz-host',
database: 'system',
user: 'admin',
password: 'password',
// port: 5480, // default
});
try {
await connection.open();
const command = new NzCommand('SELECT * FROM _v_table WHERE tablename LIKE ?', connection);
command.parameters.push('CUSTOMER%');
const reader = await command.executeReader();
while (await reader.read()) {
const tableName = reader.getValue(0);
console.log(`Found table: ${tableName}`);
}
} finally {
await connection.close();
}
}Design & lineage
This driver exposes an API and usage patterns inspired by ADO.NET: connection/command/reader abstractions, predictable lifecycle management, and an explicit approach to connection and command disposal. The design mirrors common C# database client patterns to make the library familiar to developers coming from .NET.
Important: this project is an independent TypeScript implementation and does not reuse code from the node-netezza package. The functional and architectural inspiration comes from the C# implementation referenced above; that C# project is cited as a design reference in this repository.
Note: The
node-netezzapackage is included in this project specifically for benchmarking purposes, andodbcis included for testing purposes to ensure compatibility and correctness.
Testing
This package has two types of tests:
Smoke Tests (Fast)
Quick validation tests that verify basic functionality. These tests run in ~1 second and are suitable for CI/CD pipelines and quick verification during development.
npm test
# or
npm run test:smokeWhat smoke tests cover:
- Basic connection establishment
- Simple query execution (SELECT 1, SELECT 12345::BIGINT, etc.)
- Core data type handling (integers, floats, strings, dates, NULL)
- Reader API basic functionality
- ODBC comparison for simple queries
Full Tests (Thorough)
Comprehensive test suite that validates all functionality against a real Netezza database. Requires the NZ_DEV_PASSWORD environment variable to be set.
npm run test:fullWhat full tests cover:
- All smoke tests plus:
- Authentication scenarios
- Query cancellation
- External table operations (import/export)
- Schema table retrieval
- Transaction handling
- Timeout handling
- SSL connections
- Multiple result sets
- Error handling for invalid SQL
- Stack overflow prevention
- Comprehensive ODBC comparison tests
- Query consistency across multiple executions
Test Requirements
For full tests, you need:
- A running Netezza database server
- Set the
NZ_DEV_PASSWORDenvironment variable:# Windows (cmd) set NZ_DEV_PASSWORD=your_password # Windows (PowerShell) $env:NZ_DEV_PASSWORD="your_password" # Linux/macOS export NZ_DEV_PASSWORD=your_password
Other Test Commands
# Run tests with debug output
npm run test:debug
# Run specific test file
npx jest tests/BasicTests.test.js --config jest.config.js --runInBandBuild
npm run build