Socket
Socket
Sign inDemoInstall

@cubejs-client/core

Package Overview
Dependencies
Maintainers
3
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cubejs-client/core

cube.js client


Version published
Weekly downloads
115K
decreased by-16.76%
Maintainers
3
Weekly downloads
 
Created

Package description

What is @cubejs-client/core?

@cubejs-client/core is a JavaScript client for Cube.js, an open-source analytical API platform. It allows developers to query and interact with Cube.js to build analytical applications. The package provides functionalities for querying data, managing sessions, and handling real-time updates.

What are @cubejs-client/core's main functionalities?

Querying Data

This feature allows you to query data from Cube.js. The code sample demonstrates how to load data with specific measures, time dimensions, and other dimensions.

const cubejs = require('@cubejs-client/core');
const cubejsApi = cubejs('YOUR-CUBEJS-API-TOKEN');

cubejsApi.load({
  measures: ['Orders.count'],
  timeDimensions: [{
    dimension: 'Orders.createdAt',
    dateRange: ['2020-01-01', '2020-12-31']
  }],
  dimensions: ['Orders.status']
}).then(resultSet => {
  console.log(resultSet.tablePivot());
});

Managing Sessions

This feature allows you to manage sessions with Cube.js. The code sample shows how to request a session and log the session ID.

const cubejs = require('@cubejs-client/core');
const cubejsApi = cubejs('YOUR-CUBEJS-API-TOKEN');

cubejsApi.requestSession().then(session => {
  console.log('Session ID:', session.id);
});

Handling Real-Time Updates

This feature allows you to handle real-time updates from Cube.js. The code sample demonstrates how to subscribe to data changes and handle updates using a callback function.

const cubejs = require('@cubejs-client/core');
const cubejsApi = cubejs('YOUR-CUBEJS-API-TOKEN');

cubejsApi.subscribe({
  measures: ['Orders.count'],
  timeDimensions: [{
    dimension: 'Orders.createdAt',
    dateRange: ['2020-01-01', '2020-12-31']
  }],
  dimensions: ['Orders.status']
}, {
  onNext: (resultSet) => {
    console.log(resultSet.tablePivot());
  }
});

Other packages similar to @cubejs-client/core

Changelog

Source

0.31.0 (2022-10-03)

  • feat!: Cube Views implementation (#5278) (9937356), closes #5278

Bug Fixes

  • cubesql: Allow derived tables to have a dot in column name (#5391) (f83009c)
  • cubesql: cast strings to timestamp (#5331) (a706258)
  • cubesql: Metabase - substring __user (#5328) (a25c8bf)
  • cubesql: udf format_type prepared statement fix (#5260) (307ed1b)
  • cubesql: WHERE Lower / Upper in list with multiply items (#5376) (2269b2b)
  • cubestore: Aggregate function MERGE not allowed for column type bytes (#5166) (7626ed5)
  • cubestore: Fix error: Internal: channel closed on the next request after cubestore cloud process got OOM (#5238) (cb81fdb)
  • postgres-driver: release method should not throw (#5395) (9423f46)
  • query-orchestrator: pre-aggs build range queries cache key alignment (#5377) (5896c4a)
  • schema-compiler: throw an error for the empty pre-aggs (#5392) (4afd604)

Features

  • cubesql: Holistics - in dates list filter (#5333) (94b6509)
  • cubesql: Support joins with distinct (#5340) (da4304f)
  • multiple data source (#5326) (334af8c)
  • cubesql: Add float8, bool casts (b345ade)
  • cubesql: Allow char_length function to be used with cubes (e99344f)
  • cubesql: Allow filter by exact year (Tableau) (#5367) (c31e59d)
  • cubesql: Holistics - support range of charts (#5325) (d16b4c2)
  • cubesql: Support date_trunc over column filter with <= (b30d239)
  • query-orchestrator: introduce unload without temp table (#5324) (3dcbd2e)
  • testing: databricks test suite (#5311) (b77f33b)

BREAKING CHANGES

  • The logic of how cubes are included in joins has been changed. There are multiple member reference constructs that are now forbidden and should be rewritten. You can't reference foreign cubes anymore to define members inside other cubes: ${ForeignCube}.foo. foo member should be defined in ForeignCube and referenced as ${ForeignCube.foo}. You also can't mix references and members without CUBE self-reference. For example ${ForeignCube.foo} + bar is invalid and ${ForeignCube.foo} + ${CUBE}.bar should be used instead. If not fixed, it'll lead to missing tables in the FROM clause.

Readme

Source

Cube.js

WebsiteDocsBlogSlackDiscourseTwitter

npm version GitHub Actions

Cube.js Client Core

Cube.js Client core set of methods to access Cube.js API Gateway.

Learn more

License

Cube.js Client Core is MIT licensed.

FAQs

Package last updated on 03 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc