Expand description
Tests for has_many / belongs_to relationships whose foreign key spans
multiple columns. These parallel the single-key relation tests so we can
make sure composite-key behavior matches.
Two scenarios are used:
crate::scenarios::composite_has_many_belongs_to—Userwith a single-column auto PK and aTodowhose PK is#[key(partition = user_id, local = id)]. The FK column is part of the child’s identity, so reassignment isn’t supported on backends that can’t mutate primary-key columns (DynamoDB).crate::scenarios::composite_fk_has_many_belongs_to—Userwith a composite PK(id, revision), andTodowith single PK and a two-column indexed FK. Used by the reassignment tests, which need the FK to be a plain updatable column.
See: https://github.com/tokio-rs/toasty/discussions/904
Modules§
- composite_
add_ remove_ multiple_ relation_ option_ belongs_ to - composite_
add_ remove_ single_ relation_ required_ belongs_ to - composite_
assign_ todo_ to_ user_ on_ update_ query - composite_
basic_ has_ many_ and_ belongs_ to_ preload - composite_
belongs_ to_ required - composite_
crud_ has_ one_ required - composite_
crud_ user_ todos - composite_
delete_ when_ belongs_ to_ optional - composite_
filter_ by_ belongs_ to_ field - composite_
filter_ parent_ by_ child_ field - composite_
has_ many_ insert_ on_ update - composite_
nested_ has_ many_ then_ belongs_ to_ required - composite_
preload_ has_ many_ with_ optional_ belongs_ to - composite_
preload_ on_ empty_ query - composite_
remove_ add_ single_ relation_ option_ belongs_ to - composite_
scoped_ find_ by_ id - composite_
select_ belongs_ to_ basic - composite_
user_ batch_ create_ todos_ one_ level - composite_
user_ batch_ create_ todos_ with_ optional_ field - composite_
user_ batch_ create_ two_ todos_ simple
Functions§
- composite_
assign_ existing_ user_ to_ todo - composite_
assign_ todo_ that_ already_ has_ user_ on_ create - composite_
assign_ todo_ that_ already_ has_ user_ on_ update - composite_
associate_ new_ user_ with_ todo_ on_ update_ query_ via_ creation - composite_
associate_ new_ user_ with_ todo_ on_ update_ via_ creation - composite_
belongs_ to_ missing_ index_ is_ error - When a composite-key
belongs_tohas no covering index on the parent side, schema verification must return a helpful invalid-schema error rather than panicking withfailed to find relation index. - composite_
reassign_ relation_ required_ belongs_ to