@@ -64,9 +64,9 @@ pub trait PreparableQuery<'conn>: Query<'conn> {
6464 ) -> SpiResult < PreparedStatement < ' conn > > ;
6565}
6666
67- fn execute < ' conn > (
67+ fn execute < ' conn , ' mcx > (
6868 cmd : & CStr ,
69- args : & [ DatumWithOid < ' _ > ] ,
69+ args : & [ DatumWithOid < ' mcx > ] ,
7070 limit : Option < libc:: c_long > ,
7171) -> SpiResult < SpiTupleTable < ' conn > > {
7272 // SAFETY: no concurrent access
@@ -100,7 +100,10 @@ fn execute<'conn>(
100100 SpiClient :: prepare_tuple_table ( status_code)
101101}
102102
103- fn open_cursor < ' conn > ( cmd : & CStr , args : & [ DatumWithOid < ' _ > ] ) -> SpiResult < SpiCursor < ' conn > > {
103+ fn open_cursor < ' conn , ' mcx > (
104+ cmd : & CStr ,
105+ args : & [ DatumWithOid < ' mcx > ] ,
106+ ) -> SpiResult < SpiCursor < ' conn > > {
104107 let nargs = args. len ( ) ;
105108 let ( mut argtypes, mut datums, nulls) = args_to_datums ( args) ;
106109
@@ -122,8 +125,8 @@ fn open_cursor<'conn>(cmd: &CStr, args: &[DatumWithOid<'_>]) -> SpiResult<SpiCur
122125 Ok ( SpiCursor { ptr, __marker : PhantomData } )
123126}
124127
125- fn args_to_datums (
126- args : & [ DatumWithOid < ' _ > ] ,
128+ fn args_to_datums < ' mcx > (
129+ args : & [ DatumWithOid < ' mcx > ] ,
127130) -> ( Vec < pg_sys:: Oid > , Vec < pg_sys:: Datum > , Vec < c_char > ) {
128131 let mut argtypes = Vec :: with_capacity ( args. len ( ) ) ;
129132 let mut datums = Vec :: with_capacity ( args. len ( ) ) ;
@@ -140,7 +143,7 @@ fn args_to_datums(
140143 ( argtypes, datums, nulls)
141144}
142145
143- fn prepare_datum ( datum : & DatumWithOid < ' _ > ) -> ( pg_sys:: Datum , std:: os:: raw:: c_char ) {
146+ fn prepare_datum < ' mcx > ( datum : & DatumWithOid < ' mcx > ) -> ( pg_sys:: Datum , std:: os:: raw:: c_char ) {
144147 match datum. datum ( ) {
145148 Some ( datum) => ( datum. sans_lifetime ( ) , ' ' as std:: os:: raw:: c_char ) ,
146149 None => ( pg_sys:: Datum :: from ( 0usize ) , 'n' as std:: os:: raw:: c_char ) ,
@@ -296,7 +299,7 @@ impl<'conn> Query<'conn> for OwnedPreparedStatement {
296299 }
297300}
298301
299- impl PreparedStatement < ' _ > {
302+ impl < ' conn > PreparedStatement < ' conn > {
300303 /// Converts prepared statement into an owned prepared statement
301304 ///
302305 /// These statements have static lifetime and are freed only when dropped
@@ -314,9 +317,9 @@ impl PreparedStatement<'_> {
314317 } )
315318 }
316319
317- fn args_to_datums (
320+ fn args_to_datums < ' mcx > (
318321 & self ,
319- args : & [ DatumWithOid < ' _ > ] ,
322+ args : & [ DatumWithOid < ' mcx > ] ,
320323 ) -> SpiResult < ( Vec < pg_sys:: Datum > , Vec < std:: os:: raw:: c_char > ) > {
321324 let actual = args. len ( ) ;
322325 let expected = unsafe { pg_sys:: SPI_getargcount ( self . plan . as_ptr ( ) ) } as usize ;
0 commit comments