mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 17:26:01 +00:00
join wizard
This commit is contained in:
@@ -103,17 +103,20 @@ export default function InsertJoinModal({ sql, modalState, engine, dbinfo, onIns
|
||||
if (event.keyCode == keycodes.leftArrow) {
|
||||
targetRef.current.focus();
|
||||
}
|
||||
if (event.keyCode == keycodes.enter || event.keyCode == keycodes.rightArrow) {
|
||||
if (event.keyCode == keycodes.enter) {
|
||||
aliasRef.current.focus();
|
||||
}
|
||||
}, []);
|
||||
const aliasKeyDown = React.useCallback((event) => {
|
||||
if (event.keyCode == keycodes.enter) {
|
||||
event.preventDefault();
|
||||
modalState.close();
|
||||
onInsert(sqlPreview);
|
||||
}
|
||||
}, []);
|
||||
const aliasKeyDown = React.useCallback(
|
||||
(event) => {
|
||||
if (event.keyCode == keycodes.enter) {
|
||||
event.preventDefault();
|
||||
modalState.close();
|
||||
onInsert(sqlPreview);
|
||||
}
|
||||
},
|
||||
[onInsert, sqlPreview]
|
||||
);
|
||||
|
||||
return (
|
||||
<ModalBase modalState={modalState}>
|
||||
|
||||
@@ -18,14 +18,15 @@ export default function analyseQuerySources(sql, sourceNames) {
|
||||
res.push({
|
||||
name: word,
|
||||
});
|
||||
}
|
||||
if (/^(where)|(inner)|(left)|(right)|(on)$/i.test(postWord)) {
|
||||
continue;
|
||||
}
|
||||
res.push({
|
||||
name: word,
|
||||
alias: postWord,
|
||||
});
|
||||
} else if (/^(where)|(inner)|(left)|(right)|(on)$/i.test(postWord)) {
|
||||
res.push({
|
||||
name: word,
|
||||
});
|
||||
} else
|
||||
res.push({
|
||||
name: word,
|
||||
alias: postWord,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user