Socket
Book a DemoInstallSign in
Socket

cubesql.node

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cubesql.node

Node.js wrapper for the CubeSQL C SDK.

0.1.5
latest
Source
npmnpm
Version published
Weekly downloads
12
Maintainers
1
Weekly downloads
 
Created
Source

CubeSQL.node

Wrapper for Marco Bambinis native C SDK

Usage Example

import * as cubesql from 'cubesql.node';
import { Database } from 'cubesql.node';

const db = cubesql.connectToCubeSQL('host', 4430, 'username', 'password', 12, cubesql.CUBESQL_ENCRYPTION_NONE);
if (!db) {
    console.error('Failed to connect to CubeSQL:', cubesql.getErrorMessage(db));
    process.exit(1);
}
cubesql.setDatabase(db, 'MyDatabase.sdb');

const result = cubesql.selectSQL('MyDatabase.sdb', 'SELECT * FROM mytable');
if (!result) {
    throw new Error('Failed to fetch table content');
}

const columns: string[] = [];
for (let col = 1; col <= cubesql.getCursorNumColumns(result); col++) {
    columns.push(cubesql.getCursorField(result, cubesql.CUBESQL_COLNAME, col));
}

const rows: string[][] = [];
while (!cubesql.isCursorEOF(result)) {
    const row: string[] = [];
    for (let col = 1; col <= cubesql.getCursorNumColumns(result); col++) {
        row.push(cubesql.getCursorField(result, cubesql.CUBESQL_CURROW, col));
    }
    rows.push(row);
    cubesql.seekCursor(result, cubesql.CUBESQL_SEEKNEXT);
}
cubesql.freeCursor(result);

console.log({ columns, rows });

Installation from Source

MacOS

Download

git clone https://github.com/johannespfeiffer/CubeSQL.node.git

Install dependencies and build

brew install libressl
npm i

Third Party Components

This package bundles the CubeSQL SDK licensed under the MIT License.
See CubeSQL SDK for more information.

Keywords

cubesql

FAQs

Package last updated on 29 Apr 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.