Use the loopback-connector module to build a LoopBack connector to back-end data sources such as databases or web services. There are many existing connectors for the most popular data sources; see:
To build a new data source connector that doesn't yet exist, please see [Building a connector for a relational database] (http://docs.strongloop.com/display/LB/Building+a+connector+for+a+relational+database).
A class for parameterized SQL clauses
Name | Type | Description |
---|---|---|
sql |
String or Object
|
The SQL clause. If the value is a string, treat it as the template using |
params |
Array.<*>
|
An array of parameter values. The length should match the number of placeholders in the template |
Name | Type | Description |
---|---|---|
result |
ParameterizedSQL
|
A new instance of ParameterizedSQL |
Merge the parameterized sqls into the current instance
Name | Type | Description |
---|---|---|
ps |
Object or Array.<Object>
|
A parametered SQL or an array of parameterized SQLs |
[separator] |
String
|
Separator, default to |
Name | Type | Description |
---|---|---|
result |
ParameterizedSQL
|
The current instance |
Append the statement into the current statement
Name | Type | Description |
---|---|---|
currentStmt |
Object
|
The current SQL statement |
stmt |
Object
|
The statement to be appended |
[separator] |
String
|
Separator, default to |
Name | Type | Description |
---|---|---|
result |
|
The merged statement |
Join multiple parameterized SQLs into one
Name | Type | Description |
---|---|---|
sqls |
Array.<Object>
|
An array of parameterized SQLs |
[separator] |
String
|
Separator, default to |
Name | Type | Description |
---|---|---|
result |
ParameterizedSQL
|