summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbpp/connection.cpp6
-rw-r--r--libdbpp/connection.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/libdbpp/connection.cpp b/libdbpp/connection.cpp
index e5a64f5..048b3b5 100644
--- a/libdbpp/connection.cpp
+++ b/libdbpp/connection.cpp
@@ -47,6 +47,12 @@ DB::Connection::resolvePlugin(const std::type_info &, const std::string & name)
return stringbf("libdbpp-%s.so", name);
}
+int64_t
+DB::Connection::insertId() const
+{
+ throw std::runtime_error("insertId not implemented for this driver.");
+}
+
INSTANTIATEFACTORY(DB::Connection, std::string);
PLUGINRESOLVER(DB::ConnectionFactory, DB::Connection::resolvePlugin);
diff --git a/libdbpp/connection.h b/libdbpp/connection.h
index c9111f8..9ff757b 100644
--- a/libdbpp/connection.h
+++ b/libdbpp/connection.h
@@ -67,6 +67,9 @@ namespace DB {
/// Load data for the current bulk load operation.
virtual size_t bulkUploadData(const char *, size_t) const = 0;
+ /// Return the Id used in the last insert
+ virtual int64_t insertId() const;
+
/// AdHoc plugin resolver helper for database connectors.
static boost::optional<std::string> resolvePlugin(const std::type_info &, const std::string &);
private: