Crates.io | aws-athena-parser |
lib.rs | aws-athena-parser |
version | 0.1.5 |
source | src |
created_at | 2024-04-12 19:26:10.776298 |
updated_at | 2024-04-13 03:56:50.949919 |
description | Athena parser to convert Athena ResultSet into user defined Structs |
homepage | |
repository | https://github.com/Surphix/aws_athena_parser |
max_upload_size | |
id | 1206729 |
size | 10,361 |
The purpose of this package is to provide an easy method of turning the external aws_sdk_athena::types::ResultSet
into a user defined struct of various types.
Ensure that named values within your struct correspond to the column names of the Athena query result set.
use aws_athena_pasrer::{FromAthena, build_map};
#[derive(FromAthena)]
struct MyStruct {
my_value: String
}
pub fn main() {
let result_set = ...; // Athena response
let res: Vec<MyStruct> = build_map(result_set)
.iter()
.flat_map(|x| MyStruct::from_athena(x.clone()))
.collect();
// ( use the res for your purposes )
}