Skip to main content

Module index_composite

Module index_composite 

Source

Functionsยง

composite_index_basic
Basic composite index: model-level #[index(field_a, field_b)] creates a two-column index on SQL and a GSI (hash + range key) on DynamoDB.
composite_index_max_attributes
Maximum attribute boundary: #[index(partition = [f1, f2, f3, f4], local = [f5, f6, f7, f8])] (DDB-only).
composite_index_multi_hash
Multi-attribute partition key: #[index(partition = [a, b], local = [c])] creates a GSI with 2 HASH + 1 RANGE attributes (DDB-only).
composite_index_multi_range
Multi-attribute sort key: #[index(partition = [a], local = [b, c])] creates a GSI with 1 HASH + 2 RANGE attributes (DDB-only).
composite_index_multiple_indexes
Multiple indexes on the same model: verifies the query planner selects the correct index when a model defines two #[index] attributes (cross-driver).
composite_index_prefix_queries
Two-column index generates prefix query methods for each valid column prefix (cross-driver).
composite_index_simple_three_column_ddb
Three-column simple-mode index on DynamoDB: #[index(country, city, zip_code)] (DDB-only).
composite_index_sort_key_range_filter
Range filter chained onto a composite index partition query (cross-driver).
composite_index_struct_level
Struct-level #[index(field)] is equivalent to field-level #[index] (cross-driver).
composite_index_three_columns
Three-column composite index on SQL: #[index(country, city, zip_code)] (SQL-only).
composite_index_too_many_range_columns
Error condition: more than 4 RANGE columns in simple-mode index (DDB-only).
composite_unique_index_enforced
Struct-level #[unique(field_a, field_b)] enforces uniqueness across the combination of columns rather than each column individually (SQL-only).
composite_unique_index_unsupported_on_dynamodb
DynamoDB does not support composite (multi-column) unique indices: backing a composite unique constraint would require a composite-key index table plus matching write synchronization, which is not implemented. Schema setup must surface a clean unsupported_feature error rather than panicking (DDB-only).