| 26 | } |
| 27 | |
| 28 | int main() { |
| 29 | try { |
| 30 | database db(":memory:"); |
| 31 | |
| 32 | db << "drop table if exists test"; |
| 33 | db << |
| 34 | "create table if not exists test (" |
| 35 | " id integer primary key," |
| 36 | " val int" |
| 37 | ");"; |
| 38 | |
| 39 | insert(db, true); |
| 40 | select(db, true); |
| 41 | |
| 42 | insert(db, false); |
| 43 | select(db, false); |
| 44 | |
| 45 | } catch(exception& e) { |
| 46 | cout << e.what() << endl; |
| 47 | exit(EXIT_FAILURE); |
| 48 | } |
| 49 | exit(EXIT_SUCCESS); |
| 50 | } |
| 51 | #else |
| 52 | #pragma message "<optional> not found, test disabled." |
| 53 | int main() { |