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
.ts or .sql anywhere in the packages/example/src directory.
- 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.
Describe the bug
This is the new Type of
IDatabaseConnection:where
pgstill uses this Type forQueryResultBasewhich is the base for returns of Pool.query and Client.query:Expected behavior
Could
IDatabaseConnectionplease be compatible topgagain, 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/exampleproject.The package allows you to do the following:
packages/example/sql/schema.sql..tsor.sqlanywhere in thepackages/example/srcdirectory.packages/example/src/index.test.tsPlease refer to
contributing.mdfor details on how to run theexamplepackage.