1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// use ciboulette::*;
// use Ciboulette2Pg::*;
// use ciboulette_test_helper::*;
// use std::convert::TryInto;
// use url::Url;
// const BODY: &'static str = r#"
// {
// "data":
// {
// "type": "peoples",
// "attributes":
// {
// "first-name": "Hello",
// "last-name": "World"
// },
// "relationships":
// {
// "articles":
// {
// "data":
// {
// "type": "articles",
// "id": "9285eda2-73b0-4e02-a5d9-6ec31cf22692"
// }
// }
// }
// }
// }
// "#;
// use quaint::{
// prelude::*,
// visitor::{Postgres, Visitor},
// };
// #[tokio::main]
// async fn main() {
// let req_url = Url::parse("http://localhost:8080/peoples").unwrap();
// let store = gen_bag();
// let req: CibouletteCreateRequest =
// CibouletteRequestBuilder::new(CibouletteIntention::Create, &req_url, &Some(BODY))
// .build(&store)
// .unwrap()
// .try_into()
// .unwrap();
// // let pool =
// // sqlx::Pool::<sqlx::Postgres>::connect(std::env::var("DATABASE_URL").unwrap().as_str())
// // .await
// // .unwrap();
// println!(
// "Main : {:#?}",
// Ciboulette2Pg::creation::main::gen_query_main(&store, &req).unwrap()
// );
// println!(
// "Rel : {:#?}",
// Ciboulette2Pg::creation::relationships::gen_query_relationships(
// &store, &req, "MAIN_ID"
// )
// .unwrap()
// );
// let conditions = "world"
// .equals("meow")
// .and("age".less_than(10))
// .and("paw".equals("warm"));
// let query = Select::from_table("naukio").so_that(conditions);
// let (sql_str, params) = Postgres::build(query).unwrap();
// println!("{}", sql_str);
// }