Advertisement
bayerb

main.cpp

Mar 20th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <memory>
  4.  
  5.  
  6. #include "result.hpp"
  7. #include "result-mapping.hpp"
  8. #include "result-odb.hxx"
  9. #include "result-mapping-odb.hxx"
  10.  
  11. #include <odb/sqlite/database.hxx>
  12.  
  13. int main(int argc, char const *argv[]) {
  14.  
  15.   int Id = 1;
  16.   std::array<float, 7> Values = {{0, 1, 2, 3, 4, 5, 6}};
  17.  
  18.   ResultFloatSeven S(Values, Id);
  19.  
  20.   {
  21.     std::unique_ptr<odb::database> db(new odb::sqlite::database(
  22.         "./test.db", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE));
  23.  
  24.     odb::transaction t(db->begin());
  25.     db->persist(S);
  26.     t.commit();
  27.   }
  28.  
  29.   return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement