Skip to content

Commit

Permalink
cleanup query state
Browse files Browse the repository at this point in the history
  • Loading branch information
karooolis committed Feb 7, 2025
1 parent 6bb88cf commit ecaead9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ export function SQLEditor({ table, isLiveQuery, setIsLiveQuery }: Props) {
});
const currentQuery = form.watch("query");

const handleSubmit = form.handleSubmit((data) => {
if (validateQuery(data.query)) {
setQuery(data.query);
const handleSubmit = form.handleSubmit(({ query }) => {
if (validateQuery(query)) {
setQuery(query);
setIsUserTriggeredRefetch(true);
refetch().finally(() => setIsUserTriggeredRefetch(false));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ export function TablesViewer({ table, isLiveQuery }: Props) {
>
<div className="flex w-1/2 items-center gap-4">
<Input
type="search"
placeholder="Filter..."
value={globalFilter}
onChange={(event) => reactTable.setGlobalFilter(event.target.value)}
className="max-w-sm rounded border px-2 py-1"
className="max-w-xs rounded border px-2 py-1"
disabled={!tableData}
/>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { editor } from "monaco-editor/esm/vs/editor/editor.api";

export const PAGE_SIZE_OPTIONS = [5, 10, 20, 30, 40, 50, 100];

export const monacoOptions: editor.IStandaloneEditorConstructionOptions = {
fontSize: 14,
fontWeight: "normal",
Expand Down Expand Up @@ -94,5 +96,3 @@ export const suggestedSQLKeywords = [
"EXCEPT",
] as const;
export type SuggestedSQLKeyword = (typeof suggestedSQLKeywords)[number];

export const PAGE_SIZE_OPTIONS = [5, 10, 20, 30, 40, 50, 100];

0 comments on commit ecaead9

Please sign in to comment.