Adding the ability to expand the max number of rows retrieved by SQL queries (say for table exports).
This commit is contained in:
parent
3eb7ab4e5b
commit
d52f6dea05
|
@ -70,6 +70,7 @@ module.exports = {
|
||||||
ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS,
|
ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS,
|
||||||
DISABLE_THREADING: process.env.DISABLE_THREADING,
|
DISABLE_THREADING: process.env.DISABLE_THREADING,
|
||||||
QUERY_THREAD_TIMEOUT: process.env.QUERY_THREAD_TIMEOUT,
|
QUERY_THREAD_TIMEOUT: process.env.QUERY_THREAD_TIMEOUT,
|
||||||
|
SQL_MAX_ROWS: process.env.SQL_MAX_ROWS,
|
||||||
_set(key, value) {
|
_set(key, value) {
|
||||||
process.env[key] = value
|
process.env[key] = value
|
||||||
module.exports[key] = value
|
module.exports[key] = value
|
||||||
|
|
|
@ -9,8 +9,12 @@ import {
|
||||||
} from "../../definitions/datasource"
|
} from "../../definitions/datasource"
|
||||||
import { isIsoDateString, SqlClients } from "../utils"
|
import { isIsoDateString, SqlClients } from "../utils"
|
||||||
import SqlTableQueryBuilder from "./sqlTable"
|
import SqlTableQueryBuilder from "./sqlTable"
|
||||||
|
import environment from "../../environment"
|
||||||
|
|
||||||
const BASE_LIMIT = 5000
|
const envLimit = environment.SQL_MAX_ROWS
|
||||||
|
? parseInt(environment.SQL_MAX_ROWS)
|
||||||
|
: null
|
||||||
|
const BASE_LIMIT = envLimit || 5000
|
||||||
|
|
||||||
type KnexQuery = Knex.QueryBuilder | Knex
|
type KnexQuery = Knex.QueryBuilder | Knex
|
||||||
// these are invalid dates sent by the client, need to convert them to a real max date
|
// these are invalid dates sent by the client, need to convert them to a real max date
|
||||||
|
|
Loading…
Reference in New Issue