#include "cetlib/container_algorithms.h"
#include "cetlib/sqlite/Connection.h"
#include "cetlib/sqlite/ConnectionFactory.h"
#include "cetlib/sqlite/Transaction.h"
#include "cetlib/sqlite/column.h"
#include "cetlib/sqlite/create_table.h"
#include "cetlib/sqlite/insert.h"
#include "cetlib/sqlite/query_result.h"
#include "cetlib/sqlite/select.h"
#include "cetlib_except/exception.h"
#include <array>
#include <cassert>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
Go to the source code of this file.
Definition at line 44 of file transaction_t.cc.
50 string const table_name{
"Workers"};
55 for (
auto const& worker :
names) {
56 insert_into(*
c, table_name).values(worker[0], worker[1]);
59 check_table_contents(*
c, table_name);
61 string const table_name2{
"Workers2"};
67 for (
auto const& worker : names) {
68 insert_into(*
c, table_name2).values(worker[0], worker[1]);
72 check_table_contents(*
c, table_name2);
86 check_table_contents(*
c, table_name2);
90 cerr << e.what() <<
'\n';
94 cerr <<
"Unknown exception caught.\n";
auto insert_into(sqlite3 *const db, std::string const &tablename)
auto make_connection(std::string const &file_name, PolicyArgs &&...) -> Connection *
void create_table(sqlite3 *const db, std::string const &tablename, Cols const &...cols)
static std::vector< std::string > const names
cet::coded_exception< error, detail::translate > exception