1 // Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
5 #ifndef SQLITE_CONNECTION_H_
6 #define SQLITE_CONNECTION_H_
14 #include "src/sql_connection.h"
15 #include "src/sql_statement.h"
21 class SQLiteConnection final : public SQLConnection {
23 explicit SQLiteConnection(std::string path, bool readonly);
24 virtual ~SQLiteConnection();
27 SQLiteConnection(const SQLiteConnection&) = delete;
28 SQLiteConnection& operator=(const SQLiteConnection&) = delete;
30 bool Execute(const std::string& command) override;
32 std::shared_ptr<SQLStatement> PrepareStatement(
33 const std::string& query) override;
35 bool IsValid() override;
38 bool Connect(bool readonly);
40 std::string GetErrorMessage() const;
42 bool BeginTransaction() override;
43 bool CommitTransaction() override;
44 bool RollbackTransaction() override;
52 #endif // SQLITE_CONNECTION_H_