type DbError
A failed database operation: kind (Conflict, NotFound, Busy, Other, CrossShardTx) and msg.
Example:
use std.orm { Db }
@table("items")
data Item {
@pk id: i64
name: str
price: i64
}
fn main() io, db {
let db = Db.open("sqlite::memory:")!
db.insert(Item{ id: 1, name: "tea", price: 3 })
match db.tryInsert(Item{ id: 1, name: "again", price: 4 }) {
DbError e => print("{e.kind == DbErrorKind.Conflict}")
_ => print("stored twice")
}
db.close()
}Output
true
pub(api) type DbError = std.core.DbErrorSince. 1.0.0-beta
Methods
show | () -> strThe error as text |
Defined in: std/orm/orm.oxl:237