unsure how to resolve sqlx error : “error with configuration: no driver found for URL scheme “postgres””

I’m following along zero to production book and I’ve reached the point where I’m supposed to create a database connection with sqlx and Docker. I’ve been following all the steps in order to establish a connection to a DB and migrate to create a users table but I keep receiving this error message: “error with configuration: no driver found for URL scheme “postgres””
I am unexperienced with DB so I’m not even sure to understand what the error message means.

This is what my bash looks like:

#!/usr/bin/env bash
set -x
set -eo pipefail

if ! [ -x "$(command -v psql)" ]; then
  echo >&2 "Error: psql is not installed."
  exit 1
fi

if ! [ -x "$(command -v sqlx)" ]; then
  echo >&2 "Error: sqlx is not installed."
  echo >&2 "Use:"
  echo >&2 "    cargo install --version='~0.7' sqlx-cli --no-default-features --features rustls,postgres"
  echo >&2 "to install it."
  exit 1
fi

# Check if a custom user has been set, otherwise default to 'postgres'
DB_USER="${POSTGRES_USER:=postgres}"
# Check if a custom password has been set, otherwise default to 'password'
DB_PASSWORD="${POSTGRES_PASSWORD:=password}"
# Check if a custom database name has been set, otherwise default to 'lairbnb'
DB_NAME="${POSTGRES_DB:=lairbnb}"
# Check if a custom port has been set, otherwise default to '5432'
DB_PORT="${POSTGRES_PORT:=5432}"
# Check if a custom host has been set, otherwise default to 'localhost'
DB_HOST="${POSTGRES_HOST:=localhost}"

# Allow to skip Docker if a dockerized Postgres database is already running
if [[ -z "${SKIP_DOCKER}" ]]
then
  # if a postgres container is running, print instructions to kill it and exit
  RUNNING_POSTGRES_CONTAINER=$(docker ps --filter 'name=postgres' --format '{{.ID}}')
  if [[ -n $RUNNING_POSTGRES_CONTAINER ]]; then
    echo >&2 "there is a postgres container already running, kill it with"
    echo >&2 "    docker kill ${RUNNING_POSTGRES_CONTAINER}"
    exit 1
  fi
  # Launch postgres using Docker
  docker run 
      -e POSTGRES_USER=${DB_USER} 
      -e POSTGRES_PASSWORD=${DB_PASSWORD} 
      -e POSTGRES_DB=${DB_NAME} 
      -p "${DB_PORT}":5432 
      -d 
      --name "postgres_$(date '+%s')" 
      postgres -N 1000
      # ^ Increased maximum number of connections for testing purposes
fi

# Keep pinging Postgres until it's ready to accept commands
until PGPASSWORD="${DB_PASSWORD}" psql -h "${DB_HOST}" -U "${DB_USER}" -p "${DB_PORT}" -d "postgres" -c 'q'; do
  >&2 echo "Postgres is still unavailable - sleeping"
  sleep 1
done

>&2 echo "Postgres is up and running on port ${DB_PORT} - running migrations now!"

export DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
sqlx database create
sqlx migrate run

>&2 echo "Postgres has been migrated, ready to go!"

It’s virtually the same than the one in the book, so I’m confident it’s not a typo error
This is what my cargo tool looks like:

[lib]
path = "src/lib.rs"

[[bin]]
path = "src/main.rs"
name = "lairbnb_rs"

[dependencies]
actix-web = "4"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
serde = "1.0.115"
config = { version = "0.13", default-features = false, features = ["yaml"] }
sqlx = { version = "0.7", default-features = false, features = ["runtime-tokio-rustls", "macros", "postgres", "uuid", "chrono", "migrate"] }
uuid = { version = "1", features = ["v4"] }
chrono = { version = "0.4.22", default-features = false, features = ["clock"] }

[dev-dependencies]
reqwest = { version = "0.11", features = ["json"] }

And finally, this is what my migration file looks like:

-- Create Registration Table
CREATE TABLE users(
   id uuid NOT NULL,
   PRIMARY KEY (id),
   account_name text UNIQUE NOT NULL PRIMARY KEY,
   account_password text NOT NULL
);

Would anyone know what the error message could be referring to perhaps? And maybe how I could hope to fix it?

Cheers

I tried to create a connection to a DB using sqlx and Docker, however I only managed to get this error message :

+ set -eo pipefail
++ command -v psql
+ '[' -x /opt/homebrew/bin/psql ']'
++ command -v sqlx
+ '[' -x /Users/lunaferraraccio/.cargo/bin/sqlx ']'
+ DB_USER=postgres
+ DB_PASSWORD=password
+ DB_NAME=lairbnb
+ DB_PORT=5432
+ DB_HOST=localhost
+ [[ -z '' ]]
++ docker ps --filter name=postgres --format '{{.ID}}'
+ RUNNING_POSTGRES_CONTAINER=
+ [[ -n '' ]]
++ date +%s
+ docker run -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=lairbnb -p 5432:5432 -d --name postgres_1721673957 postgres -N 1000
22c73dffb9d331b62cfff2271be596312e9f717c8215e4db990d49be702ecb55
+ PGPASSWORD=password
+ psql -h localhost -U postgres -p 5432 -d postgres -c 'q'
+ echo 'Postgres is up and running on port 5432 - running migrations now!'
Postgres is up and running on port 5432 - running migrations now!
+ export DATABASE_URL=postgres://postgres:password@localhost:5432/lairbnb
+ DATABASE_URL=postgres://postgres:password@localhost:5432/lairbnb
+ sqlx database create
error: error with configuration: no driver found for URL scheme "postgres"

I am unexperienced in databases and I would love to get a better understanding of the situation in order to improve myself.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật