mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-05 16:54:50 +00:00

* chore: replace `dotenv` with `dotenvy` The former appears to be unmaintained and the latter is a drop-in replacement. * chore: fix all warnings
Query files Example
Description
This example demonstrates storing external files to use for querying data. Encapsulating your SQL queries can be helpful in several ways, assisting with intellisense, etc.
Setup
-
Declare the database URL
export DATABASE_URL="postgres://postgres:password@localhost/files"
-
Create the database.
$ sqlx db create
-
Run sql migrations
$ sqlx migrate run
Usage
Run the project
cargo run files