diff --git a/packages/server/modules/core/repositories/branches.ts b/packages/server/modules/core/repositories/branches.ts index e465e293c..7a61193cf 100644 --- a/packages/server/modules/core/repositories/branches.ts +++ b/packages/server/modules/core/repositories/branches.ts @@ -610,7 +610,7 @@ export const getModelTreeItemsTotalCountFactory = options?: Partial<{ filterOutEmptyMain: boolean; parentModelName: string }> ) => { const { query } = getModelTreeItemsBaseQueryFactory(deps)(projectId, options) - const q = knex.count<{ count: string }[]>().from(query.as('sq1')) + const q = deps.db().count<{ count: string }[]>().from(query.as('sq1')) const [row] = await q return parseInt(row.count || '0') }