/// will take care of releasing the compiled statements and similar.
}
-#if 0
PsqlBindArrayPtr
PgSqlConfigBackendImpl::createBinding(const Triplet<uint32_t>& triplet) {
PsqlBindArrayPtr bind(new PsqlBindArray());
+#if 0
if (triplet.unspecified()) {
bind->addNull();
} else {
bind->add<uint32_t>(triplet.get());
}
+#endif
return (bind);
}
PsqlBindArrayPtr
PgSqlConfigBackendImpl::createMinBinding(const Triplet<uint32_t>& triplet) {
PsqlBindArrayPtr bind(new PsqlBindArray());
+#if 0
if (triplet.unspecified() || (triplet.getMin() == triplet.get())) {
bind->addNull();
} else {
bind->add<uint32_t>(triplet.getMin());
}
+#endif
return (bind);
}
PsqlBindArrayPtr
PgSqlConfigBackendImpl::createMaxBinding(const Triplet<uint32_t>& triplet) {
PsqlBindArrayPtr bind(new PsqlBindArray());
+#if 0
if (triplet.unspecified() || (triplet.getMax() == triplet.get())) {
bind->addNull();
} else {
bind->add<uint32_t>(triplet.getMax());
}
+#endif
return (bind);
}
-#endif
/* Triplet<uint32_t>
PgSqlConfigBackendImpl::createTriplet(const PsqlBindArrayPtr& binding) {
return (deleteFromTable(index, server_selector, operation, in_bindings));
}
+uint64_t
+PgSqlConfigBackendImpl::deleteFromTable(const int index,
+ const db::ServerSelector& server_selector,
+ const std::string& operation,
+ db::PsqlBindArray& bindings) {
+ isc_throw(NotImplemented, "todo");
+}
+
+
void
PgSqlConfigBackendImpl::getGlobalParameters(const int index,
const PsqlBindArray& in_bindings,
virtual ~PgSqlConfigBackendImpl();
/// @todo: implement condCreateInteger(const util::Optional<T>& value)
-#if 0
static db::PsqlBindArrayPtr createBinding(const Triplet<uint32_t>& triplet);
static db::PsqlBindArrayPtr createMaxBinding(const Triplet<uint32_t>& triplet);
static db::PsqlBindArrayPtr createMinBinding(const Triplet<uint32_t>& triplet);
+#if 0
static Triplet<uint32_t> createTriplet(const db::PsqlBindArrayPtr& binding);
static Triplet<uint32_t> createTriplet(const db::PsqlBindArrayPtr& def_binding,
const db::PsqlBindArrayPtr& min_binding, const db::PsqlBindArrayPtr& max_binding);
#endif
+
+ /// @brief Returns server tag associated with the particular selector.
+ ///
+ /// This method expects that there is exactly one server tag associated with
+ /// the server selector.
+ ///
+ /// @param server_selector Server selector.
+ /// @param operation Operation which results in calling this function. This is
+ /// used for error reporting purposes.
+ /// @return Server tag.
+ /// @throw InvalidOperation if the server selector is unassigned or if there
+ /// is more than one server tag associated with the selector.
std::string getServerTag(const db::ServerSelector& server_selector,
- const std::string& operation );
+ const std::string& operation) const {
+ auto tags = server_selector.getTags();
+ if (tags.size() != 1) {
+ isc_throw(InvalidOperation, "expected exactly one server tag to be specified"
+ " while " << operation << ". Got: "
+ << getServerTagsAsText(server_selector));
+ }
+
+ return (tags.begin()->get());
+ }
/// @brief Returns server tags associated with the particular selector
/// as text.
return (s.str());
}
-
-
/// @brief Invokes the corresponding stored procedure in MySQL.
///
/// The @c createAuditRevision stored procedure creates new audit