File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
sqlx-core/src/any/connection Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 1
1
use futures_core:: future:: BoxFuture ;
2
2
3
- use crate :: any:: { Any , AnyConnectOptions } ;
3
+ use crate :: any:: { Any , AnyConnectOptions , AnyKind } ;
4
4
use crate :: connection:: Connection ;
5
5
use crate :: error:: Error ;
6
6
@@ -47,6 +47,30 @@ pub(crate) enum AnyConnectionKind {
47
47
Sqlite ( sqlite:: SqliteConnection ) ,
48
48
}
49
49
50
+ impl AnyConnectionKind {
51
+ pub fn kind ( & self ) -> AnyKind {
52
+ match self {
53
+ #[ cfg( feature = "postgres" ) ]
54
+ AnyConnectionKind :: Postgres ( conn) => AnyKind :: Postgres ,
55
+
56
+ #[ cfg( feature = "mysql" ) ]
57
+ AnyConnectionKind :: MySql ( conn) => AnyKind :: MySql ,
58
+
59
+ #[ cfg( feature = "sqlite" ) ]
60
+ AnyConnectionKind :: Sqlite ( conn) => AnyKind :: Sqlite ,
61
+
62
+ #[ cfg( feature = "mssql" ) ]
63
+ AnyConnectionKind :: Mssql ( conn) => AnyKind :: Mssql ,
64
+ }
65
+ }
66
+ }
67
+
68
+ impl AnyConnection {
69
+ pub fn kind ( & self ) -> AnyKind {
70
+ self . 0 . kind ( )
71
+ }
72
+ }
73
+
50
74
macro_rules! delegate_to {
51
75
( $self: ident. $method: ident( $( $arg: ident) ,* ) ) => {
52
76
match & $self. 0 {
You can’t perform that action at this time.
0 commit comments