Documentation updates
This commit is contained in:
parent
ad91099706
commit
3460abdd96
@ -22,7 +22,7 @@ class Adapter {
|
|||||||
*
|
*
|
||||||
* @param {String} sql - The sql with placeholders
|
* @param {String} sql - The sql with placeholders
|
||||||
* @param {Array} params - The values to insert into the query
|
* @param {Array} params - The values to insert into the query
|
||||||
* @return {Promise} - returns a promise if no callback is passed
|
* @return {Promise} - returns a promise resolving to the result of the database query
|
||||||
*/
|
*/
|
||||||
execute (sql, params) {
|
execute (sql, params) {
|
||||||
throw new Error('Correct adapter not defined for query execution');
|
throw new Error('Correct adapter not defined for query execution');
|
||||||
|
@ -490,7 +490,7 @@ class QueryBuilder extends QueryBuilderBase {
|
|||||||
* @example query.get('table_name').then(promiseCallback); // Get all the rows in the table
|
* @example query.get('table_name').then(promiseCallback); // Get all the rows in the table
|
||||||
* @example query.get('table_name', 5); // Get 5 rows from the table
|
* @example query.get('table_name', 5); // Get 5 rows from the table
|
||||||
* @example query.get(); // Get the results of a query generated with other methods
|
* @example query.get(); // Get the results of a query generated with other methods
|
||||||
* @return {void|Promise} - If no callback is passed, a promise is returned
|
* @return {Promise<Result>} - Promise containing the result of the query
|
||||||
*/
|
*/
|
||||||
get (table, limit, offset) {
|
get (table, limit, offset) {
|
||||||
if (table) {
|
if (table) {
|
||||||
@ -510,7 +510,7 @@ class QueryBuilder extends QueryBuilderBase {
|
|||||||
*
|
*
|
||||||
* @param {String} table - The table to insert into
|
* @param {String} table - The table to insert into
|
||||||
* @param {Object} [data] - Data to insert, if not already added with the 'set' method
|
* @param {Object} [data] - Data to insert, if not already added with the 'set' method
|
||||||
* @return {Promise} - If no callback is passed, a promise is returned
|
* @return {Promise<Result>} - Promise containing the result of the query
|
||||||
*/
|
*/
|
||||||
insert (table, data) {
|
insert (table, data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -528,7 +528,7 @@ class QueryBuilder extends QueryBuilderBase {
|
|||||||
* @param {Array} data - The array of objects containing data rows to insert
|
* @param {Array} data - The array of objects containing data rows to insert
|
||||||
* @example query.insertBatch('foo',[{id:1,val:'bar'},{id:2,val:'baz'}])
|
* @example query.insertBatch('foo',[{id:1,val:'bar'},{id:2,val:'baz'}])
|
||||||
*.then(promiseCallback);
|
*.then(promiseCallback);
|
||||||
* @return {Promise} - If no callback is passed, a promise is returned
|
* @return {Promise<Result>} - Promise containing the result of the query
|
||||||
*/
|
*/
|
||||||
insertBatch (table, data) {
|
insertBatch (table, data) {
|
||||||
let batch = this.driver.insertBatch(table, data);
|
let batch = this.driver.insertBatch(table, data);
|
||||||
@ -542,7 +542,7 @@ class QueryBuilder extends QueryBuilderBase {
|
|||||||
*
|
*
|
||||||
* @param {String} table - The table to insert into
|
* @param {String} table - The table to insert into
|
||||||
* @param {Object} [data] - Data to insert, if not already added with the 'set' method
|
* @param {Object} [data] - Data to insert, if not already added with the 'set' method
|
||||||
* @return {Promise} - If no callback is passed, a promise is returned
|
* @return {Promise<Result>} - Promise containing the result of the query
|
||||||
*/
|
*/
|
||||||
update (table, data) {
|
update (table, data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -558,7 +558,7 @@ class QueryBuilder extends QueryBuilderBase {
|
|||||||
*
|
*
|
||||||
* @param {String} table - The table to insert into
|
* @param {String} table - The table to insert into
|
||||||
* @param {Object} [where] - Where clause for delete statement
|
* @param {Object} [where] - Where clause for delete statement
|
||||||
* @return {Promise} - If no callback is passed, a promise is returned
|
* @return {Promise<Result>} - Promise containing the result of the query
|
||||||
*/
|
*/
|
||||||
delete (table, where) {
|
delete (table, where) {
|
||||||
if (where) {
|
if (where) {
|
||||||
|
@ -115,7 +115,7 @@ class QueryParser {
|
|||||||
/**
|
/**
|
||||||
* Return the output of the parsing of the join condition
|
* Return the output of the parsing of the join condition
|
||||||
*
|
*
|
||||||
* @param {String} condition - The join condition to evalate
|
* @param {String} condition - The join condition to evaluate
|
||||||
* @return {String} - The parsed/escaped join condition
|
* @return {String} - The parsed/escaped join condition
|
||||||
*/
|
*/
|
||||||
compileJoin (condition) {
|
compileJoin (condition) {
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
module.exports = config => {
|
||||||
|
|
||||||
|
};
|
17
lib/drivers/MSSQLDriver.js
Normal file
17
lib/drivers/MSSQLDriver.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Driver for Microsoft SQL Server databases
|
||||||
|
*
|
||||||
|
* @module drivers/MSSQLDriver
|
||||||
|
*/
|
||||||
|
module.exports = (() => {
|
||||||
|
delete require.cache[require.resolve('../Driver')];
|
||||||
|
const driver = require('../Driver');
|
||||||
|
const helpers = require('../helpers');
|
||||||
|
|
||||||
|
driver.identifierStartChar = '[';
|
||||||
|
driver.identifierEndChar = ']';
|
||||||
|
|
||||||
|
return driver;
|
||||||
|
})();
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
let helpers = {
|
const helpers = {
|
||||||
/**
|
/**
|
||||||
* Wrap String.prototype.trim in a way that is easily mappable
|
* Wrap String.prototype.trim in a way that is easily mappable
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user