Skip to content

Commit

Permalink
improving data response type
Browse files Browse the repository at this point in the history
  • Loading branch information
brugos committed Feb 24, 2021
1 parent 3942f3c commit 9965618
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "snowflake-multisql",
"version": "1.2.2",
"version": "1.3.0",
"description": "Multi SQL Statement, Promise-based, TypeScript wrapper for Snowflake SDK",
"repository": "github:brugos/snowflake-multisql",
"bugs": "https://github.com/brugos/snowflake-multisql/issues",
Expand All @@ -20,6 +20,7 @@
"test": "mocha --timeout 60000",
"test:watch": "yarn test:mocha -w",
"test:coverage": "yarn test && open && open ./coverage/lcov-report/index.ts.html",
"lint:eslint": "eslint ./ --ext .ts --max-warnings 0",
"lint": "tsc --noEmit"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/snowflake-multisql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface IPreview {
export interface IMultiSqlResult extends IPreview {
duration?: number;
totalDuration?: number;
data?: any[];
data?: Record<string, any>[]; //any[];
}
export interface IExecuteAll {
sqlText: string;
Expand Down
9 changes: 8 additions & 1 deletion tests/snowflake-multisql.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ describe("checks tagsToBinds function", () => {
warehouse: "DEMO_WH",
});
const stubSF = sinon.stub(snowflake, "execute");
stubSF.resolves([{ FIELD_1: "VALUE_FIELD_1" }]);
stubSF.resolves([
{
FIELD_1: "VALUE_FIELD_1",
NumField: 123,
DateField: new Date(),
ObjField: { a: "a", b: 1, c: new Date() },
},
]);
});

afterEach(() => {
Expand Down

0 comments on commit 9965618

Please sign in to comment.