insert_props

Function insert_props 

Source
pub async fn insert_props(
    conn: &mut AsyncPgConnection,
    props: &DrawingVariantEntity,
) -> QueryResult<()>
Expand description

Insert properties for a newly created drawing.

Depending on the variant (Rectangle, Ellipse, LabelText, etc.), this inserts into the appropriate *_props table.

For complex shapes (FreeLine and BezierPolygon), this will:

  • Insert the props record into the main props table
  • Insert all associated point rows into the corresponding *_point table

ยงErrors

  • If p.drawing_id does not reference an existing drawing (FK violation)
  • If required fields in the props struct are missing or violate constraints