OxL Reference

method Db.commit

Commits the open transaction.

Example:

oxl✓ checked in CI
use std.orm { Db }

@table("items")
data Item { @pk id: i64; name: str }

fn main() io, db {
  let db = Db.open("sqlite::memory:")!
  db.begin()!
  db.insert(Item{ id: 1, name: "a" })
  db.commit()!
  print("{db.count(Item)}")
}
Output
1
pub(api) fn commit() -> () | DbError  db

Since. 1.0.0-beta

Returns

()

Errors

Effects

db

Defined in: std/orm/orm.oxl:642

See also