mirror of
https://github.com/ent/ent.git
synced 2026-04-28 05:30:56 +03:00
doc: add warning for Unwrap (#4217)
* entc: document Unwrap with panic, doc: add warning for Unwrap * resolve feedback
This commit is contained in:
@@ -60,6 +60,11 @@ func rollback(tx *ent.Tx, err error) error {
|
||||
|
||||
You must call `Unwrap()` if you are querying edges off of a created entity after a successful transaction (example: `a8m.QueryGroups()`). Unwrap restores the state of the underlying client embedded within the entity to a non-transactable version.
|
||||
|
||||
:::warning Note
|
||||
Calling `Unwrap()` on a non-transactional entity (i.e., after a transaction has been committed or rolled back) will
|
||||
cause a panic.
|
||||
:::
|
||||
|
||||
The full example exists in [GitHub](https://github.com/ent/ent/tree/master/examples/traversal).
|
||||
|
||||
## Transactional Client
|
||||
|
||||
Reference in New Issue
Block a user