Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
cetlib
cetlib
sqlite
exec.cc
Go to the documentation of this file.
1
#include "
cetlib/sqlite/exec.h
"
2
#include "
cetlib/sqlite/Exception.h
"
3
4
void
5
cet::sqlite::exec
(
sqlite3
* db,
std::string
const
& ddl)
6
{
7
char
* errmsg{
nullptr
};
8
if
(sqlite3_exec(db, ddl.c_str(),
nullptr
,
nullptr
, &errmsg) != SQLITE_OK) {
9
std::string
msg
{errmsg};
10
sqlite3_free(errmsg);
11
throw
Exception
{
sqlite::errors::SQLExecutionError
} <<
msg
;
12
}
13
}
msg
void msg(const char *fmt,...)
Definition:
message.cpp:107
string
std::string string
Definition:
nybbler.cc:12
cet::sqlite::Exception
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition:
Exception.h:27
sqlite3
struct sqlite3 sqlite3
Definition:
DatabaseSupport.h:12
art::errors::SQLExecutionError
Definition:
Exception.h:50
exec.h
Exception.h
cet::sqlite::exec
void exec(sqlite3 *db, std::string const &ddl)
Definition:
exec.cc:5
Generated by
1.8.11