Created
September 8, 2020 17:37
-
-
Save autarch/69f83591d9e42e4d305e451ec0da9e5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub mod ast; | |
| pub mod error; | |
| pub mod parser; | |
| use env_logger; | |
| fn main() -> Result<(), error::PGQueryError> { | |
| env_logger::init(); | |
| let sql = "CREATE TABLE foo ( | |
| foo_id UUID PRIMARY KEY, | |
| name citext NOT NULL | |
| ) | |
| ;"; | |
| // Calls serde_json::from_str internally | |
| let res = parser::parse_sql(sql)?; | |
| println!("{:#?}", res); | |
| Ok(()) | |
| } | |
| ---- | |
| $> RUST_LOG=serde_json cargo run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment