Comparing version 1.0.0-beta.2 to 1.0.0-beta.3
@@ -15,3 +15,3 @@ /* SQB | ||
const promisify = require('putil-promisify'); | ||
const plugins = require('../plugins'); | ||
const extensions = require('../extensions'); | ||
@@ -36,3 +36,3 @@ /** | ||
this._outFormat = options.outFormat || 0; | ||
this.stringify = options.stringify || plugins.stringify || JSON.stringify; | ||
this.stringify = options.stringify || extensions.stringify || JSON.stringify; | ||
this._rowNum = -1; | ||
@@ -39,0 +39,0 @@ this._limit = options.limit; |
@@ -28,3 +28,3 @@ /* SQB | ||
if (!metaOperator) | ||
throw new Error('Database wrapper plugin does not support metaData operations'); | ||
throw new Error('Connection adapter does not support meta data operations'); | ||
this.dbobj = dbobj; | ||
@@ -31,0 +31,0 @@ this._metaOperator = metaOperator; |
@@ -25,3 +25,3 @@ /* SQB | ||
if (!(this.metaOperator && this.metaOperator.getSelectSql)) | ||
throw new Error('Database wrapper plugin does not support metaData operations'); | ||
throw new Error('Current dialect does not support meta data operations'); | ||
this.dbobj = owner.dbobj; | ||
@@ -28,0 +28,0 @@ this.pool = owner.dbobj.isConnection ? owner.dbobj.pool : owner.dbobj; |
@@ -17,3 +17,3 @@ /* SQB | ||
const promisify = require('putil-promisify'); | ||
const plugins = require('../plugins'); | ||
const extensions = require('../extensions'); | ||
const Serializer = require('../Serializer'); | ||
@@ -68,5 +68,5 @@ const Connection = require('./Connection'); | ||
this._schema = config.schema; | ||
this._driver = plugins.createDriver(config); | ||
this._driver = extensions.createDriver(config); | ||
if (!this._driver) | ||
throw new ArgumentError('No connection plugin registered for dialect `%s`', config.dialect); | ||
throw new ArgumentError('No connection adapter registered for dialect `%s`', config.dialect); | ||
/* istanbul ignore else */ | ||
@@ -73,0 +73,0 @@ if (this._driver.paramType !== undefined) |
@@ -14,3 +14,3 @@ /* SQB | ||
const Readable = require('stream').Readable; | ||
const plugins = require('../plugins'); | ||
const extensions = require('../extensions'); | ||
@@ -35,3 +35,3 @@ /** | ||
this._outFormat = options.outFormat || 0; | ||
this.stringify = options.stringify || plugins.stringify || JSON.stringify; | ||
this.stringify = options.stringify || extensions.stringify || JSON.stringify; | ||
this._rowNum = -1; | ||
@@ -38,0 +38,0 @@ } |
@@ -28,3 +28,3 @@ /* SQB | ||
const sqbexport = require('./helper/sqbexport'); | ||
const plugins = require('./plugins'); | ||
const extensions = require('./extensions'); | ||
@@ -96,6 +96,6 @@ module.exports = Object.assign({}, sqbexport); | ||
use: function(plugin) { | ||
plugins.use(plugin); | ||
use: function(extension) { | ||
extensions.use(extension); | ||
} | ||
}); |
@@ -13,6 +13,6 @@ /* SQB | ||
*/ | ||
const plugins = require('./plugins'); | ||
const assert = require('assert'); | ||
const flattenText = require('putil-flattentext'); | ||
const ParamType = require('./types').ParamType; | ||
const extensions = require('./extensions'); | ||
@@ -49,8 +49,8 @@ /** | ||
self._prmGen = 1; | ||
this.pluginSerializer = plugins.createSerializer(self._config); | ||
this.serializerExtension = extensions.createSerializer(self._config); | ||
config.paramType = config.paramType || | ||
(this.pluginSerializer ? this.pluginSerializer.paramType : 0) || | ||
(this.serializerExtension ? this.serializerExtension.paramType : 0) || | ||
ParamType.COLON; | ||
config.prettyPrint = | ||
config.prettyPrint === undefined ? true : !!config.prettyPrint; | ||
config.prettyPrint = config.prettyPrint === undefined ? true : | ||
!!config.prettyPrint; | ||
} | ||
@@ -146,3 +146,3 @@ | ||
} | ||
this.pluginSerializer = owner.pluginSerializer; | ||
this.serializerExtension = owner.serializerExtension; | ||
} | ||
@@ -159,5 +159,5 @@ | ||
return true; | ||
if (this.pluginSerializer && | ||
typeof this.pluginSerializer.isReserved === 'function') | ||
return this.pluginSerializer.isReserved(str); | ||
if (this.serializerExtension && | ||
typeof this.serializerExtension.isReserved === 'function') | ||
return this.serializerExtension.isReserved(str); | ||
}; | ||
@@ -1079,5 +1079,5 @@ | ||
} | ||
const plugin = instance.pluginSerializer; | ||
if (plugin && plugin[fnName]) { | ||
const out = plugin[fnName](instance, obj, inf); | ||
const extension = instance.serializerExtension; | ||
if (extension && extension[fnName]) { | ||
const out = extension[fnName](instance, obj, inf); | ||
if (out !== undefined) | ||
@@ -1084,0 +1084,0 @@ return out; |
@@ -9,3 +9,6 @@ /* SQB | ||
/** @export @enum {number} */ | ||
/** | ||
* ParamType | ||
* @export @enum {number} | ||
*/ | ||
const ParamType = {}; | ||
@@ -25,3 +28,6 @@ | ||
/** @export @enum {number} */ | ||
/** | ||
* JoinType | ||
* @export @enum {number} | ||
*/ | ||
const JoinType = {}; | ||
@@ -50,2 +56,5 @@ | ||
/** | ||
* Expose Module | ||
*/ | ||
module.exports = { | ||
@@ -52,0 +61,0 @@ JoinType: JoinType, |
{ | ||
"name": "sqb", | ||
"description": "Plugin-driven, multi-dialect SQL query builder and Database connection framework for JavaScript", | ||
"version": "1.0.0-beta.2", | ||
"description": "Extensible, multi-dialect SQL query builder and Database connection framework for JavaScript", | ||
"version": "1.0.0-beta.3", | ||
"author": "Panates Ltd.", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -20,3 +20,3 @@ | ||
SQB is a Plugin-driven, multi-dialect SQL query builder and Database connection wrapper for NodeJS. SQB can be used as a pure sql query builder or database connection wrapper. | ||
SQB is an extensible, multi-dialect SQL query builder and Database connection wrapper for NodeJS. SQB can be used as a pure sql query builder or database connection wrapper. | ||
@@ -31,2 +31,11 @@ Take a look at [DOCUMENTATION](https://panates.gitbooks.io/sqb/content/) for details | ||
## Main goals | ||
- Single code base for any sql based database | ||
- Powerful and simplified query coding scheme | ||
- Fast applications with low memory requirements | ||
- Support latest JavaScript language standards | ||
- Lightweight and extensible framework | ||
## Installation | ||
@@ -33,0 +42,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108244
3612
67