I am getting started with Diesel by following their official documentation. I also have PostgreSQL installed. My database username is postgres
and the password is 1schoollife@
.
I started with
$ echo DATABASE_URL=postgres://postgres:1schoollife@@localhost/diesel_demo > .env
$ diesel setup
results:
Creating migrations directory at: /home/naufil/Desktop/rust/3june/testing/migrations
Creating database: diesel_demo
database "diesel_demo" already exists
I created a migration:
$ diesel migration generate create_posts
Creating migrations/2019-06-03-182531_create_posts/up.sql
Creating migrations/2019-06-03-182531_create_posts/down.sql
I get the following error when migrating the database:
$ diesel migration run
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ConnectionError(BadConnection("could not translate host name \"@localhost\" to address: Name or service not known\n"))', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.