mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 12:13:57 +00:00
fixed Syntax error when trying to sort by UUID column #895
This commit is contained in:
parent
888f5c6260
commit
a4872b4159
@ -278,7 +278,7 @@ export abstract class GridDisplay {
|
||||
|
||||
applySortOnSelect(select: Select, displayedColumnInfo: DisplayedColumnInfo) {
|
||||
if (this.config.sort?.length > 0) {
|
||||
select.orderBy = this.config.sort
|
||||
const orderByColumns = this.config.sort
|
||||
.map(col => ({ ...col, dispInfo: displayedColumnInfo[col.uniqueName] }))
|
||||
.map(col => ({ ...col, expr: select.columns.find(x => x.alias == col.uniqueName) }))
|
||||
.filter(col => col.dispInfo && col.expr)
|
||||
@ -286,6 +286,10 @@ export abstract class GridDisplay {
|
||||
...col.expr,
|
||||
direction: col.order,
|
||||
}));
|
||||
|
||||
if (orderByColumns.length > 0) {
|
||||
select.orderBy = orderByColumns;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,11 +105,11 @@ const dialect = {
|
||||
exprType: 'unaryRaw',
|
||||
expr: {
|
||||
exprType: 'column',
|
||||
alias: alias || columnName,
|
||||
source,
|
||||
columnName,
|
||||
},
|
||||
afterSql: '::text',
|
||||
alias: alias || columnName,
|
||||
};
|
||||
}
|
||||
},
|
||||
@ -136,9 +136,15 @@ const postgresDriverBase = {
|
||||
}
|
||||
|
||||
return (
|
||||
['authType', 'user', 'password', 'defaultDatabase', 'singleDatabase', 'isReadOnly', 'useSeparateSchemas'].includes(
|
||||
field
|
||||
) ||
|
||||
[
|
||||
'authType',
|
||||
'user',
|
||||
'password',
|
||||
'defaultDatabase',
|
||||
'singleDatabase',
|
||||
'isReadOnly',
|
||||
'useSeparateSchemas',
|
||||
].includes(field) ||
|
||||
(values.authType == 'socket' && ['socketPath'].includes(field)) ||
|
||||
(values.authType != 'socket' && ['server', 'port'].includes(field))
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user