Registry / database / cubejs-hana-driver

cubejs-hana-driver

JSON →
library0.31.15jsnpmunverified

A community-supported driver for connecting Cube.js to SAP HANA databases, including SAP HANA Cloud and On-Premise HANA (tested on SP05). This package is part of the Cube.js ecosystem (v0.31.15) and allows Cube.js to query HANA as a data source. It is not officially maintained by the Cube.js core team; contributions and support are community-driven. The driver requires the @sap/hana-client package as a peer dependency. It supports Node.js versions 12, 14, and 16+ and includes TypeScript definitions. Use this driver to integrate HANA into your Cube.js analytics stack.

npm install cubejs-hana-driver
INSTALL
IMPORT
SIG · CUBEJS-HANA-DRIVER
C
cubejs-hana-driver
databasejavascriptv0.31.15
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
✓ import CubejsHanaDriver from 'cubejs-hana-driver';
✗ const CubejsHanaDriver = require('cubejs-hana-driver');
ESM default import is preferred; CommonJS require() also works but is less common in modern setups.
CubejsHanaDriver
✓ import CubejsHanaDriver from 'cubejs-hana-driver';
✗ import { CubejsHanaDriver } from 'cubejs-hana-driver';
The driver is exported as a default export, not a named export.
types
✓ import type { HanaDriverOptions, HanaDriverConfig } from 'cubejs-hana-driver';
Type imports for TypeScript users; access driver configuration types.

Shows how to configure Cube.js with SAP HANA driver using either JS config or environment variables, including required peer dependency installation.

// Install dependencies // npm install cubejs-hana-driver @sap/hana-client // cube.js configuration module.exports = { driverFactory: ({ dataSource }) => ({ type: 'hana', serverNode: process.env.CUBEJS_DB_HOST ?? 'your-instance.hana.cloud:443', uid: process.env.CUBEJS_DB_USER ?? '', pwd: process.env.CUBEJS_DB_PASS ?? '', }) }; // .env CUBEJS_DB_TYPE=hana CUBEJS_DB_HOST=<hana-instance>:443 CUBEJS_DB_USER=<user> CUBEJS_DB_PASS=<password> // Then run Cube.js as usual: npx cubejs-server
Debug
Known issues
gotchaThis package is community-supported and not officially maintained by Cube.js core team. Use at your own risk.
fix
Review the community support status before using in production; consider testing extensively.
affects: >=0.0.0
breakingThe driver expects '@sap/hana-client' as a peer dependency. Failure to install it will cause runtime errors when initializing the driver.
fix
Run `npm install @sap/hana-client` in your Cube.js project.
affects: >=0.0.0
deprecatedNode.js 12 and 14 are listed in engines but are EOL. Future versions may drop support.
fix
Upgrade to Node.js 16 or later.
affects: >=0.0.0
gotchaDriver configuration in cube.js uses 'serverNode', 'uid', 'pwd' keys, while environment variables use CUBEJS_DB_HOST, CUBEJS_DB_USER, CUBEJS_DB_PASS. Mixing these incorrectly may lead to connection failures.
fix
Stick to one configuration approach; environment variables are recommended.
affects: >=0.0.0
gotchaThe driver may not support all features of Cube.js, such as pre-aggregations or streaming, due to community maintenance.
fix
Check the driver's GitHub issues and source for known limitations.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module '@sap/hana-client'
Missing peer dependency @sap/hana-client.
fix
Run `npm install @sap/hana-client` in your Cube.js project directory.
Error: connect ECONNREFUSED <host>:<port>
Incorrect serverNode or HANA instance not accessible.
fix
Verify the HANA host, port, and network connectivity; check firewall settings.
Error: SAP HANA driver requires 'serverNode', 'uid', and 'pwd' to be set.
Driver configuration missing required fields.
fix
Ensure cube.js configuration includes serverNode, uid, pwd or set environment variables CUBEJS_DB_HOST, CUBEJS_DB_USER, CUBEJS_DB_PASS.
TypeError: driverFactory is not a function
Incorrect Cube.js configuration, possibly exporting an object instead of a function.
fix
Use module.exports = { driverFactory: ({ dataSource }) => ({ ... }) };
Upgrade
Version history
0.31.15latest on npm
Audit
Dependencies
@sap/hana-clientrequiredRequired for SAP HANA connectivity, setup connection and query execution.
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
cubejs-hana-driver — npm install cubejs-hana-driver · libregistry