Installation for Rust
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 = ;
console.log; // "localhost"
console.log; // 1433
console.log; // "INSTANCE"
console.log; // "master"
console.log; // "my_password;123" (see escaping)
console.log; // ["database", "user", "password"]
console.log; // "my_password;123" (returns the old value, if available)
// "jdbc:sqlserver://localhost\INSTANCE:1433;user=SA;database=master;password=a{;;}new{;;}password"
console.log
ADO.net:
const a = ;
console.log; // a;;new;;password
console.log; // "SA" (returns the old value, if available)
// "server=tcp:localhost,1433;user=john;password=a{;;}new{;;}password"
console.log
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:
Building
The build procedure and dependencies are defined in the provided flake.nix file. Please install the unstable Nix with flakes support (Linux, macOS).
The WASM module can be built with:
This creates a link result
to the current directory, containing a NodeJS
package with the Rust code compiled as WASM bytecode.
Testing
Run the tests with the nix subcommand:
Publishing
The updatePackageVersion
command changes the package version to the Rust Cargo.toml
and
JavaScript package.json
at the same time:
Don't forget to add the tag before publishing the library:
The publishing can be done separately or together with the publish
command:
or
Please be sure you have the corresponding publishing rights in crates and npmjs.