sql_from_models-cli

Crates.iosql_from_models-cli
lib.rssql_from_models-cli
version0.1.3
created_at2023-08-17 19:01:10.510451+00
updated_at2025-01-09 15:42:47.711934+00
descriptionCommand-line utility for SQLx, the Rust SQL toolkit.
homepage
repository
max_upload_size
id947343
size101,885
higneer (mikemoore13)

documentation

README

Models CLI

Installation

To install the CLI use the following command:

$ cargo install models-cli

Usage

There are three main commands: database, generate and migrate.

database

it can be abbreviated as db. It includes the subcomands:

  • create: Creates the database specified in your DATABASE_URL.
  • drop: Drops the database specified in your DATABASE_URL.
  • reset: Drops the database specified in your DATABASE_URL, re-creates it, and runs any pending migrations.
  • setup: Creates the database specified in your DATABASE_URL and runs any pending migrations.

generate

It is used to generate migrations. It can be used to generate down migrations as well if the -r flag is enabled. The --source variable can be used to specify the migrations directory. The --table variable can be used to filter the names of the tables to target in the generation.

migrate

  • add: Create a new migration with the given description, and the current time as the version.
  • info: List all available migrations and their status.
  • revert: Revert the latest migration with a down file.
  • run: Run all pending migrations.
Commit count: 0

cargo fmt