Skip to main content

Module transaction

Module transaction 

Source
Expand description

SQL transactions

A transaction encapsulates all the mutable functionality provided by the SQL database, and allows for mutable operations to be combined into complex updates that affect the main database atomically. A transaction also provides all the immutable query functionality of a regular database connection, so that the updated state of the database can be queried midway through a transaction.

Macrosยง

impl_tuple_params ๐Ÿ”’

Structsยง

PoolMetrics ๐Ÿ”’
Prune
Marker type indicating a transaction used for pruning deletes.
Read
Marker type indicating a transaction with read-only access to the database.
Transaction
An atomic SQL transaction.
TransactionMetricsGuard ๐Ÿ”’
Write
Marker type indicating a transaction with read-write access to the database.

Enumsยง

CloseType ๐Ÿ”’

Staticsยง

NO_DEFERRABLE_ON_READ ๐Ÿ”’
When set to true, read transactions begin with SET TRANSACTION ISOLATION LEVEL SERIALIZABLE, READ ONLY (no DEFERRABLE), so they start immediately instead of waiting for a safe serializable snapshot.

Traitsยง

Executor
A type that contains or can provide a database connection to use for executing queries against the database.
FixedLengthParams
A collection of parameters with a statically known length.
Params
A collection of parameters which can be bound to a SQL query.
TransactionMode
Trait for marker types indicating what type of access a transaction has to the database.

Functionsยง

build_where_in
query
query_as
set_no_deferrable_on_read
Configure whether read transactions on Postgres should omit DEFERRABLE.

Type Aliasesยง

Query
QueryAs