Upgrade to @types/pg >8.11.3 blocked
Currently the update to the pg types blocks because we're redefining query()
and this kind of clashes.
lib/dao/database.ts:93:4 - error TS2322: Type 'QueryArrayResult<any[]>' is not assignable to type 'QueryResult<R>'.
Types of property 'rows' are incompatible.
Type 'any[][]' is not assignable to type 'R[]'.
Type 'any[]' is not assignable to type 'R'.
'any[]' is assignable to the constraint of type 'R', but 'R' could be instantiated with a different subtype of constraint 'QueryResultRow'.
93 return await super.query(queryTextOrConfig, values);
~~~~~~
lib/dao/database.ts:93:48 - error TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type 'I' is not assignable to parameter of type '(err: Error, result: QueryResult<any>) => void'.
Type 'any[]' is not assignable to type '(err: Error, result: QueryResult<any>) => void'.
Type 'any[]' provides no match for the signature '(err: Error, result: QueryResult<any>): void'.
93 return await super.query(queryTextOrConfig, values);
~~~~~~
../node_modules/@types/pg/index.d.ts:201:5
201 query<R extends QueryResultRow = any, I = any[]>(
~~~~~
The last overload is declared here.
lib/dao/database.ts:107:5 - error TS2322: Type 'QueryArrayResult<any[]>' is not assignable to type 'QueryResult<R>'.
107 return await super.query(queryTextOrConfig, values);
~~~~~~
lib/dao/database.ts:107:49 - error TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type 'I' is not assignable to parameter of type '(err: Error, result: QueryResult<any>) => void'.
107 return await super.query(queryTextOrConfig, values);
~~~~~~
../node_modules/@types/pg/index.d.ts:201:5
201 query<R extends QueryResultRow = any, I = any[]>(
~~~~~
The last overload is declared here.
Found 4 errors in the same file, starting at: lib/dao/database.ts:93
If someone has an idea of how to fix that, I'd love some help.