File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -279,8 +279,12 @@ namespace sqlite {
279279 database (std::shared_ptr<sqlite3> db):
280280 _db (db) {}
281281
282+ database_binder::chain_type operator <<(const std::string& sql) {
283+ return database_binder::chain_type (new database_binder (_db, sql));
284+ }
285+
282286 database_binder::chain_type operator <<(const char * sql) {
283- return database_binder::chain_type ( new database_binder (_db, std::string (sql)) );
287+ return * this << std::string (sql);
284288 }
285289
286290 connection_type connection () const { return _db; }
Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ int main()
4444 exit (EXIT_FAILURE);
4545 }
4646
47+ std::string sql (" select 1+1" );
48+ int test = 0 ;
49+ db << sql >> test;
50+
51+ if (test != 2 ) exit (EXIT_FAILURE);
4752
4853 }
4954 catch (sqlite_exception e)
You can’t perform that action at this time.
0 commit comments