-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfa6fff
commit 5743d55
Showing
4 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
extern crate connectorx; | ||
extern crate env_logger; | ||
extern crate log; | ||
use connectorx_python::cx_read_sql::read_sql; | ||
use log::debug; | ||
use pyo3::Python; | ||
use std::env; | ||
|
||
fn main() { | ||
env_logger::init(); | ||
debug!("[!] debug"); | ||
let conn = env::var("POSTGRES_URL").unwrap(); | ||
|
||
let res = Python::with_gil(|py| { | ||
read_sql( | ||
py, | ||
&conn, | ||
"pandas", | ||
None, | ||
Some(vec![ | ||
String::from("select test_int from test_table where test_int > 3"), | ||
// String::from("select test_int, test_str from test_table where test_int <= 3"), | ||
]), | ||
None, | ||
) | ||
.unwrap(); | ||
}); | ||
|
||
println!("finish!"); | ||
println!("res: {:?}", res); | ||
} |