Pull in full sqlite_modern_cpp repo for the license as it is not attached to source files

This commit is contained in:
Saood Karim
2025-08-17 08:25:37 -05:00
parent a3b174b69a
commit ed9504bd92
41 changed files with 2654 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#include <iostream>
#include <string>
#include <memory>
#include <stdexcept>
#include <sqlite_modern_cpp.h>
#include <catch2/catch.hpp>
using namespace sqlite;
using namespace std;
TEST_CASE("Prepared statement will not execute on exceptions", "[prepared_statements]") {
database db(":memory:");
db << "CREATE TABLE person (id integer primary key not null, name TEXT not null);";
try {
auto stmt = db << "INSERT INTO person (id,name) VALUES (?,?)";
throw 1;
} catch (int) { }
int count;
db << "select count(*) from person" >> count;
REQUIRE(count == 0);
}