From 043d8fabcf15918e22efdbde41af4880b23c0104 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 12 Jan 2012 09:28:07 +0200 Subject: Query support for SQL Server --- common/query/test.hxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'common') 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 #include +#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 buffer; typedef odb::nullable 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_; }; -- cgit v1.1