From 09ed927f8622dba57ed3c330641641dd50534896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=C9=A8=D5=BC=C9=A2=D3=84=D5=A1=D6=85=D5=BC=C9=A2?= Date: Tue, 24 Oct 2023 19:56:55 +0800 Subject: [PATCH] refactor(nocodb): use defaultLimitConfig from extractLimitAndOffset --- packages/nocodb/src/db/BaseModelSqlv2.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index d4b542fd53..b2d2ae7b2f 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -64,6 +64,7 @@ import { IS_WITHIN_COMPARISON_SUB_OPS, } from '~/utils/globals'; import { extractProps } from '~/helpers/extractProps'; +import { defaultLimitConfig } from '~/helpers/extractLimitAndOffset'; dayjs.extend(utc); @@ -110,11 +111,7 @@ class BaseModelSqlv2 { protected _proto: any; protected _columns = {}; - public static config: any = { - limitDefault: Math.max(+process.env.DB_QUERY_LIMIT_DEFAULT || 25, 1), - limitMin: Math.max(+process.env.DB_QUERY_LIMIT_MIN || 1, 1), - limitMax: Math.max(+process.env.DB_QUERY_LIMIT_MAX || 1000, 1), - }; + public static config: any = defaultLimitConfig; public get dbDriver() { return this._dbDriver;