diff --git a/packages/nc-gui/components/CreateOrEditProject.vue b/packages/nc-gui/components/CreateOrEditProject.vue index fe943c6354..12db72c65a 100644 --- a/packages/nc-gui/components/CreateOrEditProject.vue +++ b/packages/nc-gui/components/CreateOrEditProject.vue @@ -453,14 +453,14 @@ " /> - + { - const qb = this.dbDriver(this.model.table_name); + const qb = this.dbDriver(this.tnPath); await this.selectObject({ qb }); @@ -106,7 +106,7 @@ class BaseModelSqlv2 { } public async exist(id?: any): Promise { - const qb = this.dbDriver(this.model.table_name); + const qb = this.dbDriver(this.tnPath); await this.selectObject({ qb }); const pks = this.model.primaryKeys; if ((id + '').split('___').length != pks.length) { @@ -122,7 +122,7 @@ class BaseModelSqlv2 { sort?: string | string[]; } = {} ): Promise { - const qb = this.dbDriver(this.model.table_name); + const qb = this.dbDriver(this.tnPath); await this.selectObject({ qb }); const aliasColObjMap = await this.model.getAliasColObjMap(); @@ -175,15 +175,12 @@ class BaseModelSqlv2 { ): Promise { const { where, ...rest } = this._getListArgs(args as any); - const qb = this.dbDriver(this.model.table_name); + const qb = this.dbDriver(this.tnPath); await this.selectObject({ qb }); const aliasColObjMap = await this.model.getAliasColObjMap(); - let sorts = extractSortsObject(args?.sort, aliasColObjMap); - const filterObj = extractFilterFromXwhere(args?.where, aliasColObjMap); - // todo: replace with view id if (!ignoreFilterSort && this.viewId) { await conditionV2( @@ -249,7 +246,6 @@ class BaseModelSqlv2 { if (!ignoreFilterSort) applyPaginate(qb, rest); const proto = await this.getProto(); - const data = await this.extractRawQueryAndExec(qb); return data?.map(d => { @@ -265,7 +261,7 @@ class BaseModelSqlv2 { await this.model.getColumns(); const { where } = this._getListArgs(args); - const qb = this.dbDriver(this.model.table_name); + const qb = this.dbDriver(this.tnPath); // qb.xwhere(where, await this.model.getAliasColMapping()); const aliasColObjMap = await this.model.getAliasColObjMap(); @@ -334,7 +330,7 @@ class BaseModelSqlv2 { ) { const { where, ...rest } = this._getListArgs(args as any); - const qb = this.dbDriver(this.model.table_name); + const qb = this.dbDriver(this.tnPath); qb.count(`${this.model.primaryKey?.column_name || '*'} as count`); qb.select(args.column_name); @@ -1618,7 +1614,7 @@ class BaseModelSqlv2 { } else { await this.model.getColumns(); const { where } = this._getListArgs(args); - const qb = this.dbDriver(this.model.table_name); + const qb = this.dbDriver(this.tnPath); const aliasColObjMap = await this.model.getAliasColObjMap(); const filterObj = extractFilterFromXwhere(where, aliasColObjMap); @@ -1680,7 +1676,7 @@ class BaseModelSqlv2 { try { await this.model.getColumns(); const { where } = this._getListArgs(args); - const qb = this.dbDriver(this.model.table_name); + const qb = this.dbDriver(this.tnPath); const aliasColObjMap = await this.model.getAliasColObjMap(); const filterObj = extractFilterFromXwhere(where, aliasColObjMap);