mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 16:13:58 +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) {
|
if (event.keyCode == keycodes.leftArrow) {
|
||||||
targetRef.current.focus();
|
targetRef.current.focus();
|
||||||
}
|
}
|
||||||
if (event.keyCode == keycodes.enter || event.keyCode == keycodes.rightArrow) {
|
if (event.keyCode == keycodes.enter) {
|
||||||
aliasRef.current.focus();
|
aliasRef.current.focus();
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
const aliasKeyDown = React.useCallback((event) => {
|
const aliasKeyDown = React.useCallback(
|
||||||
if (event.keyCode == keycodes.enter) {
|
(event) => {
|
||||||
event.preventDefault();
|
if (event.keyCode == keycodes.enter) {
|
||||||
modalState.close();
|
event.preventDefault();
|
||||||
onInsert(sqlPreview);
|
modalState.close();
|
||||||
}
|
onInsert(sqlPreview);
|
||||||
}, []);
|
}
|
||||||
|
},
|
||||||
|
[onInsert, sqlPreview]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalBase modalState={modalState}>
|
<ModalBase modalState={modalState}>
|
||||||
|
|||||||
@@ -18,14 +18,15 @@ export default function analyseQuerySources(sql, sourceNames) {
|
|||||||
res.push({
|
res.push({
|
||||||
name: word,
|
name: word,
|
||||||
});
|
});
|
||||||
}
|
} else if (/^(where)|(inner)|(left)|(right)|(on)$/i.test(postWord)) {
|
||||||
if (/^(where)|(inner)|(left)|(right)|(on)$/i.test(postWord)) {
|
res.push({
|
||||||
continue;
|
name: word,
|
||||||
}
|
});
|
||||||
res.push({
|
} else
|
||||||
name: word,
|
res.push({
|
||||||
alias: postWord,
|
name: word,
|
||||||
});
|
alias: postWord,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user