/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/exception.h

  • Committer: edam
  • Date: 2010-07-29 20:56:19 UTC
  • Revision ID: edam@waxworlds.org-20100729205619-a9yo4uzu647nvnsj
- renamed database to connection to better identify what it is (would database_connection be better though?)
- moved basic_statement and basic_transaction to sqlite::detail
- made sqlite::threadsafe() return the threading mode int, not a bool
- renamed row::index() to row_number() so it isn't confused with column index
- added typedef for deferred_transaction
- added early rollback method to transaction_guard
- allowed transaction_guard::~transaction_guard() to throw exceptions, since when it needs to, we're really screwed anyway
- bugfix: query::reset() didn't reset the internal row counter
- added query::num_results()
- added docs/design-notes
- reimplemented query::iterator so that increment() (which performs a step() on the query) now caches the returned row to be returned during dereference() (previously it stashed details and returned new row!?)
- bugfix: resetting active queries during rollbacks would hang!

Show diffs side-by-side

added added

removed removed

32
32
{
33
33
 
34
34
 
35
 
class database;
 
35
class connection;
36
36
 
37
37
 
38
38
/**
47
47
public:
48
48
 
49
49
        /**
50
 
         * Constructor that takes an sqlite error code and a database from which to
51
 
         * determine it's error message
52
 
         * @param code the sqlite error code
 
50
         * Constructor that takes an sqlite result code and a connection from which
 
51
         * to determine it's error message
 
52
         * @param connection a reference to a connection
 
53
         * @param code the sqlite result code
53
54
         * @see sqlite_errmsg()
54
55
         */
55
56
        explicit sqlite_error(
56
 
                database &database,
 
57
                connection &connection,
57
58
                int code );
58
59
 
59
60
 
60
61
        /**
61
 
         * Constructor that takes an sqlite error code and determines it's own
 
62
         * Constructor that takes an sqlite result code and determines it's own
62
63
         * generic error message
63
 
         * @param code the sqlite error code
 
64
         * @param code the sqlite result code
64
65
         */
65
66
        explicit sqlite_error(
66
67
                int code );
67
68
 
68
69
        /**
69
 
         * Constructor that allows the creation of an sqlite error with a custom
 
70
         * Constructor that allows the creation of an sqlite result with a custom
70
71
         * message.
71
72
         * @param message a customer error message string
72
 
         * @param code the sqlite error code
 
73
         * @param code the sqlite result code
73
74
         */
74
75
        explicit sqlite_error(
75
76
                const std::string &message,
82
83
public:
83
84
 
84
85
        /**
85
 
         * Get the sqlite error code associated with this error
86
 
         * @returns the sqlite error code
 
86
         * Get the sqlite result code associated with this error
 
87
         * @returns the sqlite result code
87
88
         */
88
89
        int get_code() const;
89
90
 
98
99
private:
99
100
 
100
101
        /**
101
 
         * Retrieve an automatic error message for a given sqlite error code
102
 
         * @param the sqlite error code
 
102
         * Retrieve an automatic error message for a given sqlite result code
 
103
         * @param the sqlite result code
103
104
         * @returns the automatic string
104
105
         */
105
106
        const std::string &get_message(
106
107
                int code );
107
108
 
108
 
        /** the error code */
 
109
        /** the result code */
109
110
        int _code;
110
111
 
111
112
        /** the message string */