Browse Source

fix(nocodb): config limit

pull/6796/head
աɨռɢӄաօռɢ 1 year ago
parent
commit
c4ef8c364d
  1. 6
      packages/nocodb/src/db/BaseModelSql.ts
  2. 2
      packages/nocodb/src/services/utils.service.ts

6
packages/nocodb/src/db/BaseModelSql.ts

@ -74,9 +74,9 @@ class BaseModelSql extends BaseModel {
this.manyToManyRelations = manyToMany; this.manyToManyRelations = manyToMany;
this.virtualColumns = v; this.virtualColumns = v;
this.config = { this.config = {
limitDefault: process.env.DB_QUERY_LIMIT_DEFAULT || 25, limitDefault: Math.max(+process.env.DB_QUERY_LIMIT_DEFAULT || 25, 1),
limitMax: process.env.DB_QUERY_LIMIT_MAX || 100, limitMin: Math.max(+process.env.DB_QUERY_LIMIT_MIN || 1, 1),
limitMin: process.env.DB_QUERY_LIMIT_MIN || 1, limitMax: Math.max(+process.env.DB_QUERY_LIMIT_MAX || 1000, 1),
log: false, log: false,
explain: false, explain: false,
hasManyMax: 5, hasManyMax: 5,

2
packages/nocodb/src/services/utils.service.ts

@ -393,7 +393,7 @@ export class UtilsService {
defaultLimit: Math.max( defaultLimit: Math.max(
Math.min( Math.min(
+process.env.DB_QUERY_LIMIT_DEFAULT || 25, +process.env.DB_QUERY_LIMIT_DEFAULT || 25,
+process.env.DB_QUERY_LIMIT_MAX || 100, +process.env.DB_QUERY_LIMIT_MAX || 1000,
), ),
+process.env.DB_QUERY_LIMIT_MIN || 1, +process.env.DB_QUERY_LIMIT_MIN || 1,
), ),

Loading…
Cancel
Save