Skip to content

Commit

Permalink
Fix boolean casting for libsql
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed Sep 26, 2024
1 parent 345628b commit 2d7593e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cpp/libsql/bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ void opsqlite_libsql_bind_statement(libsql_stmt_t statement,
JSVariant value = values->at(ii);
int status;

if (std::holds_alternative<bool>(value) ||
std::holds_alternative<int>(value)) {
if (std::holds_alternative<bool>(value)) {
status = libsql_bind_int(statement, index,
static_cast<int>(std::get<bool>(value)), &err);
} else if (std::holds_alternative<int>(value)) {
status = libsql_bind_int(statement, index, std::get<int>(value), &err);
} else if (std::holds_alternative<long long>(value)) {
status =
Expand Down Expand Up @@ -494,7 +496,6 @@ BridgeResult opsqlite_libsql_execute(std::string const &name,
break;

case LIBSQL_TEXT:

status = libsql_get_string(row, col, &text_value, &err);
out_row.emplace_back(text_value);
break;
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ SPEC CHECKSUMS:
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
hermes-engine: 6eae7edb2f563ee41d7c1f91f4f2e57c26d8a5c3
op-sqlite: 92d182e19a4b923e2ae6760896dc578dbf8ef953
op-sqlite: d567632567b87bedda1f718e4ce6c081457c2f42
RCT-Folly: 045d6ecaa59d826c5736dfba0b2f4083ff8d79df
RCTDeprecation: 3ca8b6c36bfb302e1895b72cfe7db0de0c92cd47
RCTRequired: 9fc183af555fd0c89a366c34c1ae70b7e03b1dc5
Expand Down
Binary file modified ios/sqlitevec.xcframework/ios-arm64/sqlitevec.framework/sqlitevec
100755 → 100644
Binary file not shown.
Binary file modified ios/sqlitevec.xcframework/ios-arm64_x86_64-simulator/sqlitevec.framework/sqlitevec
100755 → 100644
Binary file not shown.

0 comments on commit 2d7593e

Please sign in to comment.