diff options
-rw-r--r-- | common/schema/test.hxx | 20 | ||||
-rw-r--r-- | common/template/test.hxx | 22 |
2 files changed, 22 insertions, 20 deletions
diff --git a/common/schema/test.hxx b/common/schema/test.hxx index 471d27b..c9ddd14 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -51,7 +51,25 @@ struct type #pragma odb id int id; - #pragma odb type ("INTEGER") + // Test default C++ to DB type mapping. + // + bool b; + char c; + signed char sc; + unsigned char uc; + short s; + unsigned short us; + int i; + unsigned int ui; + long l; + unsigned long ul; + long long ll; + unsigned long long ull; + float f; + double d; + std::string str; + + #pragma odb type ("INTEGER UNSIGNED") bool m1; }; diff --git a/common/template/test.hxx b/common/template/test.hxx index 48acd44..3891a75 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -10,14 +10,14 @@ #include <odb/core.hxx> #pragma odb object -struct object1 +struct object { - object1 (unsigned long id) + object (unsigned long id) : id_ (id) { } - object1 () + object () { } @@ -25,20 +25,4 @@ struct object1 unsigned long id_; }; -#pragma odb object -struct object2 -{ - object2 (const std::string& id) - : id_ (id) - { - } - - object2 () - { - } - - #pragma odb id - std::string id_; -}; - #endif // TEST_HXX |