@@ -3,7 +3,7 @@ use std::io::Read;
33use tokio_postgres:: types:: { ToSql , Type } ;
44use tokio_postgres:: { Error , Row } ;
55
6- use crate :: { Client , CopyOutReader , Portal , Query , Statement } ;
6+ use crate :: { Client , CopyOutReader , Portal , Statement , ToStatement } ;
77
88pub struct Transaction < ' a > {
99 client : & ' a mut Client ,
@@ -62,21 +62,21 @@ impl<'a> Transaction<'a> {
6262
6363 pub fn execute < T > ( & mut self , query : & T , params : & [ & dyn ToSql ] ) -> Result < u64 , Error >
6464 where
65- T : ?Sized + Query ,
65+ T : ?Sized + ToStatement ,
6666 {
6767 self . client . execute ( query, params)
6868 }
6969
7070 pub fn query < T > ( & mut self , query : & T , params : & [ & dyn ToSql ] ) -> Result < Vec < Row > , Error >
7171 where
72- T : ?Sized + Query ,
72+ T : ?Sized + ToStatement ,
7373 {
7474 self . client . query ( query, params)
7575 }
7676
7777 pub fn bind < T > ( & mut self , query : & T , params : & [ & dyn ToSql ] ) -> Result < Portal , Error >
7878 where
79- T : ?Sized + Query ,
79+ T : ?Sized + ToStatement ,
8080 {
8181 let statement = query. __statement ( & mut self . client ) ?;
8282 self . client
@@ -101,7 +101,7 @@ impl<'a> Transaction<'a> {
101101 reader : R ,
102102 ) -> Result < u64 , Error >
103103 where
104- T : ?Sized + Query ,
104+ T : ?Sized + ToStatement ,
105105 R : Read ,
106106 {
107107 self . client . copy_in ( query, params, reader)
@@ -113,7 +113,7 @@ impl<'a> Transaction<'a> {
113113 params : & [ & dyn ToSql ] ,
114114 ) -> Result < CopyOutReader < ' _ > , Error >
115115 where
116- T : ?Sized + Query ,
116+ T : ?Sized + ToStatement ,
117117 {
118118 self . client . copy_out ( query, params)
119119 }
0 commit comments