1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-05 09:15:25 +02:00
tldr/pages/common/sqlx.md
Managor 23340cc6e0
common/*: reduce usage of "command-line" (part 1) (#16949)
Co-authored-by: Dylan <145150333+dmmqz@users.noreply.github.com>
Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com>
2025-06-29 11:48:18 +03:00

733 B

sqlx

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}}