You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let total_count_params = (where_clauses.clone(), params.clone());
100
123
101
-
pool
124
+
let channels = pool
102
125
.run(move |connection| {
103
126
asyncmove{
104
127
// To understand why we use Order by, see Postgres Documentation: https://www.postgresql.org/docs/8.1/queries-limit.html
105
-
let statement = format!("SELECT id, creator, deposit_asset, deposit_amount, valid_until, spec FROM channels WHERE {} ORDER BY id DESC LIMIT {} OFFSET {}", where_clauses.join(" AND "), limit, skip);
128
+
let statement = format!("SELECT id, creator, deposit_asset, deposit_amount, valid_until, spec FROM channels WHERE {} ORDER BY spec->>'created' DESC LIMIT {} OFFSET {}", where_clauses.join(" AND "), limit, skip);
106
129
match connection.prepare(&statement).await{
107
130
Ok(stmt) => {
108
131
match connection.query(&stmt, params.as_slice()).await{
0 commit comments