athena/main.rs
1//! athena-rs: A CLI tool for managing AWS Athena schemas using templated SQL
2//!
3//! This application provides two main commands:
4//! - `build`: Render SQL from template files using the Tera template engine
5//! - `apply`: Build and execute SQL statements in AWS Athena
6//!
7//! # Examples
8//!
9//! Build SQL from templates:
10//! ```bash
11//! athena build ./templates
12//! ```
13//!
14//! Apply SQL to Athena:
15//! ```bash
16//! athena apply --output_location=s3://my-bucket/ ./templates
17//! ```
18
19mod apply;
20mod build;
21mod cli;
22mod tera;
23mod utils;
24
25use anyhow::Result;
26use env_logger::Env;
27
28#[tokio::main]
29async fn main() -> Result<()> {
30 let env = Env::new().default_filter_or("info,aws_config=error,aws_smithy_http_tower=warn");
31 env_logger::init_from_env(env);
32
33 let args = cli::parse();
34
35 match args.cmd {
36 cli::Command::Build(args) => build::call(args).await,
37 cli::Command::Apply(args) => apply::call(args).await,
38 }
39}