feat: ✨ read_all for post, post_interaction, comment_interaction, comment
This commit is contained in:
parent
dca2abb62a
commit
1aa1d8cb1e
4 changed files with 60 additions and 0 deletions
|
@ -72,3 +72,18 @@ pub async fn delete(
|
|||
.fetch_one(database_connection)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn read_all(
|
||||
post_creation_time: DateTime<Utc>,
|
||||
database_connection: &Pool<Postgres>,
|
||||
) -> Result<Vec<Comment>, sqlx::Error> {
|
||||
sqlx::query_as!(
|
||||
Comment,
|
||||
r#"
|
||||
SELECT * FROM "comment" WHERE "post_creation_time" = $1
|
||||
"#,
|
||||
post_creation_time
|
||||
)
|
||||
.fetch_all(database_connection)
|
||||
.await
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue