11use crate :: {
22 connection:: {
3- contracts:: DbConnection , database_type:: DatabaseType , db_connector:: DatabaseConnection ,
3+ contracts:: DbConnection , database_type:: DatabaseType , db_connector:: DatabaseConnector ,
44 } ,
55 mapper:: RowMapper ,
66 query:: parameters:: QueryParameter ,
77 rows:: { CanyonRows , FromSqlOwnedValue } ,
88} ;
99use std:: error:: Error ;
1010
11- impl DbConnection for DatabaseConnection {
11+ impl DbConnection for DatabaseConnector {
1212 async fn query_rows (
1313 & self ,
1414 stmt : & str ,
@@ -62,7 +62,7 @@ impl DbConnection for DatabaseConnection {
6262 }
6363}
6464
65- impl DbConnection for & DatabaseConnection {
65+ impl DbConnection for & DatabaseConnector {
6666 async fn query_rows (
6767 & self ,
6868 stmt : & str ,
@@ -116,7 +116,7 @@ impl DbConnection for &DatabaseConnection {
116116 }
117117}
118118
119- impl DbConnection for & mut DatabaseConnection {
119+ impl DbConnection for & mut DatabaseConnector {
120120 async fn query_rows (
121121 & self ,
122122 stmt : & str ,
@@ -171,24 +171,24 @@ impl DbConnection for &mut DatabaseConnection {
171171}
172172
173173pub ( crate ) async fn db_conn_query_rows_impl < ' a > (
174- c : & DatabaseConnection ,
174+ c : & DatabaseConnector ,
175175 stmt : & str ,
176176 params : & [ & ' a ( dyn QueryParameter + ' a ) ] ,
177177) -> Result < CanyonRows , Box < dyn Error + Send + Sync > > {
178178 match c {
179179 #[ cfg( feature = "postgres" ) ]
180- DatabaseConnection :: Postgres ( client) => client. query_rows ( stmt, params) . await ,
180+ DatabaseConnector :: Postgres ( client) => client. query_rows ( stmt, params) . await ,
181181
182182 #[ cfg( feature = "mssql" ) ]
183- DatabaseConnection :: SqlServer ( client) => client. query_rows ( stmt, params) . await ,
183+ DatabaseConnector :: SqlServer ( client) => client. query_rows ( stmt, params) . await ,
184184
185185 #[ cfg( feature = "mysql" ) ]
186- DatabaseConnection :: MySQL ( client) => client. query_rows ( stmt, params) . await ,
186+ DatabaseConnector :: MySQL ( client) => client. query_rows ( stmt, params) . await ,
187187 }
188188}
189189
190190pub ( crate ) async fn db_conn_query_one_impl < R > (
191- c : & DatabaseConnection ,
191+ c : & DatabaseConnector ,
192192 stmt : & str ,
193193 params : & [ & ' _ ( dyn QueryParameter + ' _ ) ] ,
194194) -> Result < Option < R :: Output > , Box < dyn Error + Send + Sync > >
@@ -197,18 +197,18 @@ where
197197{
198198 match c {
199199 #[ cfg( feature = "postgres" ) ]
200- DatabaseConnection :: Postgres ( client) => client. query_one :: < R > ( stmt, params) . await ,
200+ DatabaseConnector :: Postgres ( client) => client. query_one :: < R > ( stmt, params) . await ,
201201
202202 #[ cfg( feature = "mssql" ) ]
203- DatabaseConnection :: SqlServer ( client) => client. query_one :: < R > ( stmt, params) . await ,
203+ DatabaseConnector :: SqlServer ( client) => client. query_one :: < R > ( stmt, params) . await ,
204204
205205 #[ cfg( feature = "mysql" ) ]
206- DatabaseConnection :: MySQL ( client) => client. query_one :: < R > ( stmt, params) . await ,
206+ DatabaseConnector :: MySQL ( client) => client. query_one :: < R > ( stmt, params) . await ,
207207 }
208208}
209209
210210pub ( crate ) async fn db_conn_query_impl < S , R > (
211- c : & DatabaseConnection ,
211+ c : & DatabaseConnector ,
212212 stmt : S ,
213213 params : & [ & ' _ dyn QueryParameter ] ,
214214) -> Result < Vec < R > , Box < dyn Error + Send + Sync > >
@@ -219,18 +219,18 @@ where
219219{
220220 match c {
221221 #[ cfg( feature = "postgres" ) ]
222- DatabaseConnection :: Postgres ( client) => client. query ( stmt, params) . await ,
222+ DatabaseConnector :: Postgres ( client) => client. query ( stmt, params) . await ,
223223
224224 #[ cfg( feature = "mssql" ) ]
225- DatabaseConnection :: SqlServer ( client) => client. query ( stmt, params) . await ,
225+ DatabaseConnector :: SqlServer ( client) => client. query ( stmt, params) . await ,
226226
227227 #[ cfg( feature = "mysql" ) ]
228- DatabaseConnection :: MySQL ( client) => client. query ( stmt, params) . await ,
228+ DatabaseConnector :: MySQL ( client) => client. query ( stmt, params) . await ,
229229 }
230230}
231231
232232pub ( crate ) async fn db_conn_query_one_for_impl < T > (
233- c : & DatabaseConnection ,
233+ c : & DatabaseConnector ,
234234 stmt : & str ,
235235 params : & [ & ' _ dyn QueryParameter ] ,
236236) -> Result < T , Box < dyn Error + Send + Sync > >
@@ -239,29 +239,29 @@ where
239239{
240240 match c {
241241 #[ cfg( feature = "postgres" ) ]
242- DatabaseConnection :: Postgres ( client) => client. query_one_for ( stmt, params) . await ,
242+ DatabaseConnector :: Postgres ( client) => client. query_one_for ( stmt, params) . await ,
243243
244244 #[ cfg( feature = "mssql" ) ]
245- DatabaseConnection :: SqlServer ( client) => client. query_one_for ( stmt, params) . await ,
245+ DatabaseConnector :: SqlServer ( client) => client. query_one_for ( stmt, params) . await ,
246246
247247 #[ cfg( feature = "mysql" ) ]
248- DatabaseConnection :: MySQL ( client) => client. query_one_for ( stmt, params) . await ,
248+ DatabaseConnector :: MySQL ( client) => client. query_one_for ( stmt, params) . await ,
249249 }
250250}
251251
252252pub ( crate ) async fn db_conn_execute_impl (
253- c : & DatabaseConnection ,
253+ c : & DatabaseConnector ,
254254 stmt : & str ,
255255 params : & [ & ' _ dyn QueryParameter ] ,
256256) -> Result < u64 , Box < dyn Error + Send + Sync > > {
257257 match c {
258258 #[ cfg( feature = "postgres" ) ]
259- DatabaseConnection :: Postgres ( client) => client. execute ( stmt, params) . await ,
259+ DatabaseConnector :: Postgres ( client) => client. execute ( stmt, params) . await ,
260260
261261 #[ cfg( feature = "mssql" ) ]
262- DatabaseConnection :: SqlServer ( client) => client. execute ( stmt, params) . await ,
262+ DatabaseConnector :: SqlServer ( client) => client. execute ( stmt, params) . await ,
263263
264264 #[ cfg( feature = "mysql" ) ]
265- DatabaseConnection :: MySQL ( client) => client. execute ( stmt, params) . await ,
265+ DatabaseConnector :: MySQL ( client) => client. execute ( stmt, params) . await ,
266266 }
267267}
0 commit comments