method Db.count
Number of rows of the table: db.count(User).
Example:
use std.orm { Db }
@table("items")
data Item { @pk @auto id: i64; name: str }
fn main() io, db {
let db = Db.open("sqlite::memory:")!
db.insert(Item{ id: 0, name: "a" })
db.insert(Item{ id: 0, name: "b" })
print("{db.count(Item)}")
}Вывод
2
pub(api) fn count<T>() -> i64 dbС версии. 1.0.0-beta
Возвращает
i64
Эффекты
db
Определено в: std/orm/orm.oxl:538