Skip to content

Commit 9773e31

Browse files
fix defautl key value for scans
1 parent ec48f9b commit 9773e31

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Usage
104104
Specifies which column should be treated as the unique row identifier.
105105
Usually set to key.
106106

107-
- **prefix** as *string*, optional, default `/`
107+
- **prefix** as *string*, optional, default ``
108108

109109
Restrict the scan to keys beginning with this prefix.
110110
If not provided, the FDW will fetch all keys from the etcd server

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ impl ForeignDataWrapper<EtcdFdwError> for EtcdFdw {
275275
self.fetch_key = colnames.contains(&String::from("key"));
276276
self.fetch_value = colnames.contains(&String::from("value"));
277277

278-
let key = prefix.clone().unwrap_or_else(|| String::from("/"));
278+
// samllest possible valid key '\0', empty string will not work with with_range
279+
let key = prefix.clone().unwrap_or_else(|| String::from("\0"));
279280
let result = self
280281
.rt
281282
.block_on(self.client.get(key, Some(get_options)));

0 commit comments

Comments
 (0)