feat: resolved some queries giving any[] on db instance modification for replication

This commit is contained in:
=
2024-06-25 22:51:38 +05:30
parent c6b51af4b1
commit f5974ce9ad
+6 -2
View File
@@ -13,8 +13,12 @@ export const initDbConnection = ({
dbRootCert?: string; dbRootCert?: string;
}[]; }[];
}) => { }) => {
let db: Knex; // akhilmhdh: the default Knex is knex.Knex<any, any[]>. but when assigned with knex({<config>}) the value is knex.Knex<any, unknown[]>
let readReplicaDbs: Knex[]; // this was causing issue with files like `snapshot-dal` `findRecursivelySnapshots` this i am explicitly putting the any and unknown[]
// eslint-disable-next-line
let db: Knex<any, unknown[]>;
// eslint-disable-next-line
let readReplicaDbs: Knex<any, unknown[]>[];
// @ts-expect-error the querybuilder type is expected but our intension is to return a knex instance // @ts-expect-error the querybuilder type is expected but our intension is to return a knex instance
knex.QueryBuilder.extend("primaryNode", () => { knex.QueryBuilder.extend("primaryNode", () => {
return db; return db;