return *this;
}
-void Crypto::createTable(const char *create_cmd, const char *table_name)
-{
- try {
- m_connection->ExecCommand(create_cmd);
- } catch (const SqlConnection::Exception::SyntaxError &) {
- LogError("Couldn't create table : " << table_name << "!");
- throw;
- } catch (const SqlConnection::Exception::InternalError &) {
- LogError("Sqlite got into infinite busy state");
- throw;
- }
-}
-
-void Crypto::createView(const char *create_cmd)
-{
- try {
- m_connection->ExecCommand(create_cmd);
- } catch (const SqlConnection::Exception::SyntaxError &) {
- LogError("Couldn't create view!");
- throw;
- } catch (const SqlConnection::Exception::InternalError &) {
- LogError("Sqlite got into infinite busy state");
- throw;
- }
-}
-
bool Crypto::getDBVersion(int &schemaVersion)
{
Transaction transaction(this);
const ClientId &owner,
const ClientId &accessor) const;
- // transactions
- int beginTransaction();
- int commitTransaction();
- int rollbackTransaction();
-
class Transaction {
public:
explicit Transaction(Crypto *db) : m_db(db), m_inTransaction(false)
ScriptOptional getScript(const std::string &scriptName) const;
ScriptOptional getMigrationScript(int db_version) const;
- void createTable(
- const char *create_cmd,
- const char *table_name);
-
- void createView(
- const char *create_cmd);
-
class SchemaInfo {
public:
explicit SchemaInfo(SqlConnection *connection) : m_connection(connection) {}