Migrated from halcyonnouveau/clorinde#82, originally reported by @Folyd on 2025-04-01.
For example:
--! add_category
INSERT INTO
product_categories (product_id, category_id)
VALUES
(:product_id, :category_id) ON CONFLICT DO NOTHING;
--! remove_category
DELETE FROM
product_categories
WHERE
product_id = :product_id
AND category_id = :category_id;
This is the generated code, they can be unified into one params struct.
#[derive(Clone, Copy, Debug)]
pub struct AddCategoryParams {
pub product_id: i32,
pub category_id: i32,
}
#[derive(Clone, Copy, Debug)]
pub struct RemoveCategoryParams {
pub product_id: i32,
pub category_id: i32,
}
For example:
This is the generated code, they can be unified into one params struct.