Skip to main content

Crate toasty_cli

Crate toasty_cli 

Source
Expand description

A library for building Toasty command-line tools.

toasty-cli provides ToastyCli, a ready-made CLI runner that wraps a toasty::Db handle and exposes database migration subcommands (generate, apply, drop, reset, snapshot). It uses clap for argument parsing and dialoguer for interactive prompts.

The crate also exposes the underlying configuration used by the command runner. Reusable migration history, snapshot, and generation types live in toasty::migration.

§Main types

§Examples

use toasty_cli::ToastyCli;

let db = toasty::Db::builder("sqlite::memory:").build().await?;
let cli = ToastyCli::new(db);
cli.parse_and_run().await?;

Structs§

ApplyCommand
Applies pending migrations to the database.
Config
Configuration for Toasty CLI operations.
DropCommand
Removes a migration from the history and deletes its files on disk.
GenerateCommand
Generates a new SQL migration from the current schema diff.
MigrationCommand
Top-level migration subcommand.
MigrationConfig
Configuration for migration operations.
ResetCommand
Drops all tables in the database, then optionally re-applies migrations.
SnapshotCommand
Prints the current schema as a TOML snapshot to stdout.
ToastyCli
A CLI runner that dispatches migration subcommands against a Db.

Enums§

MigrationPrefixStyle
Controls the prefix format used when naming generated migration files.