mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-03 17:08:13 +00:00
LIMIT on sentences query
This commit is contained in:
1 parent
2cc5ea67ba
commit
a862124dc5
1 file changed
+2
-1
@@ -37,7 +37,8 @@ impl Sentence {
|
||||
|
||||
pub fn load(db_connector: &DatabaseConnector, limit: i64) -> AnyhowResult<Vec<Sentence>> {
|
||||
let pooled_connection : MysqlPooledConnection = db_connector.get_pooled_connection()?;
|
||||
let results = sentences::table
|
||||
let results = sentences::dsl::sentences
|
||||
.limit(limit)
|
||||
.load::<Sentence>(&pooled_connection)?;
|
||||
Ok(results)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user