trying out rust

This commit is contained in:
2024-11-01 17:25:51 +01:00
parent b6ea267ddf
commit a8f2919fdd
4 changed files with 24 additions and 2 deletions

15
src/main.rs Normal file
View 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);
}
}