Skip to content

Commit f4385da

Browse files
authored
fix: custom settings for duckdb (#682)
1 parent e59405c commit f4385da

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ homepage = "https://stac-utils.github.io/stac-rs"
2525
repository = "https://github.com/stac-utils/stac-rs"
2626
license = "MIT OR Apache-2.0"
2727
categories = ["science", "data-structures"]
28-
rust-version = "1.82"
28+
rust-version = "1.83"
2929

3030
[workspace.dependencies]
3131
anyhow = "1.0"

crates/duckdb/src/lib.rs

+23-2
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ impl Client {
200200
let connection = Connection::open_in_memory()?;
201201
if let Some(ref custom_extension_repository) = config.custom_extension_repository {
202202
connection.execute(
203-
"SET custom_extension_repository = '?'",
203+
"SET custom_extension_repository = ?",
204204
[custom_extension_repository],
205205
)?;
206206
}
207207
if let Some(ref extension_directory) = config.extension_directory {
208-
connection.execute("SET extension_directory = '?'", [extension_directory])?;
208+
connection.execute("SET extension_directory = ?", [extension_directory])?;
209209
}
210210
if config.install_extensions {
211211
connection.execute("INSTALL spatial", [])?;
@@ -606,6 +606,27 @@ mod tests {
606606
.unwrap();
607607
}
608608

609+
#[test]
610+
fn extension_directory() {
611+
let _mutex = MUTEX.lock().unwrap();
612+
let temp_dir = std::env::temp_dir();
613+
let config = Config {
614+
extension_directory: Some(temp_dir.to_string_lossy().to_string()),
615+
..Default::default()
616+
};
617+
let _ = Client::with_config(config).unwrap();
618+
}
619+
620+
#[test]
621+
fn custom_extension_repository() {
622+
let _mutex = MUTEX.lock().unwrap();
623+
let config = Config {
624+
custom_extension_repository: Some(".".to_string()),
625+
..Default::default()
626+
};
627+
let _ = Client::with_config(config).unwrap();
628+
}
629+
609630
#[rstest]
610631
fn search_all(client: Client) {
611632
let item_collection = client

0 commit comments

Comments
 (0)