xtr_orm.command ¶
The orm:* console commands.
Importing this module declares them. With a container, the orm bundle loads it when the console bundle is active, and every command acts on the connections the bundle registered.
Every command takes that :class:~xtr_orm.ConnectionRegistry as its one
constructor argument, so a console application registering them itself builds
each with a registry of its own:
from xtr_orm import ConnectionRegistry
from xtr_orm.command import MigrationsMigrateCommand
registry = ConnectionRegistry()
registry.register("default", engine=engine, migrator=migrator, database=database)
command = MigrationsMigrateCommand(registry)
Needs xtr-console installed beside this package.
DatabaseCreateCommand ¶
Bases: ConnectionCommand
Creates a connection's database on its server.
DatabaseDropCommand ¶
Bases: ConnectionCommand
Drops a connection's database from its server.
MigrationsCurrentCommand ¶
Bases: ConnectionCommand
Prints the revisions the database is at.
MigrationsDiffCommand ¶
Bases: ConnectionCommand
Writes a revision of what differs between the database and the table definitions.
MigrationsDumpSchemaCommand ¶
Bases: ConnectionCommand
Writes a first revision creating every table an existing database has.
MigrationsExecuteCommand ¶
Bases: ConnectionCommand
Runs chosen revisions alone, each up or down.
MigrationsGenerateCommand ¶
Bases: ConnectionCommand
Writes an empty revision to fill in by hand.
MigrationsLatestCommand ¶
Bases: ConnectionCommand
Prints the revisions no other follows.
MigrationsListCommand ¶
Bases: ConnectionCommand
Lists every revision and whether it is applied.
MigrationsMigrateCommand ¶
Bases: ConnectionCommand
Brings the database to a revision, up or down.
MigrationsRollupCommand ¶
Bases: ConnectionCommand
Records the single remaining revision as all the database has applied.
MigrationsStatusCommand ¶
Bases: ConnectionCommand
Shows where the database stands against its revisions.
MigrationsUpToDateCommand ¶
Bases: ConnectionCommand
Tells whether every revision is applied.
MigrationsVersionCommand ¶
Bases: ConnectionCommand
Records revisions as applied or not, running nothing.
RunSqlCommand ¶
Bases: ConnectionCommand
Runs a statement and shows what it returned.