Eric Ridge

Results 182 comments of Eric Ridge

yeah, nice. Only question I have now is... does `SpiCursor` need to `impl Drop` instead of having an explicit `close()` method? I'm leaning towards yes, but I imagine you put...

> `SpiCursor` can implement `Drop` instead of `close()`, as long as we use a sentinel value (null_ptr, or Option::None) to skip calling `SPI_cursor_close` when dropping it within `SpiCursor::into_name`. > I...

> `into_name` is meant to allow leaving a cursor open **within the same transaction** across multiple Spi sessions. Isn't this just `std::mem::forget()`? I think if you make `SpiCursor` `#[repr(transparent)]` then...

> I'm wondering wether #[repr(transparent)] is actually necessary, as into_name takes self by value, thus moving it on the stack. True. Maybe it'll just be good to declare our intentions....

This has turned out really nice. Great work and thanks for sticking with it and thanks for your patience. Would you mind adding some // SAFETY comments to the few...

> > Solving this is a bit involved, as it requires a `Drop` implementation on `SpiTupleTable` and to create a lifetime dependency between `SpiHeapTupleData`/`SpiHeapTupleDataEntry` and their parent `SpiTupleTable`. Should we...

Updated re-create: ```sql create or replace function fn1(i int) returns int strict language plrust as $$ [code] notice!("{}", "fn1 started"); let cmd = format!("select fn2({})", i); Spi::connect(|client| { client.select(&cmd, None,...

I’m fine with a safe and correct approach. I just wanna note that I bet it’ll come up for functions that are being called once for every row of some...

Also... Rust’s RwLocks aren’t re-entrant, are they? If they’re not, they’re out anyways! Edit: I didn’t consider this earlier today. Hmm 🤔

Actually, I suppose with a RwLock we’d only hold it long enough to .entry().or_insert() into the symbol map. We wouldn’t hold it for the duration of the function execution. As...