Hydra 0.20
|
#include <DB.h>
Classes | |
class | Connection |
class | ResetOnExit |
class | Statement |
Public Member Functions | |
DB (const QString &filename, const QString &tablescope) | |
DB (DB &linked_db, const QString &tablescope) | |
virtual | ~DB () |
destructor | |
bool | contains (const std::string &key) |
is this key even in the db? | |
bool | contains (const QString &key) |
is this key even in the db? | |
bool | contains (const char *key) |
is this key even in the db? | |
bool | erase (const std::string &key) |
removes the key from the db, returns true if anything was done | |
bool | erase (const QString &key) |
removes the key from the db, returns true if anything was done | |
bool | erase (const char *key) |
removes the key from the db, returns true if anything was done | |
bool | insert (const std::string &key, const std::string &value) |
saves to the db, returns true on success, will replace if exists | |
bool | insert (const QString &key, const std::string &value) |
saves to the db, returns true on success, will replace if exists | |
bool | insert (const char *key, const std::string &value) |
saves to the db, returns true on success, will replace if exists | |
bool | get (const std::string &key, std::string &value) |
returns false on not-found or failed to load | |
bool | get (const QString &key, std::string &value) |
returns false on not-found or failed to load | |
bool | get (const char *key, std::string &value) |
returns false on not-found or failed to load | |
bool | insert (const std::string &key, const hydra::Record &value) |
saves to the db, returns true on success, will replace if exists | |
bool | insert (const QString &key, const hydra::Record &value) |
saves to the db, returns true on success, will replace if exists | |
bool | insert (const char *key, const hydra::Record &value) |
saves to the db, returns true on success, will replace if exists | |
bool | get (const std::string &key, hydra::Record &value) |
returns false on not-found or failed to load | |
bool | get (const QString &key, hydra::Record &value) |
returns false on not-found or failed to load | |
bool | get (const char *key, hydra::Record &value) |
returns false on not-found or failed to load | |
Friends | |
class | hydra::Cursor |
This represents a sqlite database table.
This in the future, this can be abtracted away as an interface to allow many possible backends (the old BerkleyDB one, postgresql, etc)
Internally, this backend uses std::string and 8-bit UTF strings for size-conservation.
hydra::DB::DB | ( | const QString & | filename, |
const QString & | tablescope | ||
) |
Creates a DB (disk backed map). It will use the given sqllite db file and prepend the given prefix/namespace to the tables. Using different tablescope's allows you to have multiple DBs in the same sqlite file.
filename | the sqlite filename on disk |
tablescope | the prefix/table name to use. Cannot be empty. |
hydra::DB::DB | ( | DB & | linked_db, |
const QString & | tablescope | ||
) |