@@ -27,17 +27,17 @@ use async_stream::stream;
2727
2828#[ derive( Debug ) ]
2929pub struct Cursor {
30- pub query : ast:: Statement ,
30+ pub query : Box < ast:: Statement > ,
3131 // WITH HOLD specifies that the cursor can continue to be used after the transaction that created it successfully commits.
32- // WITHOUT HOLD specifies that the cursor cannot be used outside of the transaction that created it.
32+ // WITHOUT HOLD specifies that the cursor cannot be used outside the transaction that created it.
3333 pub hold : bool ,
3434 // What format will be used for Cursor
3535 pub format : protocol:: Format ,
3636}
3737
3838#[ derive( Debug ) ]
3939pub enum PreparedStatement {
40- // Postgres allows to define prepared statement on empty query: "",
40+ // Postgres allows defining a prepared statement on an empty query: "",
4141 // then it requires special handling in the protocol
4242 Empty {
4343 /// Prepared statement can be declared from SQL or protocol (Parser)
@@ -49,10 +49,10 @@ pub enum PreparedStatement {
4949 /// Prepared statement can be declared from SQL or protocol (Parser)
5050 from_sql : bool ,
5151 created : DateTime < Utc > ,
52- query : ast:: Statement ,
52+ query : Box < ast:: Statement > ,
5353 parameters : protocol:: ParameterDescription ,
54- /// Fields which will be returned to the client, It can be None if server doesnt return any field
55- /// for example BEGIN
54+ /// Fields which will be returned to the client; It can be None if the server doesn't return any field,
55+ /// for example, BEGIN
5656 description : Option < protocol:: RowDescription > ,
5757 span_id : Option < Arc < SpanId > > ,
5858 } ,
@@ -107,7 +107,7 @@ impl PreparedStatement {
107107 . into ( ) ) ,
108108 PreparedStatement :: Query { query, .. } => {
109109 let binder = PostgresStatementParamsBinder :: new ( values) ;
110- let mut statement = query. clone ( ) ;
110+ let mut statement = query. as_ref ( ) . clone ( ) ;
111111 binder. bind ( & mut statement) ?;
112112
113113 Ok ( statement)
0 commit comments