Skip to content

Add 6 Statement::bind() overrides using size_t for blobs #431

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SRombauts
Copy link
Owner

Fix #430 for a better support of standard containers

Also add a couple of tests (not covering all variants)

Fix #430 for a better support of standard containers

Also add a couple of tests (not covering all variants)
@SRombauts SRombauts self-assigned this Jun 12, 2023
@SRombauts
Copy link
Owner Author

SRombauts commented Jun 12, 2023

It's not a "real-life issue" since SQLiteCpp can only bind a blob with a size in int.
I created a PR nonetheless, but I'll take the time to think about it twice; it might be better in fact to NOT try to hide that API and let the developer know

@hellow554
Copy link

hellow554 commented Apr 15, 2025

I am currently using this great library. Thank you for this!

One issue I'm running into is binding a blob breaks the variadic binding possiblity, because it requires two parameters, not one.

So I would like to introduce a new struct Blob or similar, that wraps a void pointer and std::size_t, so I can use it in a variadic binding suitation, e.g.:

// [...]
struct Blob {
    const void *ptr;
    std::size_t size;
};
SQLite::bind(st, "ABC", 2, SQLite::Blob{"def", 3});

I think this would perfectly fit in this PR, what do you think?

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

Successfully merging this pull request may close these issues.

Binding BLOB requires narrowing conversion
2 participants