-
-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
This is the new Type of IDatabaseConnection:
export interface IDatabaseConnection {
query: (query: string, bindings: any[]) => Promise<{
rows: any[];
rowCount: number;
}>;
stream?: (query: string, bindings: any[]) => ICursor<any[]>;
}where pg still uses this Type for QueryResultBase which is the base for returns of Pool.query and Client.query:
export interface QueryResultBase {
command: string;
rowCount: number | null;
oid: number;
fields: FieldDef[];
}
export interface QueryResultRow {
[column: string]: any;
}
export interface QueryResult<R extends QueryResultRow = any> extends QueryResultBase {
rows: R[];
}Expected behavior
Could IDatabaseConnection please be compatible to pgagain, by having rowCount nullable?
Test case
If applicable, it would really help if you can add an end-to-end test-case to the packages/example project.
The package allows you to do the following:
- Modify the database schema at
packages/example/sql/schema.sql. - Define your SQL query as a
.tsor.sqlanywhere in thepackages/example/srcdirectory. - Run your SQL as a Jest test case in
packages/example/src/index.test.ts
Please refer to contributing.md for details on how to run the example package.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working