SQLiteCpp icon indicating copy to clipboard operation
SQLiteCpp copied to clipboard

can we add bindBlob(int, const std::string &)?

Open etorth opened this issue 2 years ago • 1 comments

Serialization of a simple type like int/char etc can be very short, use std::vector<uint8_t> or something may overkill because of the memory allocation.

std::string is a good choice since it has SSO internal buffer.

But bind(int, const std::string &) always binds to TEXT, not blob. can we get a way explictly bind std::string to a BLOB type? Thanks! very easy to implement.

Or put a default parameter as: bind(int, const std::string &, bool bind_to_text = true); // false to BLOB

etorth avatar Apr 17 '24 04:04 etorth

Yes, that's a good idea. I always welcome pull requests, especially if they are very simple, provide a unit test. Cheers!

SRombauts avatar Aug 17 '24 07:08 SRombauts