summaryrefslogtreecommitdiff
path: root/libsqlitepp/sqlite-command.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-12-29 02:42:43 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2015-12-29 06:00:07 +0000
commit3a7e2b9a7bde4682f2273022e9d2ddecd7e5e3b8 (patch)
treed5dc58209bd8fa28047c54a11c09bc64505d5354 /libsqlitepp/sqlite-command.cpp
parentRemove rebind (diff)
downloadlibdbpp-sqlite-3a7e2b9a7bde4682f2273022e9d2ddecd7e5e3b8.tar.bz2
libdbpp-sqlite-3a7e2b9a7bde4682f2273022e9d2ddecd7e5e3b8.tar.xz
libdbpp-sqlite-3a7e2b9a7bde4682f2273022e9d2ddecd7e5e3b8.zip
Reshuffle and add new exceptions
Diffstat (limited to 'libsqlitepp/sqlite-command.cpp')
-rw-r--r--libsqlitepp/sqlite-command.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/libsqlitepp/sqlite-command.cpp b/libsqlitepp/sqlite-command.cpp
index 48563fa..3d8ac07 100644
--- a/libsqlitepp/sqlite-command.cpp
+++ b/libsqlitepp/sqlite-command.cpp
@@ -8,7 +8,7 @@ SQLite::Command::Command(const Connection * conn, const std::string & sql) :
c(conn)
{
if (sqlite3_prepare_v2(conn->db, sql.c_str(), sql.length(), &stmt, NULL) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(conn->db));
+ throw Error(conn->db);
}
}
@@ -21,85 +21,85 @@ void
SQLite::Command::bindParamI(unsigned int n, int v)
{
if (sqlite3_bind_int(stmt, n + 1, v) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}
void
SQLite::Command::bindParamI(unsigned int n, long int v)
{
if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}
void
SQLite::Command::bindParamI(unsigned int n, long long int v)
{
if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}
void
SQLite::Command::bindParamI(unsigned int n, unsigned int v)
{
if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}
void
SQLite::Command::bindParamI(unsigned int n, long unsigned int v)
{
if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}
void
SQLite::Command::bindParamI(unsigned int n, long long unsigned int v)
{
if (sqlite3_bind_int64(stmt, n + 1, v) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}
void
SQLite::Command::bindParamF(unsigned int n, double v)
{
if (sqlite3_bind_double(stmt, n + 1, v) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}
void
SQLite::Command::bindParamF(unsigned int n, float v)
{
if (sqlite3_bind_double(stmt, n + 1, v) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}
void
SQLite::Command::bindParamS(unsigned int n, const Glib::ustring & s)
{
if (sqlite3_bind_text(stmt, n + 1, s.c_str(), s.length(), SQLITE_STATIC) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}
void
SQLite::Command::bindParamB(unsigned int, bool)
{
- throw Error("Not supported");
+ throw DB::ParameterTypeNotSupported();
}
void
SQLite::Command::bindParamT(unsigned int, const boost::posix_time::time_duration &)
{
- throw Error("Not supported");
+ throw DB::ParameterTypeNotSupported();
}
void
SQLite::Command::bindParamT(unsigned int, const boost::posix_time::ptime &)
{
- throw Error("Not supported");
+ throw DB::ParameterTypeNotSupported();
}
void
SQLite::Command::bindNull(unsigned int n)
{
if (sqlite3_bind_null(stmt, n + 1) != SQLITE_OK) {
- throw Error(sqlite3_errmsg(c->db));
+ throw Error(c->db);
}
}