Code Monkey home page Code Monkey logo

cubejs-arangodb-driver's Introduction

cubejs-arangodb-driver's People

Contributors

panoti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tokarenko

cubejs-arangodb-driver's Issues

Unsupported db type: arangodb with cube:latest (0.30.39)

ghcr.io/panoti/cube:main seems to be inoperable with the latest (0.30.39) Cube version.

Error while loading DB schema
Error: Unsupported db type: arangodb
at Object.driverDependencies (/cube/node_modules/@cubejs-backend/server-core/src/core/DriverResolvers.ts:24:9)
at Object.lookupDriverClass (/cube/node_modules/@cubejs-backend/server-core/src/core/DriverResolvers.ts:36:5)
at Function.createDriver (/cube/node_modules/@cubejs-backend/server-core/src/core/DriverResolvers.ts:50:23)
at CubejsServerCore.resolveDriver (/cube/node_modules/@cubejs-backend/server-core/src/core/server.ts:750:28)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at CubejsServerCore.getDriver (/cube/node_modules/@cubejs-backend/server-core/src/core/server.ts:723:22)
at /cube/node_modules/@cubejs-backend/server-core/src/core/DevServer.ts:108:22
at /cube/node_modules/@cubejs-backend/server-core/src/core/DevServer.ts:78:9

I would be grateful if you could help to resolve the issue.

Can't find dialect for 'ArangoDB' data source: arangodb

Dear Thanh, thank you for updating the driver and integrating my contributions! I am unable to get it working though...

[email protected] with cube:latest (0.33.41) and cube:v0.30.39 raises the following error when running any query via GUI:

Can't find dialect for 'ArangoDB' data source: arangodb
Error: Can't find dialect for 'ArangoDB' data source: arangodb
    at CompilerApi.getSql (/cube/node_modules/@cubejs-backend/server-core/src/core/CompilerApi.js:138:15)
    at /cube/node_modules/@cubejs-backend/api-gateway/src/gateway.ts:1306:28
    at async Promise.all (index 0)
    at ApiGateway.getSqlQueriesInternal (/cube/node_modules/@cubejs-backend/api-gateway/src/gateway.ts:1302:24)
    at ApiGateway.load (/cube/node_modules/@cubejs-backend/api-gateway/src/gateway.ts:1529:26)
    at /cube/node_modules/@cubejs-backend/api-gateway/src/gateway.ts:245:7

Please find below my cube.js configuration for dual DB. It works with image: ghcr.io/panoti/cube:main. For v0.1.0 I commented lines with "Object.setPrototypeOf" that were needed for v0.0.5 to load the driver.

const PostgresDriver = require('@cubejs-backend/postgres-driver').PostgresDriver;
const arango_db_driver = require("arangodb-cubejs-driver/dist/arangodb-driver.js").ArangoDbDriver;
const base_driver = require("@cubejs-backend/query-orchestrator").BaseDriver;

module.exports = {
  dbType: ({ dataSource }) => {
    switch (dataSource) {
      case 'ArangoDB': return process.env.CUBEJS_DB_ARANGO_TYPE;
      default: return process.env.CUBEJS_DB_TYPE;
    }
  },

  driverFactory: ({ dataSource }) => {
    switch(dataSource) {
      case 'ArangoDB':
        //Object.setPrototypeOf(arango_db_driver.prototype,base_driver.prototype)
    
        return new arango_db_driver({
          url: process.env.CUBEJS_DB_ARANGO_URL,
          databaseName: process.env.CUBEJS_DB_ARANGO_NAME,
          auth: {
            username: process.env.CUBEJS_DB_ARANGO_USER,
            password: process.env.CUBEJS_DB_ARANGO_PASS,
          },
        });
      default:
        //Object.setPrototypeOf(PostgresDriver.prototype,base_driver.prototype)
        return new PostgresDriver({
        //type: process.env.CUBEJS_DB_TYPE,
        host: process.env.CUBEJS_DB_HOST,
        port: process.env.CUBEJS_DB_PORT,
        database: process.env.CUBEJS_DB_NAME,
        user: process.env.CUBEJS_DB_USER,
        password: process.env.CUBEJS_DB_PASS,
      });
    }
  },
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.