forked from lavina/lavina
Implement limit
This commit is contained in:
parent
b0789d5457
commit
1e8a183d6c
|
@ -34,6 +34,9 @@ impl Storage {
|
|||
let mut executor = self.conn.lock().await;
|
||||
let res = sqlx::query_as(
|
||||
"
|
||||
select
|
||||
*
|
||||
from (
|
||||
select
|
||||
messages.id as id,
|
||||
content,
|
||||
|
@ -47,10 +50,12 @@ impl Storage {
|
|||
where
|
||||
room_id = ?
|
||||
order by
|
||||
messages.id
|
||||
limit ?;
|
||||
messages.id desc
|
||||
limit ?
|
||||
)
|
||||
order by
|
||||
id asc;
|
||||
",
|
||||
// todo: implement limit
|
||||
)
|
||||
.bind(room_id)
|
||||
.bind(limit)
|
||||
|
|
Loading…
Reference in New Issue