drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzle_plugin::json_server::SQLExecutor Class Reference

#include <sql_executor.h>

Collaboration diagram for drizzle_plugin::json_server::SQLExecutor:
[legend]

Public Member Functions

 SQLExecutor (const string &schema)
void setErrorState ()
void clearErrorState ()
const sql::Exception getException () const
sql::ResultSet * getResultSet () const
const string & getSql () const
const drizzled::error_t & getErr () const
bool executeSQL (string &sql)

Protected Attributes

drizzled::Session::shared_ptr _session

Private Attributes

bool _in_error_state
sql::Exception _exception
drizzled::error_t _err
sql::ResultSet * _result_set
string _sql

Detailed Description

Execute given sql string.

Definition at line 54 of file json_server/sql_executor.h.

Constructor & Destructor Documentation

◆ SQLExecutor()

drizzle_plugin::json_server::SQLExecutor::SQLExecutor ( const string & schema)

Constructor

Parameters
usera constant string.
schemaa constant string.

Definition at line 42 of file json_server/sql_executor.cc.

Member Function Documentation

◆ clearErrorState()

void drizzle_plugin::json_server::SQLExecutor::clearErrorState ( )
inline

set the error state as false.

Definition at line 76 of file json_server/sql_executor.h.

◆ executeSQL()

bool drizzle_plugin::json_server::SQLExecutor::executeSQL ( string & sql)

execute a batch of SQL statements.

Parameters
sqlBatch of SQL statements to execute.
Returns
true Success
false Failure

Definition at line 55 of file json_server/sql_executor.cc.

◆ getErr()

const drizzled::error_t & drizzle_plugin::json_server::SQLExecutor::getErr ( ) const
inline

used to get error.

Returns
a constant error_t object.

Definition at line 112 of file json_server/sql_executor.h.

◆ getException()

const sql::Exception drizzle_plugin::json_server::SQLExecutor::getException ( ) const
inline

used to get error execption which occurs while executing a sql.

Returns
a constant sql exception object.

Definition at line 85 of file json_server/sql_executor.h.

◆ getResultSet()

sql::ResultSet * drizzle_plugin::json_server::SQLExecutor::getResultSet ( ) const
inline

used to get resultset object.

Returns
a resultset.

Definition at line 94 of file json_server/sql_executor.h.

◆ getSql()

const string & drizzle_plugin::json_server::SQLExecutor::getSql ( ) const
inline

used to get sql string.

Returns
a constant sql string.

Definition at line 103 of file json_server/sql_executor.h.

◆ setErrorState()

void drizzle_plugin::json_server::SQLExecutor::setErrorState ( )
inline

set the error state as true.

Definition at line 68 of file json_server/sql_executor.h.

Member Data Documentation

◆ _err

drizzled::error_t drizzle_plugin::json_server::SQLExecutor::_err
private

Stores the error state of executing a sql.

Definition at line 143 of file json_server/sql_executor.h.

◆ _exception

sql::Exception drizzle_plugin::json_server::SQLExecutor::_exception
private

Stores execption if one occurs while executing a sql query.

Definition at line 139 of file json_server/sql_executor.h.

◆ _in_error_state

bool drizzle_plugin::json_server::SQLExecutor::_in_error_state
private

Stores whether an error has happened.

Definition at line 135 of file json_server/sql_executor.h.

◆ _result_set

sql::ResultSet* drizzle_plugin::json_server::SQLExecutor::_result_set
private

Stores resultset of a sql transaction.

Definition at line 147 of file json_server/sql_executor.h.

◆ _session

drizzled::Session::shared_ptr drizzle_plugin::json_server::SQLExecutor::_session
protected

stores session.

Definition at line 129 of file json_server/sql_executor.h.

◆ _sql

string drizzle_plugin::json_server::SQLExecutor::_sql
private

Stores a sql string.

Definition at line 151 of file json_server/sql_executor.h.


The documentation for this class was generated from the following files: