Skip to content

Commit e450b47

Browse files
committed
test
1 parent d9db2f2 commit e450b47

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

main.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ async function main() {
4343
});
4444
const output = command.spawn();
4545
output.stderr.pipeTo(Deno.stderr.writable);
46-
const stream = csv.parseStream(Readable.from(output.stdout), {
47-
headers: false,
48-
});
46+
const stream = csv
47+
.parseStream(Readable.from(output.stdout), {
48+
headers: false,
49+
})
50+
.on("error", (err) => {
51+
console.error(err);
52+
});
4953

5054
const seenQueries = new Set<number>();
5155
const recommendations: ReportIndexRecommendation[] = [];
@@ -158,13 +162,13 @@ async function main() {
158162
);
159163
if (out.newIndexes.size > 0) {
160164
console.log(dedent`
161-
Optimized cost from ${out.baseCost} to ${out.finalCost}
162-
Existing indexes: ${Array.from(out.existingIndexes).join(", ")}
163-
New indexes: ${Array.from(
164-
out.newIndexes,
165-
(n) => out.triedIndexes.get(n)?.definition
166-
).join(", ")}
167-
`);
165+
Optimized cost from ${out.baseCost} to ${out.finalCost}
166+
Existing indexes: ${Array.from(out.existingIndexes).join(", ")}
167+
New indexes: ${Array.from(
168+
out.newIndexes,
169+
(n) => out.triedIndexes.get(n)?.definition
170+
).join(", ")}
171+
`);
168172
recommendations.push({
169173
formattedQuery: formatQuery(query),
170174
baseCost: out.baseCost,

0 commit comments

Comments
 (0)