mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-05-01 20:01:42 +00:00
Pull in full sqlite_modern_cpp repo for the license as it is not attached to source files
This commit is contained in:
20
common/sqlite_modern_cpp/tests/named.cc
Normal file
20
common/sqlite_modern_cpp/tests/named.cc
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <sqlite_modern_cpp.h>
|
||||
#include <catch2/catch.hpp>
|
||||
using namespace sqlite;
|
||||
using namespace std;
|
||||
|
||||
|
||||
TEST_CASE("binding named parameters works", "[named]") {
|
||||
database db(":memory:");
|
||||
|
||||
db << "CREATE TABLE foo (a,b);";
|
||||
|
||||
int a = 1;
|
||||
db << "INSERT INTO foo VALUES (:first,:second)" << named_parameter(":second", 2) << named_parameter(":first", a);
|
||||
|
||||
db << "SELECT b FROM foo WHERE a=?;" << 1 >> a;
|
||||
|
||||
REQUIRE(a == 2);
|
||||
}
|
||||
Reference in New Issue
Block a user