npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ibm-netezza

v1.0.6

Published

Node.js driver for IBM Netezza databases with full protocol support

Readme

Netezza Node.js Driver

Repository: https://github.com/IBM/nz-node

A Node.js driver for IBM Netezza databases, implementing IBM's proprietary Netezza protocol.

Installation

npm install ibm-netezza

Features

  • Data Type Support: Support for all standard Netezza data types.
  • Full Netezza Protocol Support: Implements CP_VERSION_2 through CP_VERSION_6
  • Multiple Authentication Methods:
    • Plain password (AUTH_REQ_PASSWORD)
    • MD5 hashed password (AUTH_REQ_MD5)
    • SHA256 hashed password (AUTH_REQ_SHA256)
  • Transaction support: Begin, Commit, Rollback
  • SSL/TLS Support: Configurable security levels (0)
  • Guardium Audit Integration: Automatically sends client metadata for audit logging
  • Promise and Callback APIs: Flexible async patterns

Quick Start

Basic Connection

const { Client } = require('ibm-netezza')

const client = new Client({
  host: 'netezza-host.example.com',
  port: 5480,  // Default Netezza port
  database: 'mydb',
  user: 'myuser',
  password: 'mypassword'
})

try {
  await client.connect()
  const result = await client.query('SELECT * FROM my_table;')
  console.log(result.rows)
} catch (err) {
  console.error('Error:', err.message)
} finally {
  await client.end()
}



## Configuration Options

### Connection Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `host` | string | 'localhost' | Netezza server hostname |
| `port` | number | 5480 | Netezza server port |
| `database` | string | - | Database name |
| `user` | string | - | Username |
| `password` | string | - | Password |
| `securityLevel` | number | 0 | SSL/TLS security level |


### Security Levels

- **0**: Preferred Unsecured (default) - Try SSL, fall back to unsecured

### Result Object

```javascript
{
  rows: [],        // Array of row objects
  rowCount: 0,     // Number of rows
  command: 'SELECT', // SQL command
  notices: []      // Array of notice messages from server
}

Handling Notices

Netezza servers can send notice messages (warnings, informational messages) during query execution. These are available in the result object:

try {
  const result = await client.query('SHOW AUTOMAINT')
  console.log('Query result:', result.rows)

  // Check for notices
  if (result.notices && result.notices.length > 0) {
    result.notices.forEach(notice => {
      console.log('Notice:', notice.message)
    })
  }
} catch (err) {
  console.error('Error:', err.message)
}

Examples

CRUD Operations

Create (INSERT)

const { Client } = require('ibm-netezza')
const client = new Client({
  host: 'localhost',
  port: 5480,
  database: 'mydb',
  user: 'admin',
  password: 'password'
})

try {
  await client.connect()
  
  // Insert single row
  const result = await client.query(`
    INSERT INTO users (id, name, email)
    VALUES (1, 'John Doe', '[email protected]');
  `)
  console.log('Rows inserted:', result.rowCount)
} catch (err) {
  console.error('Error:', err.message)
} finally {
  await client.end()
}

Read (SELECT)

try {
  await client.connect()
  
  // Select all rows
  const allUsers = await client.query('SELECT * FROM users;')
  console.log('All users:', allUsers.rows)
  
  // Select with WHERE clause
  const specificUser = await client.query(`
    SELECT * FROM users WHERE id = 1;
  `)
  console.log('User:', specificUser.rows[0])
} catch (err) {
  console.error('Error:', err.message)
  
} finally {
  await client.end()
}

Update (UPDATE)

try {
  await client.connect()
  
  // Update single row
  const result = await client.query(`
    UPDATE users
    SET email = '[email protected]'
    WHERE id = 1;
  `)
  console.log('Rows updated:', result.rowCount)
  
  // Update multiple rows
  await client.query(`
    UPDATE users
    SET status = 'active'
    WHERE id = 2;
  `)
} catch (err) {
  console.error('Error:', err.message)
} finally {
  await client.end()
}

Delete (DELETE)

try {
  await client.connect()
  
  // Delete specific row
  const result = await client.query(`
    DELETE FROM users WHERE id = 3;
  `)
  console.log('Rows deleted:', result.rowCount)
  
  // Delete with condition
  await client.query(`
    DELETE FROM logs WHERE id = 4;
  `)
} catch (err) {
  console.error('Error:', err.message)
} finally {
  await client.end()
}

Transactions

const client = new Client({
    host: 'localhost',
    port: '5480'),
    database: 'system',
    user: 'admin',
    password: 'password',
    debug: false,
  })

try {
  await client.connect()
  await client.query('BEGIN')
  
  await client.query("INSERT INTO transaction_test VALUES (1, 'A', 'tr1')")
  await client.query("INSERT INTO transaction_test VALUES (2, 'B', 'tr2')")
  
  await client.query('COMMIT')
  console.log('Transaction committed')
} catch (e) {
  await client.query('ROLLBACK')
  console.error('Transaction rolled back', e.message)
} finally {
  await client.end()
}

Error Handling

try {
  await client.query('SELECT * FROM nonexistent_table;')
} catch (err) {
  console.error('Query error:', err.message)
}

Debugging

Enable debug mode to see detailed handshake information:

const client = new Client({
  host: 'netezza-host.example.com',
  port: 5480,
  database: 'mydb',
  user: 'myuser',
  password: 'mypassword',
  debug: true  // Enable debug logging
})

This will output:

  • Handshake version negotiation
  • Protocol version selection
  • Authentication method used
  • Connection state changes

Authentication Failures

  • Verify username and password
  • Check user has database access
  • Ensure authentication method is supported

Compatibility

  • Node.js: Requires Node.js 22.15.0
  • Netezza: Compatible with Netezza Performance Server (NPS) versions supporting CP_VERSION_2-6
  • PostgreSQL: NOT COMPATIBLE - This is a Netezza-only driver

Support

For issues and questions:

Contribution and help

All bug reports, feature requests and contributions are welcome at https://github.com/IBM/nz-node

If you have any questions or issues you can create a new issue here.

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

Fork the repo (git clone https://github.com/IBM/nz-node.git) Create your feature branch (git checkout -b my-new-feature) Commit your changes (git commit -am 'Added some feature') Push to the branch (git push origin my-new-feature) Create new Pull Request

References