Methods
delete(query, params, callback) → {void}
Execute a delete query.
Parameters:
Name | Type | Description |
---|---|---|
query |
string | The SQL to execute. |
params |
Object | An object containing query parameters for the query. Each parameter will be preceded with a colon in query. |
callback |
QueryExecuter~mutateCallback | A callback function that is called after the query is executed. |
- Source:
Returns:
- Type
- void
insert(query, params, callback) → {void}
Execute an insert query.
Parameters:
Name | Type | Description |
---|---|---|
query |
string | The SQL to execute. |
params |
Object | An object containing query parameters for the query. Each parameter will be preceded with a colon in query. |
callback |
QueryExecuter~insertCallback | A callback function that is called after the query is executed. |
- Source:
Returns:
- Type
- void
select(query, params, callback) → {void}
Execute a select query.
Parameters:
Name | Type | Description |
---|---|---|
query |
string | The SQL to execute. |
params |
Object | An object containing query parameters for the query. Each parameter will be preceded with a colon in query. |
callback |
QueryExecuter~selectCallback | A callback function that is called after the query is executed. |
- Source:
Returns:
- Type
- void
update(query, params, callback) → {void}
Execute an update query.
Parameters:
Name | Type | Description |
---|---|---|
query |
string | The SQL to execute. |
params |
Object | An object containing query parameters for the query. Each parameter will be preceded with a colon in query. |
callback |
QueryExecuter~mutateCallback | A callback function that is called after the query is executed. |
- Source:
Returns:
- Type
- void
Type Definitions
insertCallback(error, result)
A callback function that is fired after an insert query is executed.
Parameters:
Name | Type | Description |
---|---|---|
error |
Error | An Error instance, or null if no error occurs. |
result |
Object | An object that has an insertId property that corresponds to the identifier of the newly inserted record, if available. |
- Source:
mutateCallback(error, result)
A callback function that is fired after an update or delete query is
executed.
Parameters:
Name | Type | Description |
---|---|---|
error |
Error | An Error instance, or null if no error occurs. |
result |
Object | An object that has an affectedRows property, indicating the number of rows affected (changed) by the query. |
- Source:
selectCallback(error, results)
A callback function that is fired after a select query is executed.
Parameters:
Name | Type | Description |
---|---|---|
error |
Error | An Error instance, or null if no error occurs. |
results |
Array.<Object> | An array of results, as objects, wherein each key corresonds to a column. |
- Source: