aboutsummaryrefslogtreecommitdiff
path: root/common/query
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-01-12 09:28:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-01-20 15:45:46 +0200
commit043d8fabcf15918e22efdbde41af4880b23c0104 (patch)
tree3d1aed8a2c8dd30d61417e5029390ba0865ad88b /common/query
parent3cc019d0df41400f9cf921040adab0ae198b570a (diff)
Query support for SQL Server
Diffstat (limited to 'common/query')
-rw-r--r--common/query/test.hxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/common/query/test.hxx b/common/query/test.hxx
index b69be3c..9e8b0ff 100644
--- a/common/query/test.hxx
+++ b/common/query/test.hxx
@@ -14,6 +14,16 @@
#include <odb/core.hxx>
#include <odb/nullable.hxx>
+#ifdef ODB_COMPILER
+# if defined(ODB_DATABASE_PGSQL)
+# define BLOB_TYPE "BYTEA"
+# elif defined(ODB_DATABASE_MSSQL)
+# define BLOB_TYPE "VARBINARY(max)"
+# else
+# define BLOB_TYPE "BLOB"
+# endif
+#endif
+
typedef std::vector<char> buffer;
typedef odb::nullable<buffer> nullable_buffer;
@@ -54,11 +64,7 @@ struct person
unsigned short age_;
bool married_;
-#ifdef ODB_DATABASE_PGSQL
- #pragma db column ("key") type ("BYTEA") null
-#else
- #pragma db column ("key") type ("BLOB") null
-#endif
+ #pragma db column ("key") type(BLOB_TYPE) null
nullable_buffer public_key_;
};