cli

Litestar CLI

Manage SQLAlchemy database components.

Litestar CLI [OPTIONS] COMMAND [ARGS]...

downgrade

Downgrade database to a specific revision.

Litestar CLI downgrade [OPTIONS] [REVISION]

Options

--sql

Generate SQL output for offline migrations.

--tag <tag>

an arbitrary ‘tag’ that can be intercepted by custom env.py scripts via the .EnvironmentContext.get_tag_argument method.

--no-prompt

Do not prompt for confirmation before downgrading.

Default:

False

Arguments

REVISION

Optional argument

drop-all

Drop all tables from the database.

Litestar CLI drop-all [OPTIONS]

Options

--no-prompt

Do not prompt for confirmation before upgrading.

Default:

False

init

Initialize migrations for the project.

Litestar CLI init [OPTIONS] DIRECTORY

Options

--multidb

Support multiple databases

--package

Create __init__.py for created folder

--no-prompt

Do not prompt for confirmation before initializing.

Default:

False

Arguments

DIRECTORY

Required argument

make-migrations

Create a new migration revision.

Litestar CLI make-migrations [OPTIONS]

Options

-m, --message <message>

Revision message

--autogenerate, --no-autogenerate

Automatically populate revision with detected changes

--sql

Export to .sql instead of writing to the database.

--head <head>

Specify head revision to use as base for new revision.

--splice

Allow a non-head revision as the “head” to splice onto

--branch-label <branch_label>

Specify a branch label to apply to the new revision

--version-path <version_path>

Specify specific path from config for version file

--rev-id <rev_id>

Specify a ID to use for revision.

--no-prompt

Do not prompt for a migration message.

Default:

False

merge-migrations

Merge multiple revisions into a single new revision.

Litestar CLI merge-migrations [OPTIONS]

Options

--revisions <revisions>

Specify head revision to use as base for new revision.

-m, --message <message>

Revision message

--branch-label <branch_label>

Specify a branch label to apply to the new revision

--rev-id <rev_id>

Specify a ID to use for revision.

--no-prompt

Do not prompt for a migration message.

Default:

False

show-current-revision

Shows the current revision for the database.

Litestar CLI show-current-revision [OPTIONS]

Options

--verbose

Enable verbose output.

stamp-migration

Mark (Stamp) a specific revision as current without applying the migrations.

Litestar CLI stamp-migration [OPTIONS]

Options

--revision <revision>

Revision to stamp to

--sql

Generate SQL output for offline migrations.

--purge

Delete existing records in the alembic version table before stamping.

--tag <tag>

an arbitrary ‘tag’ that can be intercepted by custom env.py scripts via the .EnvironmentContext.get_tag_argument method.

--no-prompt

Do not prompt for confirmation.

Default:

False

upgrade

Upgrade database to a specific revision.

Litestar CLI upgrade [OPTIONS] [REVISION]

Options

--sql

Generate SQL output for offline migrations.

--tag <tag>

an arbitrary ‘tag’ that can be intercepted by custom env.py scripts via the .EnvironmentContext.get_tag_argument method.

--no-prompt

Do not prompt for confirmation before upgrading.

Default:

False

Arguments

REVISION

Optional argument