/sqlite3cc

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

« back to all changes in this revision

Viewing changes to src/basic_statement.cc

  • Committer: edam
  • Date: 2010-07-29 06:28:53 UTC
  • Revision ID: edam@waxworlds.org-20100729062853-4i2fec52m86mh724
- made basic_statement::step() protected, for use by query and command only
- moved basic_statement::operator<<() to command and query instead; one needs to accept sqlite::exec, the other doesn't
- added tests for query::operator<<()
- added code to invlaidate in-progress queries during any transaction rollbacks (currently segfaults in basic_statement::finalize())
- added new sqlite_error constructor that obtains a full error message
- implemented database::database_mutex_guard class
- swapped command's step mutex in favour of the database mutex

Show diffs side-by-side

added added

removed removed

23
23
#include <sqlite3cc/basic_statement.h>
24
24
#include <sqlite3cc/exception.h>
25
25
#include <sqlite3cc/database.h>
26
 
#include <sqlite3cc/manipulator.h>
27
26
#include <string.h>
28
27
 
29
28
 
169
168
{
170
169
        return sqlite3_step( _handle );
171
170
}
172
 
 
173
 
 
174
 
 
175
 
template< >
176
 
sqlite::basic_statement &sqlite::basic_statement::operator <<
177
 
        < sqlite::detail::null_t >(
178
 
        const sqlite::detail::null_t & )
179
 
{
180
 
        int code = bind_null( _bind_index );
181
 
        if( code != SQLITE_OK ) throw sqlite_error( _database, code );
182
 
        _bind_index++;
183
 
        return *this;
184
 
}
185
 
 
186
 
 
187
 
template< >
188
 
sqlite::basic_statement &sqlite::basic_statement::operator <<
189
 
        < sqlite::detail::set_index_t >(
190
 
        const sqlite::detail::set_index_t &t )
191
 
{
192
 
        _bind_index = t._index;
193
 
        return *this;
194
 
}