Discuz! Board

 找回密碼
 立即註冊
搜索
熱搜: 活動 交友 discuz
查看: 1|回復: 0

This returns a new extended client

[複製鏈接]

1

主題

1

帖子

5

積分

新手上路

Rank: 1

積分
5
發表於 2023-12-31 13:37:43 | 顯示全部樓層 |閱讀模式
Integrate them natively. Using Client Side Extensions To use client side extensions you need to first enable the preview feature in the schema file and then you can call the method on the client instance. instance without modifying the original instance. You can chain calls to use multiple extensions and create separate instances with different extensions. The components of an extension can contain four different types of components. Model components allow you to add new methods to the model. This is a convenient way to add new actions next to default methods such as etc. You can use it as a repository for common query methods to encapsulate the business logic of your model or to perform any operation you might perform using static methods on a class. The next example combines the methods shown in the input validation and conversion.

Field examples to provide static and runtime types for fields. It uses parsed field data and infers static types. This example includes a model with profile fields. The model has a sparse structure that m photo editing servies ay vary from user to user. This extension has two parts that add calculated fields to the extension. This field uses a schema to resolve the underlying untyped field. Static data types are inferred from the parser so query results have static and runtime type safety. An extension for parsing input data fields for model write methods such as and . View the sample code Sample Query Logging This sample shows how to use client extensions to perform tasks similar to middleware. In this example the extension tracks the time it takes to complete each query and logs the results along with the query and parameters themselves.



This technique can be used to perform generic logging to emit events to track usage, etc. NOTE You may be interested in the Tracking and Metrics features, which are both in preview and provide detailed insights into performance and how you interact with your database. View the sample code Example Retrying a Transaction This example demonstrates how to use the client extension to automatically retry a transaction that fails due to a write conflict deadlock timeout. Failed transactions will be retried with exponential backoff and jitter to reduce contention under heavy traffic. View the sample code Example Interactive Transaction Without Callbacks This example shows the client extension which adds a new one for.  



回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

Archiver|手機版|自動贊助|m

GMT+8, 2024-11-29 00:52 , Processed in 0.031800 second(s), 19 queries .

抗攻擊 by GameHost X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回復 返回頂部 返回列表
一粒米 | 中興米 | 論壇美工 | 設計 抗ddos | 天堂私服 | ddos | ddos | 防ddos | 防禦ddos | 防ddos主機 | 天堂美工 | 設計 防ddos主機 | 抗ddos主機 | 抗ddos | 抗ddos主機 | 抗攻擊論壇 | 天堂自動贊助 | 免費論壇 | 天堂私服 | 天堂123 | 台南清潔 | 天堂 | 天堂私服 | 免費論壇申請 | 抗ddos | 虛擬主機 | 實體主機 | vps | 網域註冊 | 抗攻擊遊戲主機 | ddos |