8#ifndef BOTAN_SQL_DATABASE_H_
9#define BOTAN_SQL_DATABASE_H_
11#include <botan/exceptn.h>
12#include <botan/types.h>
29 int error_code() const noexcept
override {
return m_rc; }
38 virtual void bind(
int column, std::string_view str) = 0;
40 virtual void bind(
int column,
size_t i) = 0;
42 virtual void bind(
int column, std::chrono::system_clock::time_point time) = 0;
44 virtual void bind(
int column,
const std::vector<uint8_t>& blob) = 0;
46 virtual void bind(
int column,
const uint8_t* data,
size_t len) = 0;
49 virtual std::pair<const uint8_t*, size_t>
get_blob(
int column) = 0;
51 virtual std::string
get_str(
int column) = 0;
68 virtual std::shared_ptr<Statement>
new_statement(std::string_view base_sql)
const = 0;
70 virtual size_t row_count(std::string_view table_name) = 0;
76 virtual size_t exec(std::string_view sql) {
return new_statement(sql)->spin(); }
SQL_DB_Error(std::string_view what, int rc)
ErrorType error_type() const noexcept override
int error_code() const noexcept override
SQL_DB_Error(std::string_view what)
virtual ~Statement()=default
virtual std::pair< const uint8_t *, size_t > get_blob(int column)=0
virtual void bind(int column, size_t i)=0
virtual void bind(int column, std::chrono::system_clock::time_point time)=0
virtual void bind(int column, const uint8_t *data, size_t len)=0
virtual void bind(int column, const std::vector< uint8_t > &blob)=0
virtual void bind(int column, std::string_view str)=0
virtual std::string get_str(int column)=0
virtual size_t get_size_t(int column)=0
virtual std::shared_ptr< Statement > new_statement(std::string_view base_sql) const =0
virtual bool is_threadsafe() const
virtual size_t exec(std::string_view sql)
virtual size_t rows_changed_by_last_statement()=0
virtual void create_table(std::string_view table_schema)=0
virtual size_t row_count(std::string_view table_name)=0
virtual ~SQL_Database()=default
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)