so://phie

verbal

A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal

blob: 58fd8f0a1289261b93453974c4d191984c3645a1 (835 bytes)[doc][blame][raw]

1#[macro_use]

2extern crate diesel;

3

4use diesel::prelude::*;

5use diesel::pg::PgConnection;

6

7mod utils;

8mod error;

9mod api;

10mod adapter;

11mod models;

12mod schema;

13

14use models::*;

15use schema::account::dsl::*;

16use api::{RadioBrowserApi, Search};

17

18#[async_std::main]

19async fn main() {

20 let database_url = "postgres://typable:De24Si98@192.168.2.3:9748/verbal";

21 let conn = PgConnection::establish(&database_url)

22 .expect("Unable to connect to database!");

23 let results = account.load::<Account>(&conn)

24 .expect("Unable to load model!");

25 for item in results {

26 println!("{:?}", item);

27 }

28 let mut search = Search::default();

29 search.name = "bbc".into();

30 match RadioBrowserApi::search(search).await {

31 Ok(result) => println!("{:#?}", result),

32 Err(err) => println!("{}", err),

33 }

34}