equal
deleted
inserted
replaced
14 * You should have received a copy of the GNU General Public License |
14 * You should have received a copy of the GNU General Public License |
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 */ |
16 */ |
17 #pragma once |
17 #pragma once |
18 |
18 |
19 #include <sqlite3.h> |
|
20 |
|
21 #include "SqlException.h" |
19 #include "SqlException.h" |
22 #include "PreparedStatement.h" |
20 #include "PreparedStatement.h" |
23 |
21 |
24 namespace relpipe { |
22 namespace relpipe { |
25 namespace tr { |
23 namespace tr { |
28 class Connection { |
26 class Connection { |
29 private: |
27 private: |
30 sqlite3* db; |
28 sqlite3* db; |
31 void begin(); |
29 void begin(); |
32 public: |
30 public: |
33 Connection(const char* filename); |
31 Connection(const char* filename); // TODO: add DriverManager class + support connecting using a DSN or a connectString |
34 virtual ~Connection(); |
32 virtual ~Connection(); |
35 PreparedStatement* prepareStatement(const char* sql); |
33 PreparedStatement* prepareStatement(const char* sql); |
36 bool getAutoCommit(); |
34 bool getAutoCommit(); |
37 void setAutoCommit(bool autoCommit); |
35 void setAutoCommit(bool autoCommit); |
38 void commit(); |
36 void commit(); |