Skip to content

Commit

Permalink
fix: sql format
Browse files Browse the repository at this point in the history
  • Loading branch information
Pugma committed Oct 25, 2024
1 parent 05ffd45 commit 20a65f8
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions server/app/src/repo/words.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@ impl Repository {
`word`,
`word_uuid` AS `id`,
`register_time` AS `time`,
`excluded_users`.`trap_id` AS `excluded_users`
FROM `words` JOIN `excluded_users` ON `words`.`word_id` = `excluded_users`.`word_id`
WHERE `words`.`trap_id`=?",
`word_excluded_users`.`trap_id` AS `excluded_users`
FROM
`words`
JOIN
`word_excluded_users`
ON
`words`.`word_id` = `word_excluded_users`.`word_id`
WHERE
`words`.`trap_id`=?",
trap_id
)
.fetch_all(&self.pool)
Expand Down Expand Up @@ -104,9 +110,12 @@ impl Repository {
word_id: Uuid,
excluded_users: ExcludedUsers,
) -> Result<()> {
query!("DELETE FROM `excluded_users` WHERE `word_id` = ?", word_id,)
.execute(&self.pool)
.await?;
query!(
"DELETE FROM `word_excluded_users` WHERE `word_id` = ?",
word_id,
)
.execute(&self.pool)
.await?;

let mut query_builder =
QueryBuilder::<MySql>::new("INSERT INTO `excluded_users`(`word_id`, `trap_id`) ");
Expand Down

0 comments on commit 20a65f8

Please sign in to comment.