aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-09-13 10:42:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-09-13 10:42:46 +0200
commita9d527ffd7e4a2222d5e80c8110f092af0cb5a74 (patch)
treecd190434be960f8bbb8547619b8b97265d844ed9 /common
parentc85f0af82c3abf2e7d2dfa76351a59d9884395c0 (diff)
Change pragma syntax
Change odb pragma namespace to db. Use qualifiers (object, value, and member) to specify type/member name. Add support for mapping C++ types to db types.
Diffstat (limited to 'common')
-rw-r--r--common/auto/test.hxx4
-rw-r--r--common/lifecycle/test.hxx4
-rw-r--r--common/query/test.hxx10
-rw-r--r--common/schema/test.hxx22
-rw-r--r--common/template/test.hxx4
-rw-r--r--common/threads/test.hxx4
6 files changed, 24 insertions, 24 deletions
diff --git a/common/auto/test.hxx b/common/auto/test.hxx
index c23027e..8c16a21 100644
--- a/common/auto/test.hxx
+++ b/common/auto/test.hxx
@@ -10,7 +10,7 @@
#include <odb/core.hxx>
-#pragma odb object
+#pragma db object
struct object
{
object (const std::string& str)
@@ -18,7 +18,7 @@ struct object
{
}
- #pragma odb auto id
+ #pragma db auto id
unsigned long id_;
std::string str_;
diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx
index 268678c..6db1c7e 100644
--- a/common/lifecycle/test.hxx
+++ b/common/lifecycle/test.hxx
@@ -9,7 +9,7 @@
#include <string>
#include <odb/core.hxx>
-#pragma odb object
+#pragma db object
struct object
{
object (unsigned long id)
@@ -21,7 +21,7 @@ struct object
{
}
- #pragma odb id
+ #pragma db id
unsigned long id_;
std::string str_;
};
diff --git a/common/query/test.hxx b/common/query/test.hxx
index 59655f6..3d10cc2 100644
--- a/common/query/test.hxx
+++ b/common/query/test.hxx
@@ -12,7 +12,7 @@
#include <odb/core.hxx>
-#pragma odb object
+#pragma db object
struct person
{
person (unsigned long id,
@@ -32,17 +32,17 @@ struct person
{
}
- #pragma odb id
+ #pragma db id
unsigned long id_;
- #pragma odb column ("first")
+ #pragma db column ("first")
std::string first_name_;
typedef std::auto_ptr<std::string> string_ptr; // @@ tmp
- #pragma odb column ("middle") type ("TEXT")
+ #pragma db column ("middle") type ("TEXT")
string_ptr middle_name_;
- #pragma odb column ("last")
+ #pragma db column ("last")
std::string last_name_;
unsigned short age_;
diff --git a/common/schema/test.hxx b/common/schema/test.hxx
index 14c5113..d770d8f 100644
--- a/common/schema/test.hxx
+++ b/common/schema/test.hxx
@@ -11,29 +11,29 @@
// Table names.
//
-#pragma odb object table ("TABLE_EXPLICIT")
+#pragma db object table ("TABLE_EXPLICIT")
struct table_explicit
{
- #pragma odb id
+ #pragma db id
unsigned long id_;
};
-#pragma odb object
+#pragma db object
struct table_implicit
{
- #pragma odb id
+ #pragma db id
unsigned long id_;
};
// Column names.
//
-#pragma odb object
+#pragma db object
struct column
{
- #pragma odb id
+ #pragma db id
int m1;
- #pragma odb column ("foo")
+ #pragma db column ("foo")
int m2;
int m_m3;
@@ -45,10 +45,10 @@ struct column
// Column types.
//
-#pragma odb object
+#pragma db object
struct type
{
- #pragma odb id
+ #pragma db id
std::string id;
// Test default C++ to DB type mapping.
@@ -69,10 +69,10 @@ struct type
double d;
std::string str;
- #pragma odb type ("INTEGER UNSIGNED")
+ #pragma db type ("INTEGER UNSIGNED")
bool m1;
- #pragma odb transient
+ #pragma db transient
char* m2;
};
diff --git a/common/template/test.hxx b/common/template/test.hxx
index cb25360..1b945a6 100644
--- a/common/template/test.hxx
+++ b/common/template/test.hxx
@@ -8,7 +8,7 @@
#include <odb/core.hxx>
-#pragma odb object
+#pragma db object
struct object
{
object (unsigned long id)
@@ -20,7 +20,7 @@ struct object
{
}
- #pragma odb id
+ #pragma db id
unsigned long id_;
};
diff --git a/common/threads/test.hxx b/common/threads/test.hxx
index d02fdfd..b9f7777 100644
--- a/common/threads/test.hxx
+++ b/common/threads/test.hxx
@@ -10,7 +10,7 @@
#include <odb/core.hxx>
-#pragma odb object
+#pragma db object
struct object
{
object (unsigned long id, const std::string& str)
@@ -22,7 +22,7 @@ struct object
{
}
- #pragma odb id
+ #pragma db id
unsigned long id_;
std::string str_;