本文整理汇总了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") });
};