當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript knex.from函數代碼示例

本文整理匯總了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});
};
開發者ID:AugurProject,項目名稱:augur_node,代碼行數:3,代碼來源:20180725142500_ipc_orphan_fix.ts

示例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; });
開發者ID:AugurProject,項目名稱:augur_node,代碼行數:3,代碼來源:20180716140300_orphaned_orders.ts

示例3: async

 return async (db: Knex) => {
   await db.from("crowdsourcer_redeemed").where({ transactionHash: log.transactionHash, logIndex: log.logIndex }).del();
   augurEmitter.emit(SubscriptionEventNames.FeeWindowRedeemed, log);
 };
開發者ID:AugurProject,項目名稱:augur_node,代碼行數:4,代碼來源:crowdsourcer.ts

示例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();
 };
開發者ID:AugurProject,項目名稱:augur_node,代碼行數:5,代碼來源:fee-window-created.ts

示例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);
 };
開發者ID:AugurProject,項目名稱:augur_node,代碼行數:6,代碼來源:trading-proceeds-claimed.ts

示例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();
 };
開發者ID:AugurProject,項目名稱:augur_node,代碼行數:5,代碼來源:approval.ts

示例7: async

 return async (db: Knex) => {
   await db.from("orders").where("orderId", log.orderId).delete();
   augurEmitter.emit(SubscriptionEventNames.OrderCreated, log);
 };
開發者ID:AugurProject,項目名稱:augur_node,代碼行數:4,代碼來源:order-created.ts

示例8: async

 return async (db: Knex) => {
   await db.from("initial_reports").where("marketId", log.market).update({ redeemed: true });
   augurEmitter.emit(SubscriptionEventNames.InitialReporterRedeemed, log);
 };
開發者ID:AugurProject,項目名稱:augur_node,代碼行數:4,代碼來源:initial-report-redeemed.ts

示例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") });
 };
開發者ID:AugurProject,項目名稱:augur_node,代碼行數:6,代碼來源:market-participants-disavowed.ts


注:本文中的knex.from函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。