Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -529,17 +529,16 @@ WHERE TABLE_TYPE = 'VIEW'
: DAO_CONSTANTS.DEFAULT_PAGINATION.perPage;

const knex = await this.configureKnex();
const [rowsCount, tableStructure, tableSchema] = await Promise.all([
this.getRowsCount(tableName, null),
const [tableStructure, tableSchema] = await Promise.all([
this.getTableStructure(tableName),
this.getSchemaName(tableName),
]);

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

if (rowsCount >= DAO_CONSTANTS.LARGE_DATASET_ROW_LIMIT) {
throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
}
// if (rowsCount >= DAO_CONSTANTS.LARGE_DATASET_ROW_LIMIT) {
// throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
// }

if (tableSchema) {
tableName = `${tableSchema}.[${tableName}]`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,14 +588,16 @@ export class DataAccessObjectMysql extends BasicDataAccessObject implements IDat
const offset = (page - 1) * perPage;
const knex = await this.configureKnex();

const [{ large_dataset }, tableStructure] = await Promise.all([
this.getRowsCount(knex, null, tableName, this.connection.database),
this.getTableStructure(tableName),
]);
// const [{ large_dataset }, tableStructure] = await Promise.all([
// this.getRowsCount(knex, null, tableName, this.connection.database),
// this.getTableStructure(tableName),
// ]);

if (large_dataset) {
throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
}
const tableStructure = await this.getTableStructure(tableName);

// if (large_dataset) {
// throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
// }

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,16 +590,19 @@ export class DataAccessObjectPostgres extends BasicDataAccessObject implements I
const offset = (page - 1) * perPage;
const knex = await this.configureKnex();

const tableSchema = this.connection.schema ?? 'public';
const [{ large_dataset }, tableStructure] = await Promise.all([
this.getRowsCount(knex, null, tableName, tableSchema),
this.getTableStructure(tableName),
]);
// const tableSchema = this.connection.schema ?? 'public';

// const [{ large_dataset }, tableStructure] = await Promise.all([
// this.getRowsCount(knex, null, tableName, tableSchema),
// this.getTableStructure(tableName),
// ]);

const tableStructure = await this.getTableStructure(tableName);
const availableFields = this.findAvailableFields(settings, tableStructure);

if (large_dataset) {
throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
}
// if (large_dataset) {
// throw new Error(ERROR_MESSAGES.DATA_IS_TO_LARGE);
// }
const rowsAsStream = knex(tableName)
.withSchema(this.connection.schema ?? 'public')
.select(availableFields)
Expand Down