From ab47c39c82abee7f0e0cff981dc352fdc310a6fe Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 24 Feb 2019 13:06:07 +0000 Subject: Bring up-to-date with libdbpp. --- libsqlitepp/sqlite-command.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libsqlitepp/sqlite-command.cpp') diff --git a/libsqlitepp/sqlite-command.cpp b/libsqlitepp/sqlite-command.cpp index 3d8ac07..adaf41e 100644 --- a/libsqlitepp/sqlite-command.cpp +++ b/libsqlitepp/sqlite-command.cpp @@ -76,7 +76,12 @@ SQLite::Command::bindParamF(unsigned int n, float v) 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) { + return bindParamS(n, std::string_view(s.raw())); +} +void +SQLite::Command::bindParamS(unsigned int n, const std::string_view & s) +{ + if (sqlite3_bind_text(stmt, n + 1, s.data(), s.length(), SQLITE_STATIC) != SQLITE_OK) { throw Error(c->db); } } -- cgit v1.2.3