tspace-sql
Advanced tools
Comparing version 1.2.9 to 1.3.0
@@ -9,2 +9,3 @@ declare abstract class Abstract { | ||
protected SELECT: string; | ||
protected ONLY: Array<string>; | ||
protected EXCEPT: Array<string>; | ||
@@ -62,2 +63,5 @@ protected COUNT: string; | ||
abstract createNotExists(objects: object): void; | ||
abstract upsert(objects: object): void; | ||
abstract insertOrUpdate(objects: object): void; | ||
abstract createOrUpdate(objects: object): void; | ||
abstract updateOrInsert(objects: object): void; | ||
@@ -64,0 +68,0 @@ abstract updateOrCreate(objects: object): void; |
@@ -12,2 +12,3 @@ "use strict"; | ||
function Abstract() { | ||
this.REGISTRY = {}; | ||
this.PLUCK = ''; | ||
@@ -19,2 +20,3 @@ this.SAVE = ''; | ||
this.SELECT = ''; | ||
this.ONLY = []; | ||
this.EXCEPT = []; | ||
@@ -21,0 +23,0 @@ this.COUNT = ''; |
@@ -112,2 +112,5 @@ import Abstract from './AbstractBase'; | ||
insertNotExists(objects: object): this; | ||
upsert(objects: object): this; | ||
insertOrUpdate(objects: object): this; | ||
createOrUpdate(objects: object): this; | ||
updateOrInsert(objects: object): this; | ||
@@ -114,0 +117,0 @@ updateOrCreate(objects: object): this; |
import Base from './Base'; | ||
declare class DB extends Base { | ||
static table(table: string): DB; | ||
static subQuery({ select, from, condition }: { | ||
select: string; | ||
from: string; | ||
condition: string; | ||
}): string; | ||
static sensitive(column: string): string; | ||
@@ -10,0 +5,0 @@ static raw(sql: string): Promise<any[]>; |
@@ -70,6 +70,2 @@ "use strict"; | ||
}; | ||
DB.subQuery = function (_a) { | ||
var _b = _a.select, select = _b === void 0 ? '*' : _b, from = _a.from, condition = _a.condition; | ||
return "SELECT " + select + " FROM " + from + " WHERE " + condition; | ||
}; | ||
DB.sensitive = function (column) { | ||
@@ -76,0 +72,0 @@ return "BINARY " + column; |
@@ -17,2 +17,3 @@ import AbstractModel from './AbstractModel'; | ||
except(...params: Array<string>): this; | ||
only(...params: Array<string>): this; | ||
with(...nameRelations: Array<any>): this; | ||
@@ -147,2 +148,3 @@ withHas(...nameSubRelations: Array<string>): this; | ||
private _exceptColumns; | ||
private _showOnly; | ||
private _exec; | ||
@@ -149,0 +151,0 @@ private _execGroup; |
{ | ||
"name": "tspace-sql", | ||
"version": "1.2.9", | ||
"version": "1.3.0", | ||
"description": "mysql & postgresql query builder object relational mapping", | ||
@@ -5,0 +5,0 @@ "main": "./dist/lib/index.js", |
@@ -125,2 +125,4 @@ # tspace-sql | ||
except(column1 ,column2 ,...N) | ||
only(column1 ,column2 ,...N) | ||
hidden(column1 ,column2 ,...N) | ||
join (primary key , table.foreign key) | ||
@@ -135,3 +137,2 @@ rightJoin (primary key , table.foreign key) | ||
groupBy (column) | ||
hidden (column1 ,column2 ,...N) | ||
insert(objects) | ||
@@ -138,0 +139,0 @@ create(objects) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
218200
4595
265