mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 20:46:01 +00:00
perspectives: support nosql other than mongo
This commit is contained in:
@@ -123,7 +123,7 @@ export class PerspectiveDataLoader {
|
||||
groupByColumns: bindingColumns,
|
||||
aggregateColumns: [
|
||||
{
|
||||
alias: 'acount',
|
||||
alias: 'pergrpsize',
|
||||
aggregateFunction: 'count',
|
||||
},
|
||||
],
|
||||
@@ -156,8 +156,8 @@ export class PerspectiveDataLoader {
|
||||
|
||||
if (response.errorMessage) return response;
|
||||
return response.rows.map(row => ({
|
||||
...row._id,
|
||||
_perspective_group_size_: parseInt(row.count),
|
||||
...row,
|
||||
_perspective_group_size_: parseInt(row.pergrpsize),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -463,6 +463,8 @@ export abstract class PerspectiveTreeNode {
|
||||
order: 'ASC' as 'ASC',
|
||||
}));
|
||||
if (pkColumns) return pkColumns;
|
||||
const uqColumns = (table as CollectionInfo)?.uniqueKey;
|
||||
if (uqColumns?.length >= 1) return uqColumns.map(x => ({ columnName: x.columnName, order: 'ASC' }));
|
||||
const columns = (table as TableInfo | ViewInfo)?.columns;
|
||||
if (columns) return [{ columnName: columns[0].columnName, order: 'ASC' }];
|
||||
return [{ columnName: '_id', order: 'ASC' }];
|
||||
|
||||
Reference in New Issue
Block a user