Francesco Degrassi

Results 12 comments of Francesco Degrassi

I've tried to keep the API consistent with the existing Spi API, although I have a couple of doubts, specifically: 1. I find signed row counts not very intuitive, although...

I've integrated your changes, with some tweaks as I found other things that could be cleared up. Let me know what you think. Thanks for the feedback, @Hoverbear .

Sure thing, @eeeebbbbrrrr, I'll give it a go in the next few days.

Should be good to go.

> I haven't checked out this branch to play with it, but can a cursor escape an Spi::connect() block? Like, does this compile: > > ```rust > let cursor =...

`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 kinda think...

`into_name` is meant to allow leaving a cursor open **within the same transaction** across multiple Spi sessions. I was not aware of "WITH HOLD" cursors, interesting.

> Isn't this just `std::mem::forget()`? I think if you make `SpiCursor` `#[repr(transparent)]` then that wouldn't ever leak Rust-allocated memory, and Postgres would clean up at the end of the transaction,...

Glad to hear it, will add // SAFETY comments later today. I've noticed that `SpiTupleTable` doesn't ever early free memory via `SPI_freetuptable`, relying on the memory context being cleaned at...