Skip to content

Commit 5cb90e0

Browse files
committed
cast decimal to double by default
1 parent e7fbe15 commit 5cb90e0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/runtime/stdlib/duckdb.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ import * as duckdb from "npm:@duckdb/duckdb-wasm";
3232
const bundles = {
3333
mvp: {
3434
mainModule: "https://cdn.jsdelivr.net/npm/@duckdb/[email protected]/dist/duckdb-mvp.wasm",
35-
mainWorker: "https://cdn.jsdelivr.net/npm/@duckdb/[email protected]/dist/duckdb-browser-mvp.worker.js"
35+
mainWorker:
36+
"https://cdn.jsdelivr.net/npm/@duckdb/[email protected]/dist/duckdb-browser-mvp.worker.js"
3637
},
3738
eh: {
3839
mainModule: "https://cdn.jsdelivr.net/npm/@duckdb/[email protected]/dist/duckdb-eh.wasm",
39-
mainWorker: "https://cdn.jsdelivr.net/npm/@duckdb/[email protected]/dist/duckdb-browser-eh.worker.js"
40+
mainWorker:
41+
"https://cdn.jsdelivr.net/npm/@duckdb/[email protected]/dist/duckdb-browser-eh.worker.js"
4042
}
4143
};
4244
const bundle = duckdb.selectBundle(bundles);
@@ -162,6 +164,9 @@ export class DuckDBClient {
162164

163165
static async of(sources = {}, config = {}) {
164166
const db = await createDuckDB();
167+
if (config.query?.castDecimalToDouble === undefined) {
168+
config = {...config, query: {...config.query, castDecimalToDouble: true}};
169+
}
165170
if (config.query?.castTimestampToDate === undefined) {
166171
config = {...config, query: {...config.query, castTimestampToDate: true}};
167172
}

0 commit comments

Comments
 (0)