diff --git a/packages/nocodb/src/lib/utils/NcConfigFactory.ts b/packages/nocodb/src/lib/utils/NcConfigFactory.ts index 466be1ee19..3f7917feae 100644 --- a/packages/nocodb/src/lib/utils/NcConfigFactory.ts +++ b/packages/nocodb/src/lib/utils/NcConfigFactory.ts @@ -41,6 +41,14 @@ const defaultConnectionConfig: any = { dateStrings: true, }; +// default knex options +const defaultConnectionOptions = { + pool: { + min: 0, + max: 10 + } +}; + const knownQueryParams = [ { parameter: 'database', @@ -733,7 +741,7 @@ export default class NcConfigFactory implements NcConfig { // } } -export { defaultConnectionConfig }; +export { defaultConnectionConfig, defaultConnectionOptions }; /** * @copyright Copyright (c) 2021, Xgene Cloud Ltd diff --git a/packages/nocodb/src/lib/utils/common/NcConnectionMgrv2.ts b/packages/nocodb/src/lib/utils/common/NcConnectionMgrv2.ts index 602208354a..10f2578204 100644 --- a/packages/nocodb/src/lib/utils/common/NcConnectionMgrv2.ts +++ b/packages/nocodb/src/lib/utils/common/NcConnectionMgrv2.ts @@ -5,7 +5,10 @@ import { XKnex } from '../../db/sql-data-mapper'; // import Knex from 'knex'; // import NcMetaIO from '../meta/NcMetaIO'; -import { defaultConnectionConfig } from '../NcConfigFactory'; +import { + defaultConnectionConfig, + defaultConnectionOptions +} from '../NcConfigFactory'; import Base from '../../models/Base'; import Noco from '../../Noco'; @@ -99,6 +102,7 @@ export default class NcConnectionMgrv2 { // ? (connectionConfig.connection as Knex.Config) // : { + ...defaultConnectionOptions, ...connectionConfig, connection: { ...defaultConnectionConfig,