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

ee-query-builder

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ee-query-builder - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

2

lib/Functions.js

@@ -81,3 +81,3 @@ !function(){

}.bind(this)).join(', ') +')';
} else return undefined;
} else return ' false';
}

@@ -84,0 +84,0 @@ }

@@ -88,3 +88,9 @@ !function(){

case 'create':
return this._buildCreateQuery(query, parameters);
case 'drop':
return this._buildDropQuery(query, parameters);
default:

@@ -97,4 +103,45 @@ throw new Error('Unknown query mode «'+mode+'»!').setName('InvalidModeException');

/**
* build a create query
*
* @param <object> query
* @param <object> parameters
*/
, _buildCreateQuery: function(query, parameters) {
if (type.string(query.database)) {
return {SQLString: 'CREATE DATABASE '+this._escapeId(query.database)+';', parameters: parameters};
}
else if (type.string(query.schema)) {
return {SQLString: 'CREATE SCHEMA '+this._escapeId(query.schema)+';', parameters: parameters};
}
else {
throw new Error('Unknown create statement!');
}
}
/**
* build a drop query
*
* @param <object> query
* @param <object> parameters
*/
, _buildDropQuery: function(query, parameters) {
if (type.string(query.database)) {
return {SQLString: 'DROP DATABASE '+this._escapeId(query.database)+';', parameters: parameters};
}
else if (type.string(query.schema)) {
return {SQLString: 'DROP SCHEMA '+this._escapeId(query.schema)+';', parameters: parameters};
}
else {
throw new Error('Unknown drop statement!');
}
}
/**
* creates an SQL delete statement

@@ -101,0 +148,0 @@ *

{
"name" : "ee-query-builder"
, "description" : "SQL query builder for the ee-orm package. Implents the postgres syntax."
, "version" : "0.4.0"
, "version" : "0.5.0"
, "homepage" : "https://github.com/eventEmitter/ee-query-builder"

@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)"

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