---
source: tests/codegen.rs
expression: code
---
// Code generated by sqlc-gen-sqlx v[VERSION]. DO NOT EDIT.
// sqlc version: [VERSION]
#![allow(dead_code, reason = "generated queries may expose items a caller does not use")]
const DELETE_AUTHOR_ROWS: &str = "DELETE FROM authors WHERE id = $1";
pub struct Queries<E> {
db: E,
}
impl<E> Queries<E> {
pub fn new(db: E) -> Self {
Self { db }
}
}
impl<E> Queries<E>
where
for<'c> &'c mut E: sqlx::Executor<'c, Database = sqlx::Postgres>,
{
pub async fn delete_author_rows(&mut self, id: i64) -> Result<u64, sqlx::Error> {
let result = sqlx::query(DELETE_AUTHOR_ROWS)
.bind(id)
.execute(&mut self.db)
.await?;
Ok(result.rows_affected())
}
}