nodejs-db-informix  master
nodejs bindings for Informix
 All Classes Functions Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Attributes | List of all members
nodejs_db::Query Class Reference
Inheritance diagram for nodejs_db::Query:
Inheritance graph
[legend]
Collaboration diagram for nodejs_db::Query:
Collaboration graph
[legend]

Classes

struct  execute_request_t
 
struct  projection_clause
 
struct  projection_clause_t
 
struct  query_async_t
 
struct  row_t
 

Public Types

enum  query_t {
  NONE = 0, SELECT = 0x1, INSERT = 0x1 << 1, UPDATE = 0x1 << 2,
  DELETE = 0x1 << 3
}
 

Public Member Functions

void setConnection (Connection *connection)
 
v8::Handle< v8::Value > set (const v8::Arguments &args)
 

Static Public Member Functions

static void Init (v8::Handle< v8::Object > target, v8::Persistent< v8::FunctionTemplate > constructorTemplate)
 
- Static Public Member Functions inherited from nodejs_db::EventEmitter
static void Init ()
 

Protected Member Functions

void executeAsync (execute_request_t *request)
 
std::string fieldName (v8::Local< v8::Value > value) const throw (Exception&)
 
std::string tableName (v8::Local< v8::Value > value, bool escape=true) const throw (Exception&)
 
v8::Handle< v8::Value > addCondition (const v8::Arguments &args, const char *separator)
 
v8::Local< v8::Object > row (Result *result, row_t *currentRow) const
 
virtual std::string parseQuery () const throw (Exception&)
 
virtual std::vector
< std::string::size_type > 
placeholders (std::string *parsed) const throw (Exception&)
 
virtual void addProjections () throw (Exception&)
 
virtual Resultexecute () const throw (Exception&)
 
std::string value (v8::Local< v8::Value > value, bool inArray=false, bool escape=true, int precision=-1) const throw (Exception&)
 
- Protected Member Functions inherited from nodejs_db::EventEmitter
bool Emit (const char *event, int argc, v8::Handle< v8::Value > argv[])
 

Static Protected Member Functions

static v8::Handle< v8::Value > Select (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Skip (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Limit (const v8::Arguments &args)
 
static v8::Handle< v8::Value > First (const v8::Arguments &args)
 
static v8::Handle< v8::Value > From (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Join (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Where (const v8::Arguments &args)
 
static v8::Handle< v8::Value > And (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Or (const v8::Arguments &args)
 
static v8::Handle< v8::Value > OrderBy (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Add (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Insert (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Into (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Values (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Update (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Set (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Delete (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Sql (const v8::Arguments &args)
 
static v8::Handle< v8::Value > Execute (const v8::Arguments &args)
 
static void uvExecute (uv_work_t *uvRequest)
 
static void uvEmitResults (uv_async_t *uvAsync, int status)
 
static void uvExecuteFinished (uv_work_t *Rquest, int status)
 
static void freeRequest (execute_request_t *request, bool freeAll=true)
 

Protected Attributes

Connectionconnection
 
std::ostringstream sql
 
query_t sqlType
 
projection_clause_t projection
 
std::vector< v8::Persistent
< v8::Value > > 
values
 
bool async
 
bool cast
 
bool bufferText
 
v8::Persistent< v8::Function > * cbStart
 
v8::Persistent< v8::Function > * cbExecute
 
v8::Persistent< v8::Function > * cbFinish
 

Static Protected Attributes

static uv_async_t g_async
 
- Static Protected Attributes inherited from nodejs_db::EventEmitter
static v8::Persistent< v8::String > syEmit
 

Private Member Functions

std::string fromDate (const double timeStamp) const throw (Exception&)
 

Static Private Attributes

static bool gmtDeltaLoaded = false
 
static int gmtDelta
 

Detailed Description

Definition at line 21 of file query.h.

Member Function Documentation

void nodejs_db::Query::addProjections ( ) throw (Exception&)
protectedvirtual

Add projection clauses into the query. Assuming that this function will be called only once and none of the projection clauses are present into the query

Definition at line 1870 of file query.cxx.

Here is the caller graph for this function:

v8::Handle< v8::Value > nodejs_db::Query::Execute ( const v8::Arguments &  args)
staticprotected

Execute the query

Definition at line 728 of file query.cxx.

Here is the call graph for this function:

nodejs_db::Result * nodejs_db::Query::execute ( ) const throw (Exception&)
protectedvirtual

execute the SQL query

Definition at line 1293 of file query.cxx.

Here is the caller graph for this function:

v8::Handle< v8::Value > nodejs_db::Query::First ( const v8::Arguments &  args)
staticprotected

insert the FIRST projection clause

Parameters
[in]argsv8::Arguments&

Definition at line 381 of file query.cxx.

v8::Handle< v8::Value > nodejs_db::Query::Limit ( const v8::Arguments &  args)
staticprotected

insert the LIMIT projection clause in query

Parameters
[in]argsv8::Arguments&

Definition at line 334 of file query.cxx.

std::string nodejs_db::Query::parseQuery ( ) const throw (Exception&)
protectedvirtual

Parse the sql

Definition at line 1915 of file query.cxx.

Here is the caller graph for this function:

std::vector< std::string::size_type > nodejs_db::Query::placeholders ( std::string *  parsed) const throw (Exception&)
protectedvirtual

find the placeholders positions in the query

Definition at line 1819 of file query.cxx.

v8::Handle< v8::Value > nodejs_db::Query::Skip ( const v8::Arguments &  args)
staticprotected

insert SKIP projection clause into query

Parameters
[in]argsv8::Arguments&

Definition at line 411 of file query.cxx.

void nodejs_db::Query::uvExecute ( uv_work_t *  uvRequest)
staticprotected

uvExecute is responsible for executing the function and creating data. The data is then passed to uvExecuteFinished callback function for return

Definition at line 840 of file query.cxx.

Here is the call graph for this function:


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