/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-29 06:39:13 UTC
  • Revision ID: edam@waxworlds.org-20100729063913-wvcvkogsa2alwkhr
- moved basic_statement::operator <<() back to basic_statement and just create another specialisation in command so that it can use sqlite::exec

Show diffs side-by-side

added added

removed removed

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