trying out rust
This commit is contained in:
15
src/main.rs
Normal file
15
src/main.rs
Normal file
@ -0,0 +1,15 @@
|
||||
use postgres::{Client, NoTls};
|
||||
|
||||
fn main() {
|
||||
let mut client = Client::connect("host=192.168.0.10 port=28945 user=hentai password=h99nqaNPhpfbuuhCDwQXLpZAnoVTjSQP7taoqmQhpzc2rPLVC4JUAKxAHfuuhuU9", NoTls).unwrap();
|
||||
let output = client.query("SELECT * FROM get_urls_and_paths('Rule34');", &[]).unwrap();
|
||||
let mut url: &str;
|
||||
let mut path: &str;
|
||||
|
||||
for row in output {
|
||||
url = row.get(0);
|
||||
path = row.get(1);
|
||||
|
||||
println!("{} {}", url, path);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user