Browse Source

fix: pagination bug fix

Signed-off-by: Pranav C <pranavxc@gmail.com>
test/query-opt-imp
Pranav C 2 years ago
parent
commit
e803ff6a54
  1. 5
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts
  2. 2
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts
  3. 1
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts

5
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

@ -201,7 +201,8 @@ class BaseModelSqlv2 {
sort?: string | string[];
fieldsSet?: Set<string>;
} = {},
ignoreViewFilterAndSort = false
ignoreViewFilterAndSort = false,
): Promise<any> {
const { where, fields, ...rest } = this._getListArgs(args as any);
@ -286,6 +287,8 @@ class BaseModelSqlv2 {
if (!ignoreViewFilterAndSort) applyPaginate(innerQb, rest);
const proto = await this.getProto();
console.log(wrapperQb.toQuery())
const data = await this.execAndParse(wrapperQb);
return data?.map((d) => {

2
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts

@ -821,7 +821,7 @@ export default async function formulaQueryBuilderv2(
model: Model,
column?: Column,
aliasToColumn = {},
tableAlias?: string
tableAlias?: string,
) {
// register jsep curly hook once only
jsep.plugins.register(jsepCurlyHook);

1
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/getAst.ts

@ -14,6 +14,7 @@ const getAst = async ({
model,
view,
dependencyFields = {
...(query || {}),
nested: { ...(query?.nested || {}) },
fieldsSet: new Set(),
},

Loading…
Cancel
Save