dvc.app.cli.commands.database package#

Submodules#

dvc.app.cli.commands.database.backend module#

class dvc.app.cli.commands.database.backend.DatabaseInteractor(config_file_path_str: str)[source]#

Bases: object

Exposes API to interact with Various Database flavours

MAPPING = {SupportedDatabaseFlavour.Postgres: <function DatabaseInteractor.<lambda>>}#
property conn#
Returns

property database_revision_files_manager: dvc.core.config.DatabaseRevisionFilesManager#
Returns

DatabaseRevisionFilesManager

execute_single_sql_file(database_revision_file: dvc.core.struct.DatabaseRevisionFile, mark_only: bool = False) None[source]#

Execute DatabaseRevisionFile to the Database and optionally mark it as metadata

Parameters
  • database_revision_file – Database Revision File to apply to the Database

  • mark_only – whether or not to mark the SQL file as being done as metadata, without actually executing the SQL file

Returns

get_target_database_revision_files(steps: int, pointer: Optional[dvc.core.config.DatabaseRevisionFilesManager.Pointer] = None) List[dvc.core.struct.DatabaseRevisionFile][source]#

Helper to get target database revision files Check number of returned revision files must be same as steps specified

Parameters

steps – Specify how many steps ahead/ backwards.. When None, it goes to the very end in either direction

Returns

List of DatabaseRevisionFiles, if any

property latest_database_version: dvc.core.struct.DatabaseVersion#
Returns

latest Database Version

ping() None[source]#

Ping the database connection

Returns

property sql_file_executor#
property target_schema#
Returns

Module contents#

database subcommand