planemo.database package
Submodules
planemo.database.factory module
Create a DatabaseSource from supplied planemo configuration.
- planemo.database.factory.create_database_source(profile_directory: str | None = None, for_database_commands: bool = False, **kwds) DatabaseSource[source]
Return a
planemo.database.interface.DatabaseSourcefor configuration.
- planemo.database.factory.database_source_class(database_type)[source]
Return the database source class registered for
database_type.
- planemo.database.factory.database_source_context(profile_directory: str | None = None, for_database_commands: bool = False, **kwds)[source]
Yield a started database source and stop it when doing so preserves its data.
- planemo.database.factory.is_managed_database_type(database_type)[source]
Return whether
database_typenames a registered database source.
- planemo.database.factory.started_database_source(profile_directory: str | None = None, for_database_commands: bool = False, **kwds) DatabaseSource[source]
Construct and start a
planemo.database.interface.DatabaseSource.
planemo.database.interface module
Describe the interface classes of the planemo.database package.
- exception planemo.database.interface.DatabaseConfigurationError[source]
Bases:
ValueErrorIndicate that a database source cannot support the requested operation.
- class planemo.database.interface.DatabaseSource[source]
Bases:
objectInterface describing a source of profile databases.
- PROFILE_OPTIONS: tuple[str, ...] = ()
- abstractmethod create_database(identifier)[source]
Create a database with specified short identifier.
Throw an exception if it already exists.
- abstractmethod delete_database(identifier)[source]
Delete a database with specified short identifier.
Throw an exception if it does not exist.
- keep_running_after_database_commands = False
- abstractmethod sqlalchemy_url(identifier) str | None[source]
Return a URL string for use by sqlalchemy.
- store_connection_in_profile = True
planemo.database.postgres module
Module describes a DatabaseSource for local postgres databases.
- class planemo.database.postgres.LocalPostgresDatabaseSource(**kwds)[source]
Bases:
ExecutesPostgresSqlMixin,DatabaseSourceLocal postgres database source managed through psql application.
planemo.database.postgres_docker module
Module describes a DatabaseSource for managed, dockerized postgres databases.
- class planemo.database.postgres_docker.DockerPostgresDatabaseSource(**kwds)[source]
Bases:
ExecutesPostgresSqlMixin,DatabaseSourcePostgres database running inside a Docker container.
- keep_running_after_database_commands = True
planemo.database.postgres_singularity module
Manage a PostgreSQL server in a Singularity/Apptainer container.
- class planemo.database.postgres_singularity.SingularityPostgresDatabaseSource(profile_directory: str | None = None, **kwds)[source]
Bases:
ExecutesPostgresSqlMixin,DatabaseSourcePostgres database source running inside a Singularity container.
- PROFILE_OPTIONS: tuple[str, ...] = ('postgres_storage_location', 'singularity_cmd', 'singularity_sudo', 'singularity_sudo_cmd')
- store_connection_in_profile = False
Module contents
Package is responsible for managing planemo profile databases.
This package makes it very easy to create and destroy databases, therefore it should not be used for production data - and should not even be connnected to a production database server.
- exception planemo.database.DatabaseConfigurationError[source]
Bases:
ValueErrorIndicate that a database source cannot support the requested operation.
- planemo.database.create_database_source(profile_directory: str | None = None, for_database_commands: bool = False, **kwds) DatabaseSource[source]
Return a
planemo.database.interface.DatabaseSourcefor configuration.
- planemo.database.database_source_class(database_type)[source]
Return the database source class registered for
database_type.
- planemo.database.database_source_context(profile_directory: str | None = None, for_database_commands: bool = False, **kwds)[source]
Yield a started database source and stop it when doing so preserves its data.
- planemo.database.is_managed_database_type(database_type)[source]
Return whether
database_typenames a registered database source.
- planemo.database.started_database_source(profile_directory: str | None = None, for_database_commands: bool = False, **kwds) DatabaseSource[source]
Construct and start a
planemo.database.interface.DatabaseSource.