Skip to content

Commit

Permalink
Add blob fields for sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
NoWhere-NowHere-TLD authored Aug 7, 2024
1 parent 1373a97 commit 644a07f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ormpp/sqlite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,9 @@ class sqlite {
sqlite3_bind_text(stmt_, i, value, strlen(value), nullptr);
}
else if constexpr (std::is_same_v<std::vector<char>, U>) {
return SQLITE_OK ==
sqlite3_bind_blob(stmt_, i, value.data(),static_cast<int>(value.size()), nullptr);
return SQLITE_OK == sqlite3_bind_blob(stmt_, i, value.data(),
static_cast<int>(value.size()),
nullptr);
}
#ifdef ORMPP_WITH_CSTRING
else if constexpr (std::is_same_v<CString, U>) {
Expand Down Expand Up @@ -630,7 +631,8 @@ class sqlite {
}
else if constexpr (std::is_same_v<std::vector<char>, U>) {
value.reserve(sqlite3_column_bytes(stmt_, i));
memcpy(value.data(),(const char *)sqlite3_column_blob(stmt_, i),(size_t)sqlite3_column_bytes(stmt_, i));
memcpy(value.data(), (const char *)sqlite3_column_blob(stmt_, i),
(size_t)sqlite3_column_bytes(stmt_, i));
}
#ifdef ORMPP_WITH_CSTRING
else if constexpr (std::is_same_v<CString, U>) {
Expand Down

0 comments on commit 644a07f

Please sign in to comment.