Skip to content

Commit 60e6646

Browse files
authored
fix describe{Tables,Columns} (#1068)
1 parent 84d3e5c commit 60e6646

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/client/stdlib/duckdb.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,19 @@ export class DuckDBClient {
146146
}
147147

148148
async describeTables() {
149-
const tables = await this.query("SHOW TABLES");
150-
return tables.map(({name}) => ({name}));
149+
return Array.from(await this.query("SHOW TABLES"), ({name}) => ({name}));
151150
}
152151

153152
async describeColumns({table} = {}) {
154-
const columns = await this.query(`DESCRIBE ${this.escape(table)}`);
155-
return columns.map(({column_name, column_type, null: nullable}) => ({
156-
name: column_name,
157-
type: getDuckDBType(column_type),
158-
nullable: nullable !== "NO",
159-
databaseType: column_type
160-
}));
153+
return Array.from(
154+
await this.query(`DESCRIBE ${this.escape(table)}`),
155+
({column_name, column_type, null: nullable}) => ({
156+
name: column_name,
157+
type: getDuckDBType(column_type),
158+
nullable: nullable !== "NO",
159+
databaseType: column_type
160+
})
161+
);
161162
}
162163

163164
static async of(sources = {}, config = {}) {

0 commit comments

Comments
 (0)