use super::{PgPool, Uuid}; /// Insert a footnote on a post. Returns the footnote ID. #[tracing::instrument(skip_all)] pub async fn insert_footnote( pool: &PgPool, post_id: Uuid, author_id: Uuid, body_markdown: &str, body_html: &str, ) -> Result { sqlx::query_scalar!( "INSERT INTO post_footnotes (post_id, author_id, body_markdown, body_html) VALUES ($1, $2, $3, $4) RETURNING id", post_id, author_id, body_markdown, body_html, ) .fetch_one(pool) .await }