()
| 129 | |
| 130 | #[tokio::test] |
| 131 | async fn scan_with_select_count() { |
| 132 | let c = client(); |
| 133 | let table = format!("ScanCount_{}", ts()); |
| 134 | c.create_table() |
| 135 | .table_name(&table) |
| 136 | .key_schema( |
| 137 | KeySchemaElement::builder() |
| 138 | .attribute_name("pk") |
| 139 | .key_type(KeyType::Hash) |
| 140 | .build() |
| 141 | .unwrap(), |
| 142 | ) |
| 143 | .attribute_definitions( |
| 144 | AttributeDefinition::builder() |
| 145 | .attribute_name("pk") |
| 146 | .attribute_type(ScalarAttributeType::S) |
| 147 | .build() |
| 148 | .unwrap(), |
| 149 | ) |
| 150 | .billing_mode(BillingMode::PayPerRequest) |
| 151 | .send() |
| 152 | .await |
| 153 | .unwrap(); |
| 154 | wait_for_active(c, &table).await; |
| 155 | |
| 156 | for i in 0..4 { |
| 157 | c.put_item() |
| 158 | .table_name(&table) |
| 159 | .item("pk", s(&format!("item_{i}"))) |
| 160 | .send() |
| 161 | .await |
| 162 | .unwrap(); |
| 163 | } |
| 164 | |
| 165 | let resp = c |
| 166 | .scan() |
| 167 | .table_name(&table) |
| 168 | .select(Select::Count) |
| 169 | .send() |
| 170 | .await |
| 171 | .unwrap(); |
| 172 | |
| 173 | assert_eq!(resp.count(), 4); |
| 174 | assert!(resp.items().is_empty()); |
| 175 | |
| 176 | c.delete_table().table_name(&table).send().await.ok(); |
| 177 | } |
| 178 | |
| 179 | #[tokio::test] |
| 180 | async fn scan_with_consistent_read() { |
nothing calls this directly
no test coverage detected