OxL Справочник OxL
РусскийEnglish

enum DbErrorKind

Why a database operation failed.

Example:

oxl✓ проверяется в CI
fn advice(k: DbErrorKind) -> str {
  match k {
    .Conflict => "the key exists"
    .NotFound => "no such row"
    .Busy => "retry"
    .Other => "give up"
    .CrossShardTx => "keep a transaction on one shard"
  }
}

fn main() io {
  print(advice(DbErrorKind.Busy))
}
Вывод
retry
pub(api) enum DbErrorKind

С версии. 1.0.0-beta

Варианты

Conflict

A duplicate key or a violated unique index.

NotFound

An update or delete of a row that does not exist.

Busy

Locked by another connection, or a transaction to retry after a leader change.

Other

Any other failure.

CrossShardTx

A transaction touched rows of two shards.

Определено в: std/core/types.oxl:280

См. также