File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
frameworks/Rust/axum/src/common Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,9 @@ pub const SELECT_WORLD_BY_ID: &str =
1717pub const SELECT_ALL_CACHED_WORLDS : & str =
1818 "SELECT id, randomnumber FROM world ORDER BY id" ;
1919#[ allow( dead_code) ]
20- pub const UPDATE_WORLDS : & str = "WITH vals AS (SELECT * FROM UNNEST($1::int[], $2::int[]) AS v(id, rnum))
21- UPDATE world SET randomnumber = new.rnum FROM
22- (SELECT w.id, v.rnum FROM world w INNER JOIN vals v ON v.id = w.id ORDER BY w.id FOR UPDATE) AS new
23- WHERE world.id = new.id" ;
20+ pub const UPDATE_WORLDS : & str = r#"UPDATE world SET randomnumber = new.rnum FROM
21+ (SELECT * FROM UNNEST($1::int[], $2::int[]) AS v(id, rnum)) AS new
22+ WHERE world.id = new.id"# ;
2423
2524/// Return the value of an environment variable.
2625#[ allow( dead_code) ]
@@ -48,4 +47,4 @@ pub fn random_ids(rng: &mut SmallRng, count: usize) -> Vec<i32> {
4847 rng. sample_iter ( Uniform :: new ( 1 , 10_001 ) )
4948 . take ( count)
5049 . collect ( )
51- }
50+ }
You can’t perform that action at this time.
0 commit comments