interface

Transaction

Atomic document reads and mutations.

Properties

PropertyTypeDescription
Createfunc(context.Context, CreateRequest) (Document, error)The Create value.
Findfunc(context.Context, Request) (Document, error)The Find value.
Listfunc(context.Context, Request) (Page, error)The List value.
ResolveFilteredSelectionfunc(context.Context, FilteredSelectionRequest) (FilteredSelection, error)The ResolveFilteredSelection value.
Updatefunc(context.Context, UpdateRequest) (Document, error)The Update value.
Trashfunc(context.Context, Request) (Document, error)The Trash value.
Restorefunc(context.Context, Request) (Document, error)The Restore value.
Deletefunc(context.Context, Request) (Document, error)The Delete value.
ApplyReferenceDeletefunc(context.Context, ReferenceDeleteRequest) errorApplyReferenceDelete atomically plans incoming current-document references, rejects when any restrict policy matches, and otherwise nullifies/removes those values. Version snapshots remain immutable.
DeleteDocumentStatefunc(context.Context, DocumentReference) errorDeleteDocumentState idempotently removes framework-owned database state where the document is either the target or the owning principal.
DismissTaskForTargetfunc(context.Context, string, string, DocumentReference) errorDismissTaskForTarget 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.
Commitfunc(context.Context) errorThe Commit value.
Rollbackfunc(context.Context) errorThe 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 }

Source store/store.go:643