Skip to content

Commit

Permalink
ado string support for mssql
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Decker committed May 31, 2022
1 parent 70cdd62 commit 458102f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions connectorx/src/sources/mssql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ pub fn mssql_config(url: &Url) -> Config {
impl MsSQLSource {
#[throws(MsSQLSourceError)]
pub fn new(rt: Arc<Runtime>, conn: &str, nconn: usize) -> Self {
let url = Url::parse(conn)?;
let config = mssql_config(&url)?;
// If it doesn't look like a URL, then it might be an ADO string
let config = if let Ok(url) = Url::parse(conn) {
mssql_config(&url)?
} else {
Config::from_ado_string(conn)?
};
let manager = bb8_tiberius::ConnectionManager::new(config);
let pool = rt.block_on(Pool::builder().max_size(nconn as u32).build(manager))?;

Expand Down

0 comments on commit 458102f

Please sign in to comment.