1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//! Microsoft SQL Server driver for SQLx.
//!
//! `sqlx-sqlserver` is an independent split driver crate. Use it directly with
//! `sqlx-core` native APIs, or install its [`Any` driver][any::DRIVER] when an
//! application wants to open SQL Server URLs through `AnyConnection`.
//!
//! # Native connection
//!
//! ```no_run
//! use sqlx_core::connection::{ConnectOptions, Connection};
//! use sqlx_core::row::Row;
//! use sqlx_sqlserver::MssqlConnectOptions;
//!
//! # async fn run() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
//! let mut conn = "mssql://sa:Password123!@localhost:1433/master?encrypt=mandatory&trust_server_certificate=true"
//! .parse::<MssqlConnectOptions>()?
//! .connect()
//! .await?;
//!
//! let row = sqlx_core::query::query("SELECT 1")
//! .fetch_one(&mut conn)
//! .await?;
//!
//! let value: i32 = row.try_get(0)?;
//! assert_eq!(value, 1);
//!
//! conn.close().await?;
//! # Ok(())
//! # }
//! ```
//!
//! # `AnyConnection`
//!
//! Install this driver before connecting through SQLx `Any` APIs:
//!
//! ```no_run
//! use sqlx_core::connection::Connection;
//!
//! # async fn run() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
//! sqlx_core::any::driver::install_drivers(&[sqlx_sqlserver::any::DRIVER])?;
//!
//! let mut conn = sqlx_core::any::AnyConnection::connect(
//! "mssql://sa:Password123!@localhost:1433/master?encrypt=mandatory&trust_server_certificate=true",
//! )
//! .await?;
//!
//! conn.close().await?;
//! # Ok(())
//! # }
//! ```
//!
//! To combine split drivers, install all of them once at application startup:
//!
//! ```ignore
//! fn install() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
//! sqlx_core::any::driver::install_drivers(&[
//! sqlx_sqlserver::any::DRIVER,
//! sqlx_odbc::any::DRIVER,
//! ])?;
//! Ok(())
//! }
//! ```
//!
//! The examples use `trust_server_certificate=true` for local development with
//! SQL Server's self-signed container certificate. Production deployments should
//! prefer a trusted certificate and, when needed, `hostname_in_certificate` or
//! `ssl_root_cert` in [`MssqlConnectOptions`].
/// Connection option parsing and configuration for SQL Server.
pub use MssqlArguments;
pub use MssqlColumn;
pub use MssqlConnection;
pub use Mssql;
pub use MssqlDatabaseError;
pub use ;
pub use MssqlQueryResult;
pub use MssqlRow;
pub use MssqlStatement;
pub use MssqlTransactionManager;
pub use ;
pub use ;
/// An alias for [`Pool`][sqlx_core::pool::Pool], specialized for SQL Server.
pub type MssqlPool = Pool;
/// An alias for [`PoolOptions`][sqlx_core::pool::PoolOptions], specialized for SQL Server.
pub type MssqlPoolOptions = PoolOptions;
/// An alias for [`Transaction`][sqlx_core::transaction::Transaction], specialized for SQL Server.
pub type MssqlTransaction<'c> = Transaction;
/// An alias for [`Executor<'_, Database = Mssql>`][sqlx_core::executor::Executor].
impl_into_arguments_for_arguments!;
impl_encode_for_option!;
impl_acquire!;