Drizzled Public API Documentation

drizzle_plugin::json_server::SQLExecutor Class Reference

#include <sql_executor.h>

Public Member Functions

 SQLExecutor (const string &schema)
 
void setErrorState ()
 
void clearErrorState ()
 
const sql::Exception getException () const
 
sql::ResultSetgetResultSet () 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 sql_executor.h.

Constructor & Destructor Documentation

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

Constructor

Parameters
usera constant string.
schemaa constant string.

Definition at line 42 of file sql_executor.cc.

References _result_set, _session, and _sql.

Member Function Documentation

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

set the error state as false.

Definition at line 76 of file sql_executor.h.

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 sql_executor.cc.

References _err, _exception, _in_error_state, _result_set, _session, and _sql.

Referenced by drizzle_plugin::json_server::DBAccess::execute().

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 sql_executor.h.

Referenced by drizzle_plugin::json_server::DBAccess::execute().

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 sql_executor.h.

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

used to get resultset object.

Returns
a resultset.

Definition at line 94 of file sql_executor.h.

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 sql_executor.h.

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

set the error state as true.

Definition at line 68 of file sql_executor.h.

Member Data Documentation

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

Stores the error state of executing a sql.

Definition at line 143 of file sql_executor.h.

Referenced by executeSQL().

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 sql_executor.h.

Referenced by executeSQL().

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

Stores whether an error has happened.

Definition at line 135 of file sql_executor.h.

Referenced by executeSQL().

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

Stores resultset of a sql transaction.

Definition at line 147 of file sql_executor.h.

Referenced by executeSQL(), and SQLExecutor().

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

stores session.

Definition at line 129 of file sql_executor.h.

Referenced by executeSQL(), and SQLExecutor().

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

Stores a sql string.

Definition at line 151 of file sql_executor.h.

Referenced by executeSQL(), and SQLExecutor().


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