Crates.io | questdb-confstr |
lib.rs | questdb-confstr |
version | 0.1.0 |
source | src |
created_at | 2024-01-31 15:37:03.849861 |
updated_at | 2024-01-31 15:37:03.849861 |
description | A parser for a configuration string format handling service names and parameters |
homepage | |
repository | https://github.com/questdb/questdb-confstr-rs |
max_upload_size | |
id | 1121888 |
size | 37,475 |
questdb-confstr
Parser for a configuration string format used by QuestDB clients.
The format is as follows:
service::key1=value1;key2=value2;key3=value3;
A few rules:
0x00..=0x1f
and 0x7f..=0x9f
).;
appears in a value, these are escaped as double semicolon ;;
.conf_str ::= service "::" params | service
service ::= identifier
params ::= param (";" param)* ";"
param ::= key "=" value
key ::= identifier
value ::= { value_char }
identifier ::= alpha_num_under { alpha_num_under }
alpha_num_under ::= "a".."z" | "A".."Z" | "0".."9" | "_"
value_char ::= non_semicolon_char | escaped_semicolon
escaped_semicolon ::= ";;"
non_semicolon_char ::= ? any unicode character except ';', 0x00..=0x1f and 0x7f..=0x9f ?
Cargo.toml
cargo add questdb-confstr
Use the parse_conf_str
function to parse into a ConfStr
struct.
You can then access the service name as &str
and parameters as a &HashMap<String, String>
.
We use this config parsing format in our Rust, C, C++ and Python clients.
We also use it to configure object stores for database replication.