workers-qb
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -178,4 +178,5 @@ declare enum OrderTypes { | ||
private _options; | ||
private _queryBuilder; | ||
constructor(options: Partial<SelectAll>, queryBuilder: (params: SelectAll) => QueryWithExtra<GenericResultWrapper>); | ||
private _fetchAll; | ||
private _fetchOne; | ||
constructor(options: Partial<SelectAll>, fetchAll: (params: SelectAll) => QueryWithExtra<GenericResultWrapper>, fetchOne: (params: SelectOne) => QueryWithExtra<GenericResultWrapper>); | ||
setDebugger(state: boolean): void; | ||
@@ -192,4 +193,7 @@ tableName(tableName: SelectAll['tableName']): SelectBuilder<GenericResultWrapper, GenericResult>; | ||
private _parseArray; | ||
getQuery(): Query<ArrayResult<GenericResultWrapper, GenericResult>>; | ||
getQueryAll(): Query<ArrayResult<GenericResultWrapper, GenericResult>>; | ||
getQueryOne(): Query<OneResult<GenericResultWrapper, GenericResult>>; | ||
execute(): Promise<ArrayResult<GenericResultWrapper, GenericResult>>; | ||
all(): Promise<ArrayResult<GenericResultWrapper, GenericResult>>; | ||
one(): Promise<OneResult<GenericResultWrapper, GenericResult>>; | ||
count(): Promise<CountResult<GenericResultWrapper>>; | ||
@@ -196,0 +200,0 @@ } |
@@ -114,6 +114,8 @@ "use strict"; | ||
_options = {}; | ||
_queryBuilder; | ||
constructor(options, queryBuilder) { | ||
_fetchAll; | ||
_fetchOne; | ||
constructor(options, fetchAll, fetchOne) { | ||
this._options = options; | ||
this._queryBuilder = queryBuilder; | ||
this._fetchAll = fetchAll; | ||
this._fetchOne = fetchOne; | ||
} | ||
@@ -129,3 +131,4 @@ setDebugger(state) { | ||
}, | ||
this._queryBuilder | ||
this._fetchAll, | ||
this._fetchOne | ||
); | ||
@@ -158,3 +161,4 @@ } | ||
}, | ||
this._queryBuilder | ||
this._fetchAll, | ||
this._fetchOne | ||
); | ||
@@ -180,3 +184,4 @@ } | ||
}, | ||
this._queryBuilder | ||
this._fetchAll, | ||
this._fetchOne | ||
); | ||
@@ -190,3 +195,4 @@ } | ||
}, | ||
this._queryBuilder | ||
this._fetchAll, | ||
this._fetchOne | ||
); | ||
@@ -209,13 +215,23 @@ } | ||
}, | ||
this._queryBuilder | ||
this._fetchAll, | ||
this._fetchOne | ||
); | ||
} | ||
getQuery() { | ||
return this._queryBuilder(this._options); | ||
getQueryAll() { | ||
return this._fetchAll(this._options); | ||
} | ||
getQueryOne() { | ||
return this._fetchOne(this._options); | ||
} | ||
async execute() { | ||
return this._queryBuilder(this._options).execute(); | ||
return this._fetchAll(this._options).execute(); | ||
} | ||
async all() { | ||
return this._fetchAll(this._options).execute(); | ||
} | ||
async one() { | ||
return this._fetchOne(this._options).execute(); | ||
} | ||
async count() { | ||
return this._queryBuilder(this._options).count(); | ||
return this._fetchOne(this._options).count(); | ||
} | ||
@@ -287,2 +303,5 @@ }; | ||
return this.fetchAll(params); | ||
}, | ||
(params) => { | ||
return this.fetchOne(params); | ||
} | ||
@@ -289,0 +308,0 @@ ); |
{ | ||
"name": "workers-qb", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Zero dependencies Query Builder for Cloudflare Workers", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
68885
1654