SOCI / soci

Official repository of the SOCI - The C++ Database Access Library
http://soci.sourceforge.net/
Boost Software License 1.0
1.37k stars 472 forks source link

How to get a blob value from a row #1036

Closed Krzmbrzl closed 1 year ago

Krzmbrzl commented 1 year ago

Suppose I have selected into a soci::row and have queried my entry of choice to be of type soci::dt_blob. As what type may I get that value via row.get< ... >(3)? As a soci::blob? If so, I can't get this to compile because

soci::blob blob = row.get< soci::blob >(3)

would invoke the copy-ctor, which is deleted for blobs.

Krzmbrzl commented 1 year ago

I have figured it out myself: The data is stored in a std::string and must be queried as such:

std::string data = row.get< std::string >(3);