From f5974ce9aded2f589a046b393d40cc3d705c6971 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 25 Jun 2024 16:34:15 +0530 Subject: [PATCH] feat: resolved some queries giving any[] on db instance modification for replication --- backend/src/db/instance.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/db/instance.ts b/backend/src/db/instance.ts index 8c63b5316..f6162ad9c 100644 --- a/backend/src/db/instance.ts +++ b/backend/src/db/instance.ts @@ -13,8 +13,12 @@ export const initDbConnection = ({ dbRootCert?: string; }[]; }) => { - let db: Knex; - let readReplicaDbs: Knex[]; + // akhilmhdh: the default Knex is knex.Knex. but when assigned with knex({}) the value is knex.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; + // eslint-disable-next-line + let readReplicaDbs: Knex[]; // @ts-expect-error the querybuilder type is expected but our intension is to return a knex instance knex.QueryBuilder.extend("primaryNode", () => { return db;