Skip to content

Commit

Permalink
tables view todo
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkal committed Mar 23, 2024
1 parent 6d69c44 commit bd596aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
22 changes: 14 additions & 8 deletions packages/admin/src/client/Sqler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,20 @@ export function Sqler() {
<div className={styles.querierPanel}>
<div className={styles.sqlerContainer}>
<div className={styles.editorContainer} style={{position: 'relative'}}>
<SqlCodeMirror
code={storedCode}
onChange={query => setStoredCode(query)}
onExecute={query => mut.mutate({query})}
inspected={inspected}
searchPath={inspectQuery.data?.searchPath}
errors={errors}
/>
{settings.view === 'sql' && (
<SqlCodeMirror
code={storedCode}
onChange={query => setStoredCode(query)}
onExecute={query => mut.mutate({query})}
inspected={inspected}
searchPath={inspectQuery.data?.searchPath}
errors={errors}
/>
)}
{settings.view === 'tables' && (
// todo: table renderer
<></>
)}
</div>
<div className={styles.jsonView}>
<jsonView.JsonView
Expand Down
3 changes: 3 additions & 0 deletions packages/admin/src/client/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const useSettingsProps = () => {
const [apiUrl, setApiUrl] = useLocalStorage('apiUrl.0.0.1', '')
const [includeSchemas, setIncludeSchemas] = useLocalStorage('includeSchemas.0.0.1', '')
const [excludeSchemas, setExcludeSchemas] = useLocalStorage('excludeSchemas.0.0.1', '')
const [view, setView] = useLocalStorage('view.0.0.1', 'sql' as 'sql' | 'tables')
const [headers, setHeaders] = useLocalStorage('headers.0.0.1', {
'connection-string': 'postgres://postgres:postgres@localhost:5432/postgres',
} as Record<string, string>)
Expand All @@ -32,6 +33,8 @@ const useSettingsProps = () => {
setHeader,
setHeaders,
setLayout,
view,
setView,
}
}

Expand Down

0 comments on commit bd596aa

Please sign in to comment.