@@ -87,34 +87,6 @@ impl AnyConnection {
8787 pub fn private_get_mut ( & mut self ) -> & mut AnyConnectionKind {
8888 & mut self . 0
8989 }
90-
91- /// Returns the runtime DBMS name for this connection.
92- ///
93- /// For most built-in drivers this returns a well-known constant string:
94- /// - Postgres -> "PostgreSQL"
95- /// - MySQL -> "MySQL"
96- /// - SQLite -> "SQLite"
97- /// - MSSQL -> "Microsoft SQL Server"
98- ///
99- /// For ODBC, this queries the driver at runtime via `SQL_DBMS_NAME`.
100- pub async fn dbms_name ( & mut self ) -> Result < String , Error > {
101- match & mut self . 0 {
102- #[ cfg( feature = "postgres" ) ]
103- AnyConnectionKind :: Postgres ( _) => Ok ( "PostgreSQL" . to_string ( ) ) ,
104-
105- #[ cfg( feature = "mysql" ) ]
106- AnyConnectionKind :: MySql ( _) => Ok ( "MySQL" . to_string ( ) ) ,
107-
108- #[ cfg( feature = "sqlite" ) ]
109- AnyConnectionKind :: Sqlite ( _) => Ok ( "SQLite" . to_string ( ) ) ,
110-
111- #[ cfg( feature = "mssql" ) ]
112- AnyConnectionKind :: Mssql ( _) => Ok ( "Microsoft SQL Server" . to_string ( ) ) ,
113-
114- #[ cfg( feature = "odbc" ) ]
115- AnyConnectionKind :: Odbc ( conn) => conn. dbms_name ( ) . await ,
116- }
117- }
11890}
11991
12092macro_rules! delegate_to {
@@ -264,6 +236,25 @@ impl Connection for AnyConnection {
264236 fn should_flush ( & self ) -> bool {
265237 delegate_to ! ( self . should_flush( ) )
266238 }
239+
240+ fn dbms_name ( & mut self ) -> BoxFuture < ' _ , Result < String , Error > > {
241+ match & mut self . 0 {
242+ #[ cfg( feature = "postgres" ) ]
243+ AnyConnectionKind :: Postgres ( conn) => conn. dbms_name ( ) ,
244+
245+ #[ cfg( feature = "mysql" ) ]
246+ AnyConnectionKind :: MySql ( conn) => conn. dbms_name ( ) ,
247+
248+ #[ cfg( feature = "sqlite" ) ]
249+ AnyConnectionKind :: Sqlite ( conn) => conn. dbms_name ( ) ,
250+
251+ #[ cfg( feature = "mssql" ) ]
252+ AnyConnectionKind :: Mssql ( conn) => conn. dbms_name ( ) ,
253+
254+ #[ cfg( feature = "odbc" ) ]
255+ AnyConnectionKind :: Odbc ( conn) => conn. dbms_name ( ) ,
256+ }
257+ }
267258}
268259
269260#[ cfg( feature = "postgres" ) ]
0 commit comments