1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-09-10 14:53:59 +02:00

sqlx: add page (#16427)

This commit is contained in:
Rolv Apneseth 2025-05-10 02:09:17 +01:00 committed by GitHub
parent 87e4e1dc52
commit 77f84dd115
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

24
pages/common/sqlx.md Normal file
View file

@ -0,0 +1,24 @@
# sqlx
> Command-line utility for SQLx, the Rust SQL toolkit.
> More information: <https://github.com/launchbadge/sqlx/blob/main/sqlx-cli/README.md>.
- Create the database specified in the DATABASE_URL environment variable:
`sqlx database create`
- Drop the specified database:
`sqlx database drop {{[-D|--database-url]}} {{database_url}}`
- Create a new pair of up and down migration files with the given description in the "migrations" directory:
`sqlx migrate add -r {{migration_description}}`
- Run all pending migrations for the specified database:
`sqlx migrate run {{[-D|--database-url]}} {{database_url}}`
- Revert the latest migration for the specified database:
`sqlx migrate revert {{[-D|--database-url]}} {{database_url}}`