connection-string
Connection string parsing in Rust
Installation for Rust
$ cargo add connection-string
Usage for JavaScript
The crate is available in npm as @pimeys/connection-string
. Usage patters try
to follow the Rust version as close as possible. Please see the Rust
docs for more information.
JDBC:
const j = new JdbcString("jdbc:sqlserver://localhost\\INSTANCE:1433;database=master;user=SA;password={my_password;123}");
console.log(j.server_name());
console.log(j.port());
console.log(j.instance_name());
console.log(j.get("database"));
console.log(j.get("password"));
console.log(j.keys());
console.log(j.set("password", "a;;new;;password"));
console.log(j.to_string())
ADO.net:
const a = new AdoNetString("server=tcp:localhost,1433;user=SA;password=a{;;}new{;;}password");
console.log(a.get("password"));
console.log(a.set("user", "john"));
console.log(j.to_string())
Safety
This crate uses #![deny(unsafe_code)]
to ensure everything is implemented in
100% Safe Rust.
Contributing
Want to join us? Check out our "Contributing" guide and take a
look at some of these issues:
License
Licensed under either of Apache License, Version
2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.