aboutsummaryrefslogtreecommitdiff
path: root/bdep/database-views-odb.hxx
blob: 66ce67a7d1468b8a778b822d10b55d7ff3724a4b (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// -*- C++ -*-
//
// This file was generated by ODB, object-relational mapping (ORM)
// compiler for C++.
//

#ifndef BDEP_DATABASE_VIEWS_ODB_HXX
#define BDEP_DATABASE_VIEWS_ODB_HXX

// Begin prologue.
//
#include <bdep/wrapper-traits.hxx>
//
// End prologue.

#include <odb/version.hxx>

#if (ODB_VERSION != 20476UL)
#error ODB runtime version mismatch
#endif

#include <odb/pre.hxx>

#include <bdep/database-views.hxx>

#include <memory>
#include <cstddef>
#include <utility>

#include <odb/core.hxx>
#include <odb/traits.hxx>
#include <odb/callback.hxx>
#include <odb/wrapper-traits.hxx>
#include <odb/pointer-traits.hxx>
#include <odb/container-traits.hxx>
#include <odb/no-op-cache-traits.hxx>
#include <odb/result.hxx>
#include <odb/view-image.hxx>
#include <odb/view-result.hxx>

#include <odb/details/unused.hxx>
#include <odb/details/shared-ptr.hxx>

namespace odb
{
  // sqlite_master
  //
  template <>
  struct class_traits< ::bdep::sqlite_master >
  {
    static const class_kind kind = class_view;
  };

  template <>
  class access::view_traits< ::bdep::sqlite_master >
  {
    public:
    typedef ::bdep::sqlite_master view_type;
    typedef ::bdep::sqlite_master* pointer_type;

    static void
    callback (database&, view_type&, callback_event);
  };
}

#include <odb/details/buffer.hxx>

#include <odb/sqlite/version.hxx>
#include <odb/sqlite/forward.hxx>
#include <odb/sqlite/binding.hxx>
#include <odb/sqlite/sqlite-types.hxx>
#include <odb/sqlite/query.hxx>

namespace odb
{
  // sqlite_master
  //
  template <>
  class access::view_traits_impl< ::bdep::sqlite_master, id_sqlite >:
    public access::view_traits< ::bdep::sqlite_master >
  {
    public:
    struct image_type
    {
      // type
      //
      details::buffer type_value;
      std::size_t type_size;
      bool type_null;

      // name
      //
      details::buffer name_value;
      std::size_t name_size;
      bool name_null;

      // sql
      //
      details::buffer sql_value;
      std::size_t sql_size;
      bool sql_null;

      std::size_t version;
    };

    typedef sqlite::view_statements<view_type> statements_type;

    typedef sqlite::query_base query_base_type;
    struct query_columns
    {
    };

    static const bool versioned = false;

    static bool
    grow (image_type&,
          bool*);

    static void
    bind (sqlite::bind*,
          image_type&);

    static void
    init (view_type&,
          const image_type&,
          database*);

    static const std::size_t column_count = 3UL;

    static query_base_type
    query_statement (const query_base_type&);

    static result<view_type>
    query (database&, const query_base_type&);
  };

  template <>
  class access::view_traits_impl< ::bdep::sqlite_master, id_common >:
    public access::view_traits_impl< ::bdep::sqlite_master, id_sqlite >
  {
  };
}

#include <bdep/database-views-odb.ixx>

#include <odb/post.hxx>

#endif // BDEP_DATABASE_VIEWS_ODB_HXX