/sqlite3cc

To get this branch, use:
bzr branch http://bzr.ed.am/sqlite3cc

« back to all changes in this revision

Viewing changes to include/sqlite3cc/database.h

  • Committer: edam
  • Date: 2010-07-23 12:57:07 UTC
  • Revision ID: edam@waxworlds.org-20100723125707-qu9jk9vvg2uewx7t
- cleaned up test-main
- fixed comment type
- made sqlite::exec() throw instead of returning sqlite error code

Show diffs side-by-side

added added

removed removed

26
26
 
27
27
#include <sqlite3.h>
28
28
#include <boost/utility.hpp>
29
 
#include <string>
30
29
 
31
30
 
32
31
namespace sqlite
34
33
 
35
34
 
36
35
class basic_statement;
37
 
class basic_transaction;
 
36
class transaction;
38
37
 
39
38
 
40
39
class database
98
97
 
99
98
//______________________________________________________________________________
100
99
//                                                                implementation
101
 
protected:
 
100
private:
102
101
 
103
102
        friend class basic_statement;
104
 
        friend class basic_transaction;
105
103
        friend class command;
106
 
        friend class query;
107
 
        friend class sqlite_error;
108
 
 
109
 
        /** class to provide a scope lock for the database mutex */
110
 
        class database_mutex_guard
111
 
        {
112
 
        public:
113
 
 
114
 
                /** constructor that provides a database */
115
 
                database_mutex_guard(
116
 
                        database &database );
117
 
 
118
 
                ~database_mutex_guard();
119
 
 
120
 
                /** release the mutex early */
121
 
                void leave();
122
 
 
123
 
        private:
124
 
                sqlite3_mutex *_mutex;
125
 
        };
126
 
 
127
 
private:
128
104
 
129
105
        /** the database handle */
130
106
        sqlite3 *_handle;