Skip to main content

Module tests

Module tests 

Source
Expand description

Test implementations

Modules§

batch_associations
Test batching association-scoped statements (create, query, update, delete) through toasty::batch().
batch_create_statements
batch_nested_create
batch_query
batch_query_dynamic
batch_rollback
batch_update_delete
clone_query
Test that generated query, create, and update structs implement Clone.
crud_basic
crud_batch_create
Test batch creation of models
crud_composite_key_in_list
crud_composite_key_pagination
Test pagination on composite-key models.
crud_create_macro
crud_driver_ops
crud_model_find_by_primary_key
crud_model_level_key
crud_option_filter
Test filtering models by Option fields using is_some() and is_none().
crud_partitioned
crud_query
Test querying models with various filters and constraints
crud_query_macro
crud_sort_limit
Test sorting and pagination of query results
crud_update_field_order
deferred_embed
deferred_field
dynamodb_update_batch_filter
Tests for the non-unique multi-key update path on DynamoDB.
embed_enum_data
embed_enum_filter
embed_enum_filter_comparison
embed_enum_filter_variant_field
embed_enum_index
embed_enum_native_ops
embed_enum_shared_type
embed_enum_string_discriminant
embed_enum_unit
embed_newtype
embed_struct
embed_struct_index
field_auto
field_column_name
field_column_type
field_default_and_update
field_version
field_version_newtype
filter_ilike
filter_like
float_fields
index_composite
index_custom_name
infra_connection_per_clone
infra_missing_registrations
infra_pool_config
infra_reset_db
infra_sync_send
key_unsigned
lift_belongs_to_complex_filter
Regression test for lift_belongs_to_in_subquery silently dropping filter constraints whose operands are neither side an Expr::Reference.
query_count
query_in_list
Tests for IN/NOT IN list filters.
raw_identifier_fields
record_not_found
relation_belongs_to_configured
relation_belongs_to_embed_key
relation_belongs_to_one_way
relation_belongs_to_self_referential
relation_chain
Chain relation methods on a Many handle to traverse multi-step associations without declaring a via relation on the schema.
relation_chain_composite_key
Chain relation methods on Many where one or more hops in the chain has a composite key. Parallels crate::tests::relation_chain which covers the all-single-key case.
relation_filter_association
Tests for filtering models by conditions on associated (HasOne, BelongsTo) fields.
relation_has_many_batch_create
relation_has_many_boxed_fk
relation_has_many_composite_key
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.
relation_has_many_crud
Test basic has_many associations without any preloading of associations during query time. All associations are accessed via queries on demand.
relation_has_many_filter
Test filtering parent models by conditions on has_many associations
relation_has_many_link_unlink
Test linking and unlinking has_many associations
relation_has_many_multi
Test has_many associations with multiple relations to the same model
relation_has_many_n_plus_1
Test N+1 query behavior with has_many associations
relation_has_many_same_target
Test has_many/belongs_to associations where multiple belongs_to fields on the same child model target the same parent model, disambiguated by #[has_many(pair = <field>)].
relation_has_many_scoped_query
Test scoped queries on has_many associations
relation_has_many_via
Multi-step (via) has_many relations: a has_many reached by following a path of existing relations rather than a single foreign key.
relation_has_one_crud
relation_preload
scan_no_index
select_projection
select_projection_belongs_to
.select(...) projection through a BelongsTo relation field.
select_projection_embed
.select(...) projection through embedded sub-fields. Field paths into an embed flow through the existing Path<T, U>: IntoExpr<U> chain, so no production code change is required for this case to work end-to-end; this file is the integration coverage.
select_projection_has_many
.select(...) projection through a HasMany relation field.
select_projection_has_one
.select(...) projection through a HasOne relation field.
starts_with
tx_atomic_stmt
tx_interactive
tx_lock_mode
type_bigdecimal
type_collection
Tests for Vec<scalar> model fields. Storage is backend-chosen (text[] on PostgreSQL, List L on DynamoDB, JSON on MySQL/SQLite — the JSON paths are future work). Backends without Vec<scalar> support are gated out at the #[driver_test] level via requires(vec_scalar); the negative schema-build path is covered by a dedicated requires(not(vec_scalar)) test.
type_decimal
type_jiff
type_primitives
type_serialize