Closed garthmz closed 7 months ago
From an initial read, this is nice work. Thanks for submitting it. I may still have feedback or requested changes when I go through it more closely, which I hope to get done soon.
Sorry for the long delay in reviewing this.
In principle, I have to push back on the use of System.IO.Stream
. Anything that high-level is usually omitted from this library, with the expectation that upper layers will provide it.
I'm staring at the deserialize call that accepts a ReadOnlySpan
and then allocates a block and copies it. That just feels wrong. I haven't actually used the sqlite3_deserialize()
API, so I've been reading the docs, and I sort of see why you did things this way. But it raises questions as I look at the code.
Once we get the code looking okay for merge, I'll be asking for this PR to include test cases.
See #547
Opening this PR for discussion. I'm not sure about the approach, or if there are additional requirements to get a change like this accepted.
The
raw
additions seem heavy compared to its other methods, but I tried to take a similar stance of handling all memory management there. Since the sqlite flags for these functions are related to memory management, they are not exposed in the raw api. The support for Stream is a simple, standard way to avoid a buffer, but it is a new reference to System.IO.