Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ADO string support for mssql #295

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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