Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sqb

Package Overview
Dependencies
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqb - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

lib/core/conditiongroup.js

@@ -30,3 +30,3 @@ /**

let arg = arguments[i];
if (!(arg.isCondition || arg.isConditionGroup))
if (!(arg.isCondition || arg.isConditionGroup || arg.isRaw))
throw new Error('Only array of Condition instance allowed');

@@ -33,0 +33,0 @@ this._items.push(arg);

@@ -9,6 +9,6 @@ /**

get dialect() {
return 'oracle';
constructor(config){
super(config);
this.dialect = 'oracle';
}
_generateFrom(tables) {

@@ -15,0 +15,0 @@ let s = super._generateFrom(tables);

@@ -25,3 +25,3 @@ /**

constructor(config) {
this._dialect = config && config.dialect;
this.dialect = config && config.dialect;
this.prettyPrint = config && !!config.prettyPrint;

@@ -33,6 +33,2 @@ this.namedParams = !config || config.namedParams === undefined || !!config.namedParams;

get dialect() {
return this._dialect;
}
build(obj) {

@@ -59,3 +55,3 @@ this.sql = '';

if (s = this._generateFrom(obj._tables)) {
sb.append((this.prettyPrint && sb.line.length > 40 ? '\n' : (sb.line ? ' ' : '')) + s);
sb.append((this.prettyPrint && sb.line.length > 40 ? '\n' : ' ') + s);
}

@@ -129,17 +125,16 @@

table = tables[i];
let ss;
if (table.isRaw)
str += (str ? ', ' : ' ') + this._generateRaw(table);
ss = this._generateRaw(table);
else if (table.type === 'table') {
str += (str ? ', ' : ' ') +
(table.schema ? table.schema + '.' : '') +
ss = (table.schema ? table.schema + '.' : '') +
table.table +
(table.alias ? ' ' + table.alias : '')
} else if (table.type === 'select') {
let s = this._generateSelectSql(table);
if (s)
str += ' (' + s + ')' + (table._alias ? ' ' + table._alias : '');
} else if (table.type === 'raw') {
let s = this._generateRaw(table);
if (s) str += ' ' + s;
if (ss = this._generateSelectSql(table))
ss = '(' + ss + ')' + (table._alias ? ' ' + table._alias : '');
}
if (ss)
str += (str ? ', ' : ' ') + ss;
}

@@ -182,3 +177,3 @@ return str ? 'from' + str : '';

str = '(' + this._generateSelectSql(item.field) + ') ';
else str = this.reservedWords.indexOf(item.field) >= 0 ? '"' + item.field + '"' : item.field + ' ';
else str = this.reservedWords.indexOf(item.field) >= 0 ? '"' + item.field + '" ' : item.field + ' ';

@@ -185,0 +180,0 @@ if (item.param) {

{
"name": "sqb",
"description": "Lightweight, multi-dialect SQL query builder for JavaScript",
"version": "0.0.5",
"version": "0.0.6",
"author": "Panates Ltd.",

@@ -6,0 +6,0 @@ "contributors": [

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc