Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/include/duckdb/web/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ struct WebDBConfig {
/// Whether to allow unsigned extensions
bool allow_unsigned_extensions = false;

/// Whether to use alternate Arrow conversion that preserves full range and precision of data.
bool arrow_lossless_conversion = false;

std::string custom_user_agent = "";

/// Read from a document
Expand Down
4 changes: 4 additions & 0 deletions lib/src/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ WebDBConfig WebDBConfig::ReadFrom(std::string_view args_json) {
.s3_session_token = "",
},
.allow_unsigned_extensions = false,
.arrow_lossless_conversion = false,
.custom_user_agent = ""};
rapidjson::Document doc;
rapidjson::ParseResult ok = doc.Parse(args_json.begin(), args_json.size());
Expand All @@ -76,6 +77,9 @@ WebDBConfig WebDBConfig::ReadFrom(std::string_view args_json) {
if (doc.HasMember("allowUnsignedExtensions") && doc["allowUnsignedExtensions"].IsBool()) {
config.allow_unsigned_extensions = doc["allowUnsignedExtensions"].GetBool();
}
if (doc.HasMember("arrowLosslessConversion") && doc["arrowLosslessConversion"].IsBool()) {
config.arrow_lossless_conversion = doc["arrowLosslessConversion"].GetBool();
}
if (doc.HasMember("useDirectIO") && doc["useDirectIO"].IsBool()) {
config.use_direct_io = doc["useDirectIO"].GetBool();
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/webdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ arrow::Status WebDB::Open(std::string_view args_json) {
duckdb::DBConfig db_config;
db_config.file_system = std::move(make_uniq<VirtualFileSystem>(std::move(buffered_fs)));
db_config.options.allow_unsigned_extensions = config_->allow_unsigned_extensions;
db_config.options.arrow_lossless_conversion = config_->arrow_lossless_conversion;
db_config.options.maximum_threads = config_->maximum_threads;
db_config.options.use_temporary_directory = false;
db_config.options.access_mode = access_mode;
Expand Down
4 changes: 4 additions & 0 deletions packages/duckdb-wasm/src/bindings/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export interface DuckDBConfig {
* Whether to allow unsigned extensions
*/
allowUnsignedExtensions?: boolean;
/**
* Whether to use alternate Arrow conversion that preserves full range and precision of data.
*/
arrowLosslessConversion?: boolean;
/**
* Custom user agent string
*/
Expand Down