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

  • Committer: edam
  • Date: 2010-07-27 15:12:55 UTC
  • Revision ID: edam@waxworlds.org-20100727151255-goaqgdz4kj13q7gz
- update TODO
- added some missing includes for <string>
- changed usage of database::exec() to not require return code!
- prevented transaction_guard destructor from throwing an exception

Show diffs side-by-side

added added

removed removed

73
73
                const std::string &sql );
74
74
 
75
75
        /**
76
 
         * Perform a step() and return row object that can be used to retrieve the
 
76
         * Peform a step() and return row object that can be used to retrieve the
77
77
         * results.
78
78
         * @return a row object
79
79
         */
132
132
         */
133
133
        iterator end();
134
134
 
135
 
        /**
136
 
         * Stream operator is used to bind values to parameters automatically, in
137
 
         * ascending order. In addition, the null and set_index() auto-binding
138
 
         * manipulators can be used.
139
 
         * @param value a value to bind
140
 
         */
141
 
        template< class T >
142
 
        query &operator <<(
143
 
                const T &value )
144
 
        {
145
 
                int code = bind( _bind_index, value );
146
 
                if( code != SQLITE_OK ) throw sqlite_error( _database, code );
147
 
                _bind_index++;
148
 
                return *this;
149
 
        }
150
 
 
151
135
//______________________________________________________________________________
152
136
//                                                                implementation
153
137
private:
158
142
};
159
143
 
160
144
 
161
 
// template specialisations for query::operator <<()
162
 
template< >
163
 
query &query::operator << < detail::null_t >(
164
 
        const detail::null_t & );
165
 
template< >
166
 
query &query::operator << < detail::set_index_t >(
167
 
        const detail::set_index_t &t );
168
 
 
169
 
 
170
145
} // namespace sqlite
171
146
 
172
147