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.27 " ,
3+ "version" : " 0.0.28 " ,
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 @@ -196,7 +196,7 @@ export class Query<T> implements QueryCompilable {
196196 return new Promise ( ( resolve , reject ) => {
197197 this . execute ( )
198198 . then ( ( cursor ) => {
199- resolve ( this . _queryReadableBuilder . map ( cursor , mapper ) ) ;
199+ resolve ( this . _queryReadableBuilder . mapper ( cursor , mapper ) ) ;
200200 } )
201201 . catch ( reject ) ;
202202 } ) ;
Original file line number Diff line number Diff line change 11import { RowResult } from "./../core/row-result" ;
22import { expect } from "chai" ;
3+ import { Query } from ".." ;
4+ import { TestClazz } from "./models/test-clazz" ;
5+ import { TestClazzRef } from "./models/test-clazz-ref" ;
36
47describe ( "Row Result" , ( ) => {
58
@@ -20,4 +23,27 @@ describe("Row Result", () => {
2023 expect ( rowResult . coalesce ( x => x . age , 123 ) ) . to . equal ( model . age ) ;
2124 } ) ;
2225
26+ // it("Query", () => {
27+ // const query = new Query(TestClazz);
28+
29+ // const model = {
30+ // id: 1,
31+ // description: "Descrição",
32+ // referenceTest: {
33+ // id: 2,
34+ // description: "Referencia"
35+ // } as TestClazzRef,
36+ // disabled: false
37+ // } as TestClazz;
38+
39+ // query.mapper((row: RowResult<any>) => {
40+ // expect(row.get("description")).to.equal(model.description);
41+ // expect(row.get(x => x.id)).to.equal(model.id);
42+ // expect(row.get(x => x.test)).to.equal(model.test);
43+ // expect(row.get("ttt")).to.equal(void 0);
44+ // expect(row.coalesce("ttt", 123)).to.equal(123);
45+ // expect(row.coalesce(x => x.age, 123)).to.equal(model.age);
46+ // });
47+ // });
48+
2349} ) ;
You can’t perform that action at this time.
0 commit comments