fix: rename get_person to get_or_create_person and key duplication when saving person #175

Merged
realaravinth merged 3 commits from fix-164 into master 2025-10-06 16:53:43 +05:30
Owner

closes #164

closes #164
First-time contributor

LGTM. But Woodpecker falls over src/federation/adapter/out/db/postgres/save_person.rs:18:9

error: set `DATABASE_URL` to use query macros online, or run `cargo sqlx prepare` to update the query cache
  --> src/federation/adapter/out/db/postgres/save_person.rs:18:9
   |
18 | /         sqlx::query_as!(
19 | |             InternalPerson,
20 | |             "INSERT INTO persons 
21 | |                 (username, html_url, profile_photo, public_key, private_key, name, actor_id, preferred_username)
...  |
32 | |             person.preferred_username()
33 | |         )
   | |_________^
   |
   = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_as` (in Nightly builds, run with -Z macro-backtrace for more info)

Did it run locally?

LGTM. But Woodpecker falls over `src/federation/adapter/out/db/postgres/save_person.rs:18:9` ``` error: set `DATABASE_URL` to use query macros online, or run `cargo sqlx prepare` to update the query cache --> src/federation/adapter/out/db/postgres/save_person.rs:18:9 | 18 | / sqlx::query_as!( 19 | | InternalPerson, 20 | | "INSERT INTO persons 21 | | (username, html_url, profile_photo, public_key, private_key, name, actor_id, preferred_username) ... | 32 | | person.preferred_username() 33 | | ) | |_________^ | = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query_as` (in Nightly builds, run with -Z macro-backtrace for more info) ``` Did it run locally?
fix: sqlx offline compilation
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
ad2db98913
Author
Owner

My bad, had to run make db.sqlx.offline before pushing changes. Rust thing --- sqlx checks SQL stuff at compile time 😅

My bad, had to run `make db.sqlx.offline` before pushing changes. Rust thing --- sqlx checks SQL stuff at compile time 😅
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ForgeFlux/ForgeFlux!175
No description provided.