interface
Transaction
Atomic document reads and mutations.
Properties
| Property | Type | Description |
|---|---|---|
Create | func(context.Context, | The Create value. |
Find | func(context.Context, | The Find value. |
List | func(context.Context, | The List value. |
ResolveFilteredSelection | func(context.Context, | The ResolveFilteredSelection value. |
Update | func(context.Context, | The Update value. |
Trash | func(context.Context, | The Trash value. |
Restore | func(context.Context, | The Restore value. |
Delete | func(context.Context, | The Delete value. |
ApplyReferenceDelete | func(context.Context, | ApplyReferenceDelete atomically plans incoming current-document references, rejects when any restrict policy matches, and otherwise nullifies/removes those values. Version snapshots remain immutable. |
DeleteDocumentState | func(context.Context, | DeleteDocumentState idempotently removes framework-owned database state where the document is either the target or the owning principal. |
DismissTaskForTarget | func(context.Context, | DismissTaskForTarget removes a queued, failed, or canceled target-scoped task in this document transaction. Running tasks remain lease-owned and cannot be reported as canceled while their handler may still commit work. |
Commit | func(context.Context) error | The Commit value. |
Rollback | func(context.Context) error | The Rollback value. |
Full signature
type Transaction interface {
Create(context.Context, CreateRequest) (Document, error)
Find(context.Context, Request) (Document, error)
List(context.Context, Request) (Page, error)
ResolveFilteredSelection(context.Context, FilteredSelectionRequest) (FilteredSelection, error)
Update(context.Context, UpdateRequest) (Document, error)
Trash(context.Context, Request) (Document, error)
Restore(context.Context, Request) (Document, error)
Delete(context.Context, Request) (Document, error)
// ApplyReferenceDelete atomically plans incoming current-document
// references, rejects when any restrict policy matches, and otherwise
// nullifies/removes those values. Version snapshots remain immutable.
ApplyReferenceDelete(context.Context, ReferenceDeleteRequest) error
// DeleteDocumentState idempotently removes framework-owned database state
// where the document is either the target or the owning principal.
DeleteDocumentState(context.Context, DocumentReference) error
// DismissTaskForTarget removes a queued, failed, or canceled target-scoped
// task in this document transaction. Running tasks remain lease-owned and
// cannot be reported as canceled while their handler may still commit work.
DismissTaskForTarget(context.Context, string, string, DocumentReference) error
Commit(context.Context) error
Rollback(context.Context) error
}