InstanceMethods
setLocalDatabase(DBInst) -> QueryLimited
引数:
Name |
Type |
Description |
DBInst |
Object |
cordova-sqlite-storageプラグインのsqlitePlugin.openDatabase()で生成されたインスタンス |
Return:
Type: QueryLimited
valuesIn(columnName, values) -> QueryLimited
引数:
Name |
Type |
Description |
columnName |
String |
カラム名 |
values |
Array |
検索対象の値の配列 |
Return:
Type: QueryLimited
Example
ModelA.downlink()
.valuesIn('columnA', ['1234','abcd'])
.execute()
.then((result)=>{
console.log(result);
});
where(query, params) -> QueryLimited
引数:
Name |
Type |
Description |
query |
String |
検索条件 |
params |
Array |
検索条件のパラメータ |
Return:
Type: QueryLimited
Example
ModelA.downlink()
.where('columnA=?',["1234"])
.execute()
.then((result)=>{
console.log(result);
});
where(expression) -> QueryLimited
引数:
Return:
Type: QueryLimited
join(modelClass, query, params) -> QueryLimited
引数:
Name |
Type |
Description |
modelClass |
Model |
JOINするモデルクラス |
query |
String |
JOIN条件、検索条件 |
params |
Array |
検索条件 |
Return:
Type: QueryLimited
Example
ModelA.downlink()
.join(ModelB, "#ModelA.id=#ModelB.modelA_id and #ModelB.columnB=?", ["abcd"])
.where('#ModelA.columnA=?', ['1234'])
.execute()
.then((result) => {
console.log(result);
});
join(modelClass, expression) -> QueryLimited
引数:
Return:
Type: QueryLimited
orderBy(columnName, order) -> QueryLimited
引数:
Name |
Type |
Description |
columnName |
String |
ソート基準カラム名 |
order |
Order |
ソート順 |
Return:
Type: QueryLimited
Example
ModelA.downlink()
.orderBy("columnA", AppPot.Model.Order.desc)
.execute()
.then((result) => {
console.log(result);
});
limit(limit, offset) -> QueryLimited
引数:
Name |
Type |
Description |
limit |
Number |
検索件数 |
offset |
(optional) Number |
検索開始インデックス |
Return:
Type: QueryLimited
Example
ModelA.downlink()
.limit(10, 20)
.execute()
.then((result) => {
console.log(result);
});
resetQuery() -> QueryLimited
Return:
Type: QueryLimited
execute() -> Promise
Return:
Type: Promise