mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
support for distinct in query designer
This commit is contained in:
parent
1494fe3078
commit
fb9069efe8
@ -106,6 +106,7 @@ export function generateDesignedQuery(designer: DesignerInfo, engine: EngineDriv
|
||||
const componentCreator = new DesignerComponentCreator(designer);
|
||||
const designerDumper = new DesignerQueryDumper(designer, componentCreator.components);
|
||||
const select = designerDumper.run();
|
||||
select.distinct = !!designer?.settings?.isDistinct;
|
||||
|
||||
const dmp = engine.createDumper();
|
||||
dumpSqlSelect(dmp, select);
|
||||
|
@ -33,7 +33,12 @@ export type DesignerColumnInfo = {
|
||||
groupFilter?: string;
|
||||
};
|
||||
|
||||
export type DesignerSettings = {
|
||||
isDistinct?: boolean;
|
||||
};
|
||||
|
||||
export type DesignerInfo = {
|
||||
settings?: DesignerSettings;
|
||||
tables: DesignerTableInfo[];
|
||||
columns: DesignerColumnInfo[];
|
||||
references: DesignerReferenceInfo[];
|
||||
|
@ -215,6 +215,22 @@
|
||||
{ divider: true },
|
||||
{ command: 'designer.undo' },
|
||||
{ command: 'designer.redo' },
|
||||
{ divider: true },
|
||||
{
|
||||
text: `Remove duplicates: ${$editorState.value?.settings?.isDistinct ? 'YES' : 'NO'}`,
|
||||
onClick: () => {
|
||||
handleChange(
|
||||
{
|
||||
...$editorState.value,
|
||||
settings: {
|
||||
...$editorState.value?.settings,
|
||||
isDistinct: !$editorState.value?.settings?.isDistinct,
|
||||
},
|
||||
},
|
||||
false
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user