sqlitexx 0.0.1
transaction.hpp
Go to the documentation of this file.
1/*
2 * sqlite3xx - sqlite3 C++ layer, following the ideas of libpqxx
3 * Copyright (C) 2009 Andreas Baumann
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions of
7 * the GNU Lesser General Public License, as published by the Free Software
8 * Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 * License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this distribution; if not, write to:
18 * Free Software Foundation, Inc.
19 * 51 Franklin Street, Fifth Floor
20 * Boston, MA 02110-1301 USA
21 *
22 */
23
24#ifndef SQLITE3XX_TRANSACTION_H
25#define SQLITE3XX_TRANSACTION_H
26
28#include "sqlite3xx/result.hpp"
30#include "sqlite3.h"
31
32#include "port/dllexport.h"
33
34namespace sqlite3xx {
35
37 private:
38 enum Status {
39 st_nascent,
40 st_active,
41 st_aborted,
42 st_committed
43 };
44
45 private:
46 connection& _c;
47 string _name;
48 Status _status;
49
50 protected:
51 void Begin( );
52
53 public:
54 transaction( connection &c, string name = 0 );
56
57 void commit( );
58 void abort( );
59
60 result exec( string sql );
61 prepare::invocation prepared( const string& name );
62};
63
65
66}
67
68#endif /* SQLITE3XX_TRANSACTION_H */
Definition connection.hpp:46
Definition prepared_statement.hpp:63
Definition result.hpp:42
Definition transaction.hpp:36
prepare::invocation prepared(const string &name)
transaction(connection &c, string name=0)
result exec(string sql)
#define SQLITEXX_LIBEXPORT
Definition dllexport.h:35
Definition connection.hpp:41
transaction work
Definition transaction.hpp:64