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
Copy file name to clipboardExpand all lines: sentry/src/db/channel.rs
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ pub async fn get_channel_by_id(
14
14
pool
15
15
.run(move |connection| {
16
16
asyncmove{
17
-
match connection.prepare("SELECT id, creator, deposit_asset, deposit_amount, valid_until, spec FROM channels WHERE id = $1 LIMIT 1").await{
17
+
match connection.prepare("SELECT id, creator, deposit_asset, deposit_amount, valid_until, targeting_rules, spec FROM channels WHERE id = $1 LIMIT 1").await{
18
18
Ok(select) => match connection.query(&select,&[&id]).await{
let validator = serde_json::Value::from_str(&format!(r#"[{{"id": "{}"}}]"#, validator_id)).expect("Not a valid json");
38
-
let query = "SELECT id, creator, deposit_asset, deposit_amount, valid_until, spec FROM channels WHERE id = $1 AND spec->'validators' @> $2 LIMIT 1";
38
+
let query = "SELECT id, creator, deposit_asset, deposit_amount, valid_until, targeting_rules, spec FROM channels WHERE id = $1 AND spec->'validators' @> $2 LIMIT 1";
39
39
match connection.prepare(query).await{
40
40
Ok(select) => {
41
41
match connection.query(&select,&[&id,&validator]).await{
@@ -57,8 +57,8 @@ pub async fn insert_channel(
57
57
pool
58
58
.run(move |connection| {
59
59
asyncmove{
60
-
match connection.prepare("INSERT INTO channels (id, creator, deposit_asset, deposit_amount, valid_until, spec) values ($1, $2, $3, $4, $5, $6)").await{
61
-
Ok(stmt) => match connection.execute(&stmt,&[&channel.id,&channel.creator,&channel.deposit_asset,&channel.deposit_amount,&channel.valid_until,&channel.spec]).await{
60
+
match connection.prepare("INSERT INTO channels (id, creator, deposit_asset, deposit_amount, valid_until, targeting_rules, spec) values ($1, $2, $3, $4, $5, $6, $7)").await{
61
+
Ok(stmt) => match connection.execute(&stmt,&[&channel.id,&channel.creator,&channel.deposit_asset,&channel.deposit_amount,&channel.valid_until,&channel.targeting_rules,&channel.spec]).await{
62
62
Ok(row) => {
63
63
let inserted = row == 1;
64
64
Ok((inserted, connection))
@@ -138,7 +138,7 @@ mod list_channels {
138
138
.run(move |connection| {
139
139
asyncmove{
140
140
// To understand why we use Order by, see Postgres Documentation: https://www.postgresql.org/docs/8.1/queries-limit.html
141
-
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);
141
+
let statement = format!("SELECT id, creator, deposit_asset, deposit_amount, valid_until, targeting_rules, spec FROM channels WHERE {} ORDER BY spec->>'created' DESC LIMIT {} OFFSET {}", where_clauses.join(" AND "), limit, skip);
142
142
match connection.prepare(&statement).await{
143
143
Ok(stmt) => {
144
144
match connection.query(&stmt, params.as_slice()).await{
0 commit comments