🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

suiteql

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

suiteql

Run SQL queries against NetSuite using SuiteQL through SuiteTalk Rest Webservices

1.0.8
latest
npm
Version published
Weekly downloads
49
-39.51%
Maintainers
1
Weekly downloads
 
Created
Source

SuiteQL

Node.js CI npm version downloads Coverage Status

NPM

Run SQL queries against NetSuite using SuiteQL through SuiteTalk Rest Webservices.

This class extends netsuite-rest

Installation

npm i suiteql

Quick Start

const suiteql = require('suiteql');
let suiteQL = new suiteql({
	consumer_key: process.env.consumer_key,
	consumer_secret_key: process.env.consumer_secret_key,
	token: process.env.token,
	token_secret: process.env.token_secret,
	realm: process.env.realm,
	base_url: process.env.base_url
});

query

query(string, limit = 1000, offset = 0)
  • string - Select query to run

  • limit - Limit number of rows, max is 1000

  • offset - Rows to start from

This method returns with the promise support, response will be in JSON format

Example

let transactions = await suiteQL.query("select id from transaction", 10, 0);

queryAll (Stream)

When working on large number of rows, stream is handy

queryAll(string, limit = 1000) 
  • string - Select query to run

  • limit - Limit number of rows, max is 1000

Example

 let items = [];
    let st = suiteQL.queryAll(`
        select  
            tranid, id from transaction 
        where 
            rownum <= 30 
    `);
    
    st.on("data", (data) => {
      items.push(data);
    });
    
    st.on("end", () => {
        console.log("stream ended")
    });

Keywords

netsuite

FAQs

Package last updated on 17 Feb 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