Namespace DB.sqlHandler
DB.sqlHandler works similar to a SQL prepared statement in that the query is not executed unless explicitly called. It should not be created explicitly; rather, use DB.sql to generate a new sqlHandler object
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
DB.sqlHandler.execute()
execute the SQL prepared statement returned by getsql()
|
<static> |
DB.sqlHandler.filter(conditions)
add additional Conditions to the SQL statement
|
<static> |
DB.sqlHandler.getsql()
return the constructed SQL prepared statement
|
<static> |
DB.sqlHandler.include(field_name)
specify additional SELECT fields to the SQL statement
|
<static> |
DB.sqlHandler.limit(offset_limit)
add an offset,limit tuple to the SQL statement
|
<static> |
DB.sqlHandler.sort(sort)
add an ORDER BY clause to the SQL statement
|
Method Detail
<static>
{Array}
DB.sqlHandler.execute()
execute the SQL prepared statement returned by getsql()
- Returns:
- {Array} the entries returned by the query
- See:
- DB.sql
<static>
DB.sqlHandler.filter(conditions)
add additional Conditions to the SQL statement
<? var handler = DB.sql('SELECT supporter_KEY FROM supporter') .filter(new Condition('Email','=','email@example.com')); ?>
- Parameters:
- {Conditions[]} conditions
- add WHERE conditions.
<static>
{String}
DB.sqlHandler.getsql()
return the constructed SQL prepared statement
- Returns:
- {String} the SQL statement as a String object
<static>
{DB.sqlHandler}
DB.sqlHandler.include(field_name)
specify additional SELECT fields to the SQL statement
<? var handler = DB.sql('SELECT supporter_KEY FROM supporter') .include('Email', 'Source_Details'); ?>
- Parameters:
- {String} field_name
- field to include
- Returns:
- {DB.sqlHandler}
- See:
- DB.sql
<static>
{DB.sqlHandler}
DB.sqlHandler.limit(offset_limit)
add an offset,limit tuple to the SQL statement
<? var handler = DB.sql('SELECT supporter_KEY FROM supporter') .limit("50,100"); ?>
- Parameters:
- {string} offset_limit
- the limit param is in the format "offset, limit"
- Returns:
- {DB.sqlHandler}
<static>
{DB.sqlHandler}
DB.sqlHandler.sort(sort)
add an ORDER BY clause to the SQL statement
<? var handler = DB.sql('SELECT supporter_KEY FROM supporter') .sort('supporter_KEY DESC'); ?>
- Parameters:
- sort
- Returns:
- {DB.sqlHandler}