Skip to content

Commit 2c78063

Browse files
authored
Update index.ts
1 parent ccac4b3 commit 2c78063

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,14 @@ async function executeQueryTable(query: string): Promise<string[]> {
6161
// const chunks = ['```sql\n', query, ' \n', '```\n', '\n'];
6262
// Format the result into a markdown table
6363
if (result.length > 0) {
64-
chunks.push('```\n');
6564
const headers = Object.keys(result[0]);
6665
chunks.push('| ' + headers.join(' | ') + ' |\n');
67-
chunks.push('|' + headers.map(() => '---').join('|') + ' |\n');
66+
chunks.push('| ' + headers.map(() => '---').join(' | ') + ' |\n');
6867
result.forEach(row => {
6968
const values = headers.map(header => row[header]);
7069
chunks.push('| ' + values.join(' | ') + ' |\n');
7170
});
72-
chunks.push('```\n');
71+
chunks.push('\n');
7372
} else {
7473
chunks.push('No results found.\n');
7574
}

0 commit comments

Comments
 (0)