【发布时间】:2022-09-28 06:38:22
【问题描述】:
如何在 rust 中定义 dynamodb 中的复合键?目前我们正在创建类似于 rust CRUD github 官方示例的表
match client
.create_table()
.table_name(table_name)
.key_schema(ks)
.attribute_definitions(ad)
.provisioned_throughput(pt)
.send()
.await
{
Ok(_) => println!(\"Added table {} with key {}\", table, key),
Err(e) => {
println!(\"Got an error creating table:\");
println!(\"{}\", e);
}
};
在 python 和 JS 中,您可以将字典对象传递给 .key_scheme 和 .attributes,但在 Rust 实现中,似乎 key_scheme 被定义为
pub fn key_schema(mut self, input: crate::model::KeySchemaElement) -> Self {
self.inner = self.inner.key_schema(input);
self
}
所以我们不确定如何创建复合主键!
标签: rust amazon-dynamodb