DataBridge Documentation 2.0.17
A Java library for managing database connections and transactions
Loading...
Searching...
No Matches
io.github.kdesp73.databridge.migration.CommandPrompt Class Reference

Public Member Functions

 CommandPrompt (Scheman scheman)
 
void start ()
 

Detailed Description

The CommandPrompt class provides a command-line interface (CLI) for interacting with the database migration system. It allows users to execute commands for managing database migrations, such as running, rolling back, and listing migrations, as well as generating migration templates and clearing the console.

This class continuously prompts the user for input and executes the corresponding command until the user exits.

Author
KDesp73

Constructor & Destructor Documentation

◆ CommandPrompt()

io.github.kdesp73.databridge.migration.CommandPrompt.CommandPrompt ( Scheman scheman)

Constructs a new CommandPrompt with the specified Scheman.

Parameters
schemanthe Scheman object responsible for handling migrations.

Member Function Documentation

◆ start()

void io.github.kdesp73.databridge.migration.CommandPrompt.start ( )

Starts the command-line interface, continuously prompting the user for commands and executing the corresponding actions.

The following commands are available:

  • exit, quit, q: Exit the CLI
  • up, run, r: Run all migrations
  • down, rollback: Rollback the last migration
  • list, ls: List completed migrations
  • generate, gen: Generate a template migration file
  • clear: Clear the screen
  • rerun, rr: Re-run changed migrations

If the user enters an unknown command, a help message is displayed.


The documentation for this class was generated from the following file: