Drizzled Public API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
sql_executor.h
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
*
4
* Copyright (C) 2012 Mohit Srivastava
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
25
#pragma once
26
27
#include <vector>
28
#include <drizzled/session.h>
29
#include <drizzled/plugin/listen.h>
30
#include <drizzled/plugin/client.h>
31
#include <drizzled/catalog/local.h>
32
#include <drizzled/execute.h>
33
#include <drizzled/sql/result_set.h>
34
#include <drizzled/errmsg_print.h>
35
#include <drizzled/plugin.h>
36
37
38
using namespace
std;
39
using namespace
drizzled;
40
44
namespace
drizzle_plugin
45
{
49
namespace
json_server
50
{
54
class
SQLExecutor
55
{
56
public
:
63
SQLExecutor
(
const
string
&schema);
64
68
void
setErrorState
()
69
{
70
_in_error_state=
true
;
71
}
72
76
void
clearErrorState
()
77
{
78
_in_error_state=
false
;
79
}
80
85
const
sql::Exception
getException
()
const
86
{
87
return
_exception;
88
}
89
94
sql::ResultSet
*
getResultSet
()
const
95
{
96
return
_result_set;
97
}
98
103
const
string
&
getSql
()
const
104
{
105
return
_sql;
106
}
107
112
const
drizzled::error_t&
getErr
()
const
113
{
114
return
_err;
115
}
116
123
bool
executeSQL(
string
&sql);
124
125
protected
:
129
drizzled::Session::shared_ptr
_session
;
130
131
private
:
135
bool
_in_error_state
;
139
sql::Exception
_exception
;
143
drizzled::error_t
_err
;
147
sql::ResultSet
*
_result_set
;
151
string
_sql
;
152
};
153
154
}
155
}
156
plugin
json_server
sql_executor.h
Generated on Thu Aug 29 2013 10:00:35 for drizzle by
1.8.4