~ubuntu-branches/ubuntu/warty/pdns/warty

« back to all changes in this revision

Viewing changes to modules/gsqlitebackend/ssqlite.hh

  • Committer: Bazaar Package Importer
  • Author(s): Wichert Akkerman
  • Date: 2004-05-14 14:04:34 UTC
  • Revision ID: james.westby@ubuntu.com-20040514140434-1srx8ysnz6pw53m5
Tags: upstream-2.9.16
ImportĀ upstreamĀ versionĀ 2.9.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
//
 
3
// SQLite backend for PowerDNS
 
4
// Copyright (C) 2003, Michel Stol <michel@powerdns.com>
 
5
//
 
6
 
 
7
#ifndef SSQLITE_HH
 
8
#define SSQLITE_HH
 
9
 
 
10
#include <sqlite.h>
 
11
#include "pdns/backends/gsql/ssql.hh"
 
12
 
 
13
class SSQLite : public SSql
 
14
{
 
15
private:
 
16
  //! Pointer to the SQLite database instance.
 
17
  sqlite *m_pDB;
 
18
 
 
19
  //! Pointer to the SQLite virtual machine executing a query.
 
20
  sqlite_vm *m_pVM;
 
21
  
 
22
protected:
 
23
public:
 
24
  //! Constructor.
 
25
  SSQLite( const std::string & database );
 
26
  
 
27
  //! Destructor.
 
28
  ~SSQLite( void );
 
29
  
 
30
  //! Performs a query and puts answers in result
 
31
  int doQuery( const std::string & query, result_t & result );
 
32
  
 
33
  //! Performs a query, caller can retrieve answers with getRow
 
34
  int doQuery( const std::string & query );
 
35
 
 
36
  //! Performs a command that does not return rows
 
37
  int doCommand( const std::string & query )
 
38
  {
 
39
    return doQuery(query);
 
40
  }
 
41
 
 
42
  
 
43
  //! Returns a row from a result set.
 
44
  bool getRow( row_t & row );
 
45
  
 
46
  //! Escapes the SQL query.
 
47
  std::string escape( const std::string & query );
 
48
  
 
49
  //! Used to create an backend specific exception message.
 
50
  SSqlException sPerrorException( const std::string & reason );
 
51
  
 
52
};
 
53
 
 
54
#endif // SSQLITE_HH
 
55