File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " database-builder" ,
3- "version" : " 0.0.32 " ,
3+ "version" : " 0.0.33 " ,
44 "description" : " Library to assist in creating and maintaining SQL commands." ,
55 "main" : " ./src/index.js" ,
66 "types" : " ./src/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ export class Query<T> implements QueryCompilable {
193193 }
194194
195195 public mapper ( mapper : ( row : RowResult < any > ) => any ) : Promise < any [ ] > {
196- const metadata = this . getMetadata ( ) ;
196+ const metadata = this . getMetadata ( void 0 , false ) ;
197197 const mapperTable = metadata ? metadata . mapperTable : void 0 ;
198198 return new Promise ( ( resolve , reject ) => {
199199 this . execute ( )
@@ -229,9 +229,9 @@ export class Query<T> implements QueryCompilable {
229229 return result ;
230230 }
231231
232- private getMetadata ( metadata ? : MetadataTable < T > ) : MetadataTable < T > {
232+ private getMetadata ( metadata : MetadataTable < T > , throwNotFound : boolean = true ) : MetadataTable < T > {
233233 const result = ( metadata ? metadata : this . _metadata ) ;
234- if ( ! result ) {
234+ if ( ! result && throwNotFound ) {
235235 throw new DatabaseBuilderError ( "MetadataTable not specified in query. Call 'executeAndRead'." ) ;
236236 }
237237 return result ;
You can’t perform that action at this time.
0 commit comments