aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/statement-cache.cxx
blob: 383a78e638c6810c153751efb83bffd559b88f2f (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
// file      : odb/sqlite/statement-cache.cxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license   : GNU GPL v2; see accompanying LICENSE file

#include <odb/sqlite/statement-cache.hxx>

namespace odb
{
  using namespace details;

  namespace sqlite
  {
    statement_cache::
    statement_cache (connection& conn)
        : conn_ (conn),
          // String lengths below include '\0', as per SQLite manual
          // suggestions.
          //
          begin_ (new (shared) simple_statement (conn, "BEGIN", 6)),
          commit_ (new (shared) simple_statement (conn, "COMMIT", 7)),
          rollback_ (new (shared) simple_statement (conn, "ROLLBACK", 9))
    {
      rollback_->cached (true);
      commit_->cached (true);
      begin_->cached (true);
    }
  }
}