Rust client for Microsoft SQL Server?

Hi! What is the current state-of-the-art when it comes to using Microsoft SQL Server from a Rust project? I know of, and currently use, the tiberius crate, but I can't seem to do any query that requires a list of values as a query parameter.

Example:

let working = Query::new("select id, name from table where id=@P1");
working.bind(x);

let wanted = Query::new("select id name from table where id in @P2");
wanted.bind([x, y, z]) // This does not work!

Is there a way to do this in tiberius? Or is there another crate that can do it?

This might help you:

Thanks! So, in conclusion, what I lacked wasn't really missing from tiberius, it was missing from Microsoft SQL Server. Perhaps it is time to actually switch over to Postgresql (which I use in other projects).

2 Likes

I think you might be interested in diesel-mssql. That crate implements a diesel backend/connection for the Microsoft SQL Server. It seems like most of the basic plumbing is already in place there, but there still seems to be some polishing needed. I think the author might be grateful for support figuring out the remaining details.

1 Like