method Query.run
Executes the query; panics on a database failure.
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 })
for it in db.Item.query().run() {
print(it.name)
}
db.close()
}Вывод
tea
pub(api) fn run() -> List<T> dbСложность. O(rows returned) plus the cost of the query in the database.
С версии. 1.0.0-beta
Возвращает
List<T>
Эффекты
db
Определено в: std/orm/orm.oxl:947