aboutsummaryrefslogtreecommitdiff
path: root/mssql/stored-proc/test.hxx
blob: 8537096e47416278f91041a6a501db07b252ebbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// file      : mssql/stored-proc/test.hxx
// copyright : Copyright (c) 2009-2015 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
struct no_result {};

#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 (?)")
struct insert_object {};

#pragma db view query("EXEC insert_object_id_odb (?)")
struct insert_object_id
{
  unsigned int ret;
  unsigned long id;
};

#endif // TEST_HXX