本文整理匯總了TypeScript中knex.from函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript from函數的具體用法?TypeScript from怎麽用?TypeScript from使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了from函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: async
exports.up = async (knex: Knex): Promise<any> => {
return knex.from("orders").whereNotIn("orderId", KNOWN_ORPHANED_ORDERS).update({orphaned: false});
};
示例2:
if (!exists) knex.schema.table("orders", (t) => t.boolean("orphaned").defaultTo(0)).then(() => {
return knex.from("orders").whereIn("orderId", KNOWN_ORPHANED_ORDERS).update({orphaned: true});
}).catch((e) => { throw e; });
示例3: async
return async (db: Knex) => {
await db.from("crowdsourcer_redeemed").where({ transactionHash: log.transactionHash, logIndex: log.logIndex }).del();
augurEmitter.emit(SubscriptionEventNames.FeeWindowRedeemed, log);
};
示例4: async
return async (db: Knex) => {
augurEmitter.emit(SubscriptionEventNames.FeeWindowCreated, log);
await db.from("fee_windows").where({ feeWindow: log.feeWindow }).del();
return db("tokens").where("contractAddress", log.feeWindow).orWhere("feeWindow", log.feeWindow).del();
};
示例5: async
return async (db: Knex) => {
await db.from("trading_proceeds").where({ transactionHash: log.transactionHash, logIndex: log.logIndex }).del();
await db.from("wcl_profit_loss_timeseries").where({ transactionHash: log.transactionHash }).del();
await updateProfitLossRemoveRow(db, log.transactionHash);
augurEmitter.emit(SubscriptionEventNames.TradingProceedsClaimed, log);
};
示例6: async
return async (db: Knex) => {
const eventName = log.eventName as keyof typeof SubscriptionEventNames;
augurEmitter.emit(SubscriptionEventNames[eventName], log);
return db.from("approvals").where({ transactionHash: log.transactionHash, logIndex: log.logIndex }).del();
};
示例7: async
return async (db: Knex) => {
await db.from("orders").where("orderId", log.orderId).delete();
augurEmitter.emit(SubscriptionEventNames.OrderCreated, log);
};
示例8: async
return async (db: Knex) => {
await db.from("initial_reports").where("marketId", log.market).update({ redeemed: true });
augurEmitter.emit(SubscriptionEventNames.InitialReporterRedeemed, log);
};
示例9: async
return async (db: Knex) => {
await db.update({
needsDisavowal: db.raw("needsDisavowal - 1"),
}).into("markets").where("marketId", log.market);
return db.from("crowdsourcers").where("marketId", log.market).update({ disavowed: db.raw("disavowed + 1") });
};