Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Bit o cleanup and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
OmegaJak committed Oct 9, 2023
1 parent 55c3e3a commit db60470
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/database/models/thread_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ impl ThreadBuilder {
self.members.iter().map(|m| (thread_id.0, m.0)).unzip();
sqlx::query!(
"
INSERT INTO threads_members (
thread_id, user_id
)
SELECT * FROM UNNEST ($1::int8[], $2::int8[])
",
INSERT INTO threads_members (
thread_id, user_id
)
SELECT * FROM UNNEST ($1::int8[], $2::int8[])
",
&thread_ids[..],
&members[..],
)
Expand Down
10 changes: 5 additions & 5 deletions src/database/models/version_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl DependencyBuilder {
sqlx::query!(
"
INSERT INTO dependencies (dependent_id, dependency_type, dependency_id, mod_dependency_id, dependency_file_name)
SELECT * FROM UNNEST ($1::bigint[], $2::varchar[255][], $3::bigint[], $4::bigint[], $5::varchar[1024][])
SELECT * FROM UNNEST ($1::bigint[], $2::varchar[], $3::bigint[], $4::bigint[], $5::varchar[])
",
&version_ids[..],
&dependency_types[..],
Expand All @@ -96,8 +96,8 @@ impl DependencyBuilder {
} else if let Some(version_id) = self.version_id {
sqlx::query!(
"
SELECT mod_id FROM versions WHERE id = $1
",
SELECT mod_id FROM versions WHERE id = $1
",
version_id as VersionId,
)
.fetch_optional(&mut *transaction)
Expand Down Expand Up @@ -152,7 +152,7 @@ impl VersionFileBuilder {
sqlx::query!(
"
INSERT INTO files (id, version_id, url, filename, is_primary, size, file_type)
SELECT * FROM UNNEST($1::bigint[], $2::bigint[], $3::varchar[2048], $4::varchar[2048], $5::bool[], $6::integer[], $7::varchar[128])
SELECT * FROM UNNEST($1::bigint[], $2::bigint[], $3::varchar[], $4::varchar[], $5::bool[], $6::integer[], $7::varchar[])
",
&file_ids[..],
&version_ids[..],
Expand All @@ -176,7 +176,7 @@ impl VersionFileBuilder {
sqlx::query!(
"
INSERT INTO hashes (file_id, algorithm, hash)
SELECT * FROM UNNEST($1::bigint[], $2::varchar[255], $3::bytea[])
SELECT * FROM UNNEST($1::bigint[], $2::varchar[], $3::bytea[])
",
&file_ids[..],
&algorithms[..],
Expand Down

0 comments on commit db60470

Please sign in to comment.