32#ifndef GUARD_SQLITE_CONNECTION_HPP_INCLUDED
33#define GUARD_SQLITE_CONNECTION_HPP_INCLUDED
103 void attach(std::string
const &db, std::string
const &database_alias);
110 void detach(std::string
const &database_alias);
125 void open(std::string
const &db);
126 void open(std::string
const &db,
bool readonly);
Tracks prepared statements by SQL text and hands them out on demand.
Pluggable abstraction for the filesystem operations used by sqlite::connection.
std::shared_ptr< filesystem_adapter > filesystem_adapter_ptr
@ open_readonly
Opens an existing database for reads only or fails.
@ open_existing
Opens an existing database; fails when it is missing.
@ always_create
Deletes any existing database file and recreates it.
@ open_or_create
Opens an existing database or creates it on demand.
LRU cache for prepared statements shared across sqlite::connection.
connection is used to open, close, attach and detach a database. Further it has to be passed to all c...
connection & operator=(connection const &)=delete
void configure_statement_cache(statement_cache_config const &cfg)
filesystem_adapter_ptr filesystem
void clear_statement_cache()
void open(std::string const &db)
void open(std::string const &db, sqlite::open_mode open_mode)
void detach(std::string const &database_alias)
detaches a database via alias, if the same database was attached with several names they will be stil...
connection(std::string const &db, sqlite::open_mode open_mode, filesystem_adapter_ptr fs)
connection(std::string const &db, sqlite::open_mode open_mode)
constructor opens the database
void release_cached_statement(std::string const &sql, sqlite3_stmt *stmt)
void attach(std::string const &db, std::string const &database_alias)
attaches another database file to the database represented by the object of this class....
friend struct private_accessor
void open_with_flags(std::string const &db, int flags)
std::int64_t get_last_insert_rowid()
Returns the last inserted rowid in the currently opened database.
connection(connection const &)=delete
~connection()
destructor closes the database automatically
statement_cache_config statement_cache_settings() const
connection(std::string const &db)
constructor opens the database
sqlite3_stmt * acquire_cached_statement(std::string const &sql)
connection(std::string const &db, filesystem_adapter_ptr fs)
void open(std::string const &db, bool readonly)
Configuration knobs for the built-in LRU statement cache.