Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
etorth opened this issue Apr 17, 2024 · 1 comment
Open

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

etorth opened this issue Apr 17, 2024 · 1 comment

Comments

@etorth
Copy link

etorth commented Apr 17, 2024

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

@SRombauts SRombauts self-assigned this Aug 17, 2024
@SRombauts
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants