aboutsummaryrefslogtreecommitdiff
path: root/mssql/stored-proc/test.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-11-18 14:54:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-11-18 14:54:23 +0200
commit092cb7d916b8ebc83cacab849010acd04f56d38d (patch)
tree1b8bebfb050a2728b48641831f8586cc579867ed /mssql/stored-proc/test.hxx
parent64b27b86025d160e49bf617143d80671ccb1e0e4 (diff)
Add SQL Server stored procedure test
Diffstat (limited to 'mssql/stored-proc/test.hxx')
-rw-r--r--mssql/stored-proc/test.hxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/mssql/stored-proc/test.hxx b/mssql/stored-proc/test.hxx
new file mode 100644
index 0000000..16f3c52
--- /dev/null
+++ b/mssql/stored-proc/test.hxx
@@ -0,0 +1,58 @@
+// file : mssql/stored-proc/test.hxx
+// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef TEST_HXX
+#define TEST_HXX
+
+#include <string>
+
+#include <odb/core.hxx>
+
+#pragma db view query("SELECT SCHEMA_NAME()")
+struct default_schema
+{
+ std::string name;
+};
+
+#pragma db object
+struct object
+{
+ object () {}
+ object (unsigned int n, std::string s): num (n), str (s) {}
+
+ #pragma db id auto
+ unsigned long id;
+
+ unsigned int num;
+ std::string str;
+};
+
+#pragma db view query("EXEC select_all_objects")
+struct select_all_objects
+{
+ unsigned int num;
+ std::string str;
+};
+
+#pragma db view query("EXEC select_objects (?)")
+struct select_objects
+{
+ std::string str;
+};
+
+#pragma db view query("EXEC objects_min_max_odb (?)")
+struct objects_min_max
+{
+ unsigned int num_min;
+ unsigned int num_max;
+};
+
+#pragma db view query("EXEC insert_object_odb (?)")
+struct insert_object
+{
+ unsigned int ret;
+ unsigned long id;
+};
+
+#endif // TEST_HXX