@emmet-allen/cubejs-arango-driver
v0.2.0
Published
Cube.js arangodb driver
Maintainers
Readme
Website • Docs • Blog • Slack • Discourse • Twitter
Cube.js Arango Database Driver
Project is WIP. We've already used in our production but some Postgresql do not transpile to AQL because we don't use all of SQL statements in our product now.
npm i --save arangodb-cubejs-driver@npm:@emmet-allen/cubejs-arango-driverThe package is published as @emmet-allen/cubejs-arango-driver, but Cube loads a
community driver by requiring <CUBEJS_DB_TYPE>-cubejs-driver. Installing it under
the arangodb-cubejs-driver alias, as above, puts it where Cube looks for it and
keeps CUBEJS_DB_TYPE=arangodb working with no extra configuration.
If you would rather install the scoped name directly, you must wire the driver up
yourself with a driverFactory in cube.js:
const ArangoDbDriver = require('@emmet-allen/cubejs-arango-driver');
module.exports = {
driverFactory: () => new ArangoDbDriver({}),
};Requirements
- Node.js
>=20 - Cube
1.x(@cubejs-backend/base-driver^1.4.4) - ArangoDB
3.11+ (tested against3.12) - arangojs
10
What's in this repository
- ArangoDB driver in Typescript :heart:. Postgresql parser with pgsql-ast-parser.
- Docker image
ghcr.io/arango-solutions/cube:main. This is a custom image ofcubejs/cube:v1.4.4with@emmet-allen/cubejs-arango-driver
Usage
For Docker
Create custom image with Dockerfile
FROM cubejs/cube:v1.4.4
RUN cd /cube/conf \
&& npm init -y \
&& npm install --no-save arangodb-cubejs-driver@npm:@emmet-allen/cubejs-arango-driverThe driver installs into the /cube/conf/node_modules directory, which is on
Cube's NODE_PATH, so Cube loads the driver automatically. The minimal
package.json keeps the driver and its dependencies isolated from Cube's own
/cube/node_modules.
Note: This driver isn't supported by the front-end, so you can not use the
connection wizard to configure an ArangoDB data source. You must select it with
the CUBEJS_DB_TYPE=arangodb environment variable — Cube's config-file
dbType only accepts built-in database types, so a config-file value will not
resolve a community driver.
environment:
- CUBEJS_DB_URL=http://localhost:8529
- CUBEJS_DB_NAME=test
- CUBEJS_DB_USER=test
- CUBEJS_DB_PASS=test
- CUBEJS_DB_TYPE=arangodbArangoDB attribute names are case-sensitive. As in PostgreSQL, an unquoted
identifier folds to lowercase, so reference camelCase attributes with quotes in
your cube model, e.g. sql: '{CUBE}."countryOfDestination"'.
Other community drivers can find here @cubejs-driver
Development
Install dependencies and build:
npm ci
npm run buildTesting
The project has three test layers:
npm test # unit tests (SQL-to-AQL transpiler, type mapping)
npm run test:integration # driver against a real ArangoDB (testcontainers)
npm run test:e2e # full Cube server + ArangoDB via docker-compose.e2e.yml
npm run test:all # all of the aboveThe integration and e2e suites require a running Docker daemon. If your Docker
socket is non-standard (for example Rancher Desktop), point testcontainers at
it, e.g. export DOCKER_HOST="unix://$HOME/.rd/docker.sock".
License
Cube.js Arango driver is MIT licensed.
