Skip to content

Commit ce803ad

Browse files
committed
Make the indentation more readable
1 parent 8c6de3f commit ce803ad

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

pages/index/index.page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const Page = observer(function Page() {
4949

5050
<div>Wrapped query:</div>
5151

52-
<div className="rounded bg-blue-50 form-textarea w-full whitespace-pre-wrap text-sm">
52+
<div className="font-mono rounded bg-blue-50 form-textarea w-full whitespace-pre-wrap text-sm">
5353
{parsed}
5454
</div>
5555
</div>

pages/index/state.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,14 @@ function generateJsonQuery(queries: Query[]) {
7575
const columns = parseOne(query);
7676
if (!columns || columns.length === 0) continue;
7777
parts.push(` '${query.name}',
78-
(
79-
select json_group_array(
80-
json_object(${columns.map((col) => `'${col}', ${col}`).join(', ')})
81-
)
82-
from
83-
(
84-
${indentString(query.sql, 8)}
85-
)
86-
)`);
78+
(
79+
select json_group_array(
80+
json_object(${columns.map((col) => `'${col}', ${col}`).join(', ')})
81+
)
82+
from (
83+
${indentString(query.sql, 6)}
84+
)
85+
)`);
8786
}
8887

8988
const result = `select json_object(

0 commit comments

Comments
 (0)