The `hdb` package provides a pure JavaScript client for connecting to SAP HANA Cloud and SAP HANA Platform servers from Node.js applications. Currently at stable version 2.27.1, the library typically sees patch releases addressing bug fixes, dependency updates, and minor feature enhancements. While `hdb` is fully supported by SAP for existing projects, for new development, SAP strongly encourages the use of the `@sap/hana-client` driver, which offers a more comprehensive feature set including automatic reconnect, connection pooling, and client-side data encryption, features explicitly marked as absent in `hdb`. This differentiation positions `hdb` as a viable client for established applications but a less feature-rich option compared to its C++ based counterpart for new projects.
npm install hdbVerified import paths — ran on the pinned version, not inferred.
Demonstrates establishing an encrypted connection to SAP HANA, executing a simple SQL query, and handling errors and connection closure using environment variables for credentials.
Review the full changelog on GitHub for major version updates or consider migrating to `@sap/hana-client` for new feature development.
For new SAP HANA Node.js projects, evaluate the `@sap/hana-client` package. For existing `hdb` projects, understand the feature limitations and consider migrating if advanced features are required.
Ensure your Node.js environment has up-to-date root certificates. For older `hdb` versions, upgrade to at least `2.26.3` or configure `ca` options manually if connecting to servers using specific certificate authorities. Using `useTLS: true` can leverage Node.js's trusted certificates.
Upgrade to `hdb` version `2.26.2` or newer. Implement defensive checks to ensure `ResultSet` objects are valid and open before attempting to close them.
Upgrade to `hdb` version `2.26.1` or newer to resolve the `util.os_user` issue. Ensure your Docker containers are configured with appropriate permissions if custom OS user information is required.
Ensure your Node.js environment has the necessary root certificates. You can specify trusted CAs in the `createConnection` options using the `ca` property, or set `sslValidateCertificate: false` (not recommended for production). Upgrading `hdb` to `2.26.3` or higher can help as it includes additional fallback certificates.
For ESM, use `import hdb from 'hdb';`. For CommonJS, use `const hdb = require('hdb');`. Ensure you are not attempting to destructure `createConnection` directly if `hdb` only exports it as a property of its default export.Increase the `packetSize` and `packetSizeLimit` options in the `hdb.createConnection()` configuration. For example: `packetSize: Math.pow(2, 17), packetSizeLimit: Math.pow(2, 20)` to allow larger packets.
No dependency data recorded yet.