Skip to content

Commit

Permalink
Revert "simpler syntax"
Browse files Browse the repository at this point in the history
This reverts commit 9d88421.
  • Loading branch information
Fil committed Nov 26, 2023
1 parent b4898a4 commit f9f9b48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/duckdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ async function insertFile(database, name, file, options) {
}
if (/\.parquet$/i.test(file.name)) {
return await connection.query(
`CREATE VIEW '${name}' AS FROM parquet_scan('${file.name}')`
`CREATE VIEW '${name}' AS SELECT * FROM parquet_scan('${file.name}')`
);
}
throw new Error(`unknown file type: ${file.mimeType}`);
Expand All @@ -220,7 +220,7 @@ async function insertFile(database, name, file, options) {

async function insertUntypedCSV(connection, file, name) {
const statement = await connection.prepare(
`CREATE TABLE '${name}' AS FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`
`CREATE TABLE '${name}' AS SELECT * FROM read_csv_auto(?, ALL_VARCHAR=TRUE)`
);
return await statement.send(file.name);
}
Expand Down

0 comments on commit f9f9b48

Please sign in to comment.