File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -279,8 +279,12 @@ namespace sqlite {
279
279
database (std::shared_ptr<sqlite3> db):
280
280
_db (db) {}
281
281
282
+ database_binder::chain_type operator <<(const std::string& sql) {
283
+ return database_binder::chain_type (new database_binder (_db, sql));
284
+ }
285
+
282
286
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);
284
288
}
285
289
286
290
connection_type connection () const { return _db; }
Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ int main()
44
44
exit (EXIT_FAILURE);
45
45
}
46
46
47
+ std::string sql (" select 1+1" );
48
+ int test = 0 ;
49
+ db << sql >> test;
50
+
51
+ if (test != 2 ) exit (EXIT_FAILURE);
47
52
48
53
}
49
54
catch (sqlite_exception e)
You can’t perform that action at this time.
0 commit comments