Skip to content

Commit 45927f5

Browse files
authored
Merge pull request #1142 from rocket-admin/backend_saved_filters
temporary disable large dataset checks and related logic in data access objects for MySQL, PostgreSQL, and MSSQL
2 parents 99b32ad + edd4016 commit 45927f5

3 files changed

Lines changed: 24 additions & 20 deletions

File tree

shared-code/src/data-access-layer/data-access-objects/data-access-object-mssql.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -529,17 +529,16 @@ WHERE TABLE_TYPE = 'VIEW'
529529
: DAO_CONSTANTS.DEFAULT_PAGINATION.perPage;
530530

531531
const knex = await this.configureKnex();
532-
const [rowsCount, tableStructure, tableSchema] = await Promise.all([
533-
this.getRowsCount(tableName, null),
532+
const [tableStructure, tableSchema] = await Promise.all([
534533
this.getTableStructure(tableName),
535534
this.getSchemaName(tableName),
536535
]);
537536

538537
const availableFields = this.findAvailableFields(tableSettings, tableStructure);
539538

540-
if (rowsCount >= DAO_CONSTANTS.LARGE_DATASET_ROW_LIMIT) {
541-
throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
542-
}
539+
// if (rowsCount >= DAO_CONSTANTS.LARGE_DATASET_ROW_LIMIT) {
540+
// throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
541+
// }
543542

544543
if (tableSchema) {
545544
tableName = `${tableSchema}.[${tableName}]`;

shared-code/src/data-access-layer/data-access-objects/data-access-object-mysql.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -588,14 +588,16 @@ export class DataAccessObjectMysql extends BasicDataAccessObject implements IDat
588588
const offset = (page - 1) * perPage;
589589
const knex = await this.configureKnex();
590590

591-
const [{ large_dataset }, tableStructure] = await Promise.all([
592-
this.getRowsCount(knex, null, tableName, this.connection.database),
593-
this.getTableStructure(tableName),
594-
]);
591+
// const [{ large_dataset }, tableStructure] = await Promise.all([
592+
// this.getRowsCount(knex, null, tableName, this.connection.database),
593+
// this.getTableStructure(tableName),
594+
// ]);
595595

596-
if (large_dataset) {
597-
throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
598-
}
596+
const tableStructure = await this.getTableStructure(tableName);
597+
598+
// if (large_dataset) {
599+
// throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
600+
// }
599601

600602
const availableFields = this.findAvailableFields(settings, tableStructure);
601603

shared-code/src/data-access-layer/data-access-objects/data-access-object-postgres.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -590,16 +590,19 @@ export class DataAccessObjectPostgres extends BasicDataAccessObject implements I
590590
const offset = (page - 1) * perPage;
591591
const knex = await this.configureKnex();
592592

593-
const tableSchema = this.connection.schema ?? 'public';
594-
const [{ large_dataset }, tableStructure] = await Promise.all([
595-
this.getRowsCount(knex, null, tableName, tableSchema),
596-
this.getTableStructure(tableName),
597-
]);
593+
// const tableSchema = this.connection.schema ?? 'public';
594+
595+
// const [{ large_dataset }, tableStructure] = await Promise.all([
596+
// this.getRowsCount(knex, null, tableName, tableSchema),
597+
// this.getTableStructure(tableName),
598+
// ]);
599+
600+
const tableStructure = await this.getTableStructure(tableName);
598601
const availableFields = this.findAvailableFields(settings, tableStructure);
599602

600-
if (large_dataset) {
601-
throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
602-
}
603+
// if (large_dataset) {
604+
// throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
605+
// }
603606
const rowsAsStream = knex(tableName)
604607
.withSchema(this.connection.schema ?? 'public')
605608
.select(availableFields)

0 commit comments

Comments
 (0)