Skip to content

Commit 4bb3cc0

Browse files
committed
format code
1 parent e65775e commit 4bb3cc0

File tree

5 files changed

+22
-27
lines changed

5 files changed

+22
-27
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
# README
2-

src/components/panels/editor/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
hasConfiguredDatabaseAtom,
1919
queryAtom,
2020
queryResultAtom,
21-
schemaAtom,
2221
showChatAtom,
2322
} from '~/lib/utils/atoms';
2423
import { runQuery } from '~/lib/utils/query';
@@ -27,7 +26,7 @@ import { theme } from './theme';
2726
type RunQuery = {
2827
query: string;
2928
connectionString: string;
30-
}
29+
};
3130
export const Editor = () => {
3231
const { toast } = useToast();
3332
const { resolvedTheme } = useTheme();
@@ -116,10 +115,7 @@ export const Editor = () => {
116115
height="93vh"
117116
/>
118117
<div className="sticky bottom-10 mx-5 float-right">
119-
<Button
120-
onClick={executeQuery}
121-
disabled={query.trimEnd() === '' || !hasConfiguredDatabase}
122-
>
118+
<Button onClick={executeQuery} disabled={query.trimEnd() === '' || !hasConfiguredDatabase}>
123119
<PlayIcon className="mr-1 h-4 w-4" />
124120
{isLoading ? 'Running...' : 'Run query'}
125121
</Button>

src/components/ui/sheet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const sheetVariants = cva(
5555

5656
interface SheetContentProps
5757
extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,
58-
VariantProps<typeof sheetVariants> { }
58+
VariantProps<typeof sheetVariants> {}
5959

6060
const SheetContent = React.forwardRef<
6161
React.ElementRef<typeof SheetPrimitive.Content>,

src/lib/utils/connect.ts

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -152,29 +152,31 @@ const generateDatabaseSchema = (tables: any[], views: any[], functions: any[]) =
152152
tables.forEach((table) => {
153153
// @ts-ignore
154154
table.columns.forEach((column) => {
155-
databaseSchema += `${table.table_name}, ${column.column_name}, ${column.data_type
156-
}, ${table.indexes.join(';')}, ${table.triggers
157-
.map(
158-
// @ts-ignore
159-
(trigger) =>
160-
`${trigger.trigger_name} (${trigger.trigger_type}) - ${trigger.function_name}`
161-
)
162-
.join(';')}\n`;
155+
databaseSchema += `${table.table_name}, ${column.column_name}, ${
156+
column.data_type
157+
}, ${table.indexes.join(';')}, ${table.triggers
158+
.map(
159+
// @ts-ignore
160+
(trigger) =>
161+
`${trigger.trigger_name} (${trigger.trigger_type}) - ${trigger.function_name}`
162+
)
163+
.join(';')}\n`;
163164
});
164165
});
165166

166167
views.forEach((view) => {
167168
// @ts-ignore
168169
view.columns.forEach((column) => {
169-
databaseSchema += `${view.table_name}, ${column.column_name}, ${column.data_type
170-
}, ${view.indexes.join(';')}, ${view.triggers
171-
.map(
172-
// @ts-ignore
173-
174-
(trigger) =>
175-
`${trigger.trigger_name} (${trigger.trigger_type}) - ${trigger.function_name}`
176-
)
177-
.join(';')}\n`;
170+
databaseSchema += `${view.table_name}, ${column.column_name}, ${
171+
column.data_type
172+
}, ${view.indexes.join(';')}, ${view.triggers
173+
.map(
174+
// @ts-ignore
175+
176+
(trigger) =>
177+
`${trigger.trigger_name} (${trigger.trigger_type}) - ${trigger.function_name}`
178+
)
179+
.join(';')}\n`;
178180
});
179181
});
180182

@@ -212,7 +214,6 @@ export const connect = async ({ connectionString, schema = 'public' }: ConnectOp
212214

213215
const databaseSchema = generateDatabaseSchema(tables, views, functions);
214216

215-
216217
const editorSchema = {
217218
schema: tables.reduce((acc, table) => {
218219
// @ts-ignore

src/lib/utils/query.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export const runQuery = async ({ connectionString, query }: queryOptions) => {
1919

2020
startTime = Date.now();
2121

22-
2322
return {
2423
rows: rows ?? [],
2524
rowCount: rowCount ?? 0,

0 commit comments

Comments
 (0)