{"id":47787893,"url":"https://github.com/krzysztofdusko/justybase_netezza_node_driver","last_synced_at":"2026-04-03T15:04:47.064Z","repository":{"id":339954035,"uuid":"1157801274","full_name":"KrzysztofDusko/justybase_netezza_node_driver","owner":"KrzysztofDusko","description":"node.js driver for Netezza database connectivity","archived":false,"fork":false,"pushed_at":"2026-03-16T18:17:18.000Z","size":540,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-17T05:14:05.478Z","etag":null,"topics":["database-connector","database-driver","driver","ibm-netezza","netezza","nodejs","sql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KrzysztofDusko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-14T10:15:07.000Z","updated_at":"2026-03-16T18:17:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/KrzysztofDusko/justybase_netezza_node_driver","commit_stats":null,"previous_names":["krzysztofdusko/justybase_netezza_node_driver"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/KrzysztofDusko/justybase_netezza_node_driver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrzysztofDusko%2Fjustybase_netezza_node_driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrzysztofDusko%2Fjustybase_netezza_node_driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrzysztofDusko%2Fjustybase_netezza_node_driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrzysztofDusko%2Fjustybase_netezza_node_driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KrzysztofDusko","download_url":"https://codeload.github.com/KrzysztofDusko/justybase_netezza_node_driver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrzysztofDusko%2Fjustybase_netezza_node_driver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31359104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T14:24:47.623Z","status":"ssl_error","status_checked_at":"2026-04-03T14:24:32.380Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database-connector","database-driver","driver","ibm-netezza","netezza","nodejs","sql"],"created_at":"2026-04-03T15:04:29.070Z","updated_at":"2026-04-03T15:04:44.786Z","avatar_url":"https://github.com/KrzysztofDusko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IBM Netezza / PureData Driver for Node.js (TypeScript)\n\n[![CI Status](https://github.com/KrzysztofDusko/netezza-driver/workflows/CI/badge.svg)](https://github.com/KrzysztofDusko/netezza-driver/actions)\n[![npm version](https://img.shields.io/npm/v/@justybase/netezza-driver.svg)](https://www.npmjs.com/package/@justybase/netezza-driver)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n[![Node.js](https://img.shields.io/node/v/@justybase/netezza-driver)](https://nodejs.org)\n\nA native, high-performance **TypeScript reimplementation** of the [JustyBase.NetezzaDriver](https://github.com/KrzysztofDusko/JustyBase.NetezzaDriver).\n\nIt allows for direct connection to IBM Netezza / PureData System for Analytics databases **without the need for ODBC drivers** or external dependencies.\n\n## Key Features\n\n- **Pure TypeScript**: No native bindings, no ODBC/CLI required.\n- **High Performance**: Optimized for large result sets using internal buffer pooling.\n- **ADO.NET Style API**: Familiar Connection/Command/Reader pattern.\n- **SSL/TLS Support**: Encrypted connections to Netezza/PureData.\n- **Strongly Typed**: Full TypeScript support for configuration and data handling.\n\n## Installation\n\n```bash\nnpm install @justybase/netezza-driver\n```\n\n## Quick Start\n\n```typescript\nimport { NzConnection } from '@justybase/netezza-driver';\n\nasync function example() {\n    const connection = new NzConnection({\n        host: 'your-nz-host',\n        database: 'system',\n        user: 'admin',\n        password: 'password',\n        // port: 5480, // default\n    });\n\n    await connection.connect();\n\n    try {\n        const reader = await connection\n            .createCommand('SELECT TABLENAME FROM _V_TABLE ORDER BY TABLENAME LIMIT 5')\n            .executeReader();\n\n        try {\n            while (await reader.read()) {\n                console.log(`Found table: ${reader.getString(0)}`);\n            }\n        } finally {\n            await reader.close();\n        }\n    } finally {\n        connection.close();\n    }\n}\n```\n\n## Design \u0026 lineage\n\nThis 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.\n\nImportant: 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.\n\n\u003e **Note**: The `node-netezza` package is included in this project specifically for **benchmarking** purposes, and `odbc` is included for **testing** purposes to ensure compatibility and correctness.\n\n## Testing\n\nThis package has two types of tests.\n\nRepository CI and local test tooling are currently validated on Node 22.x because the ODBC comparison dependency in the dev toolchain now requires Node \u003e=20. The published package `engines` field remains `\u003e=18.0.0`.\n\n### Smoke Tests (Fast)\n\nQuick validation tests that verify basic functionality. These tests run in ~1 second and are suitable for CI/CD pipelines and quick verification during development.\n\n```bash\nnpm test\n# or\nnpm run test:smoke\n```\n\n**What smoke tests cover:**\n- Basic connection establishment\n- Simple query execution (SELECT 1, SELECT 12345::BIGINT, etc.)\n- Core data type handling (integers, floats, strings, dates, NULL)\n- Reader API basic functionality\n- ODBC comparison for simple queries\n\n### Full Tests (Thorough)\n\nComprehensive test suite that validates all functionality against a real Netezza database. Requires the `NZ_DEV_PASSWORD` environment variable to be set.\n\n```bash\nnpm run test:full\n```\n\n**What full tests cover:**\n- All smoke tests plus:\n- Authentication scenarios\n- Query cancellation\n- External table operations (import/export)\n- Schema table retrieval\n- Transaction handling\n- Timeout handling\n- SSL connections\n- Multiple result sets\n- Error handling for invalid SQL\n- Stack overflow prevention\n- Comprehensive ODBC comparison tests\n- Query consistency across multiple executions\n\n### Test Requirements\n\nFor **full tests**, you need:\n1. A running Netezza database server\n2. Set the `NZ_DEV_PASSWORD` environment variable:\n   ```bash\n   # Windows (cmd)\n   set NZ_DEV_PASSWORD=your_password\n   \n   # Windows (PowerShell)\n   $env:NZ_DEV_PASSWORD=\"your_password\"\n   \n   # Linux/macOS\n   export NZ_DEV_PASSWORD=your_password\n   ```\n3. For the optional valid-certificate SSL test, set `NZ_SSL_CERT_PATH` to a trusted server certificate file. If it is not set, that one SSL test is skipped while the rest of the suite still runs.\n4. External-table tests and example scripts use `NZ_LOCAL_TMP_DIR` when it is set. Otherwise they fall back to the operating system temp directory.\n\n### Other Test Commands\n\n```bash\n# Run tests with debug output\nnpm run test:debug\n\n# Run specific test file\nnpx jest tests/BasicTests.test.js --config jest.config.js --runInBand\n```\n\n## Column Metadata\n\nUse the public metadata methods on `NzDataReader` when you need server type information. This avoids reaching into the internal `columnDescriptions` array just to recover provider OIDs, modifiers, or declared lengths.\n\n```typescript\nconst reader = await connection\n    .createCommand(`\n        SELECT\n            'AA'::NVARCHAR(32) AS NVC,\n            CURRENT_DATE AS CD\n        FROM JUST_DATA..DIMACCOUNT\n        LIMIT 1\n    `)\n    .executeReader();\n\nconst metadata = reader.getColumnMetadata(0);\nconsole.log(metadata.typeName); // NVARCHAR\nconsole.log(metadata.declaredTypeName); // NVARCHAR(32)\nconsole.log(metadata.providerType); // 2530\nconsole.log(metadata.typeModifier); // 48\nconsole.log(metadata.declaredLength); // 32\n\nconsole.log(reader.getProviderType(1)); // 1082\nconsole.log(reader.getTypeName(1)); // DATE\n```\n\nFor compatibility, `getTypeName()` continues to return canonical base names such as `VARCHAR`, `NVARCHAR`, `NCHAR`, `DATE`, and `TIMESTAMPTZ`. Use `getDeclaredTypeName()` or `getColumnMetadata()` when you also need declared lengths like `VARCHAR(32)`.\n\n## Value Conversion\n\nStarting in `2.0.0`, loose text-protocol queries and table-backed binary queries use the same JavaScript value contract whenever the server provides a known type OID.\n\n```typescript\nconst reader = await connection\n    .createCommand(`\n        SELECT\n            true::BOOLEAN AS ok,\n            '2024-12-11'::DATE AS d,\n            '2024-12-11 14:30:00'::TIMESTAMP AS ts,\n            12345::BIGINT AS id\n    `)\n    .executeReader();\n\nawait reader.read();\n\nconsole.log(reader.getValue(0)); // true\nconsole.log(reader.getValue(1) instanceof Date); // true\nconsole.log(reader.getValue(2) instanceof Date); // true\nconsole.log(typeof reader.getValue(3)); // bigint\n```\n\nThe main mappings are `BOOL -\u003e boolean`, `BYTEINT`/`INT2`/`INT4`/`OID -\u003e number`, `INT8 -\u003e bigint`, `DATE`/`TIMESTAMP`/`TIMESTAMPTZ`/`ABSTIME -\u003e Date`, `TIME -\u003e TimeValue`, and `NUMERIC -\u003e number | string` using the existing precision-preserving rule. Character types remain strings, and `INTERVAL`/`TIMETZ` remain string-formatted values. For schema inspection, `INT8` columns now report `DataType === BigInt` so metadata matches the runtime value contract.\n\n## Build\n\n```bash\nnpm run build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzysztofdusko%2Fjustybase_netezza_node_driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrzysztofdusko%2Fjustybase_netezza_node_driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrzysztofdusko%2Fjustybase_netezza_node_driver/lists"}