Skip to content

CLI Usage

This page provides documentation for the sqly command line command.

  • sqly migration = create a new migration. Example:

    $ sqly migration APP_NAME -n MIGRATION_NAME
    Created migration: APP_NAME:20230725235258975_MIGRATION_NAME
        depends:
          - sqly:20211105034808482_init
    

  • sqly migrations = list the migrations. Example:

    $ sqly migrations APP_NAME
    APP_NAME:20230725235258975_MIGRATION_NAME
    

  • sqly migrate = migrate the database to a migration. Example:

    $ sqly migrate APP_NAME:20230725235258975_MIGRATION_NAME
    ...
    sqly:20211105034808482_init up ... OK
    APP_NAME:20230725235258975_MIGRATION_NAME up ... OK
    

sqly

Usage:

sqly [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

sqly migrate

Migrate database_url to the given MIGRATION_KEY (up or dn).

Usage:

sqly migrate [OPTIONS] MIGRATION_KEY

Options:

Name Type Description Default
-u, --database-url text Datebase to migrate; default = env $DATABASE_URL None
-d, --dialect text N/A None
-r, --dryrun boolean If present, shows but does not run the migrations False
--help boolean Show this message and exit. False

sqly migration

Create a Migration in APP (importable python module) incorporating dependencies from OTHER_APPS

Usage:

sqly migration [OPTIONS] APP [OTHER_APPS]...

Options:

Name Type Description Default
-n, --name text A couple words describing the Migration’s purpose None
--help boolean Show this message and exit. False

sqly migrations

List the Migrations in APPS

Usage:

sqly migrations [OPTIONS] [APPS]...

Options:

Name Type Description Default
-i, --include-depends boolean Include dependencies False
--help boolean Show this message and exit. False