DatabaseMixin#

class montreal_forced_aligner.abc.DatabaseMixin(**kwargs)[source]#

Bases: TemporaryDirectoryMixin

Abstract class for mixing in database functionality

construct_engine(**kwargs)[source]#

Construct a database engine

Parameters:
  • same_thread (bool, optional) – Flag for whether to enforce checking access on different threads, defaults to True

  • read_only (bool, optional) – Flag for whether the database engine should be created as read-only, defaults to False

Returns:

SqlAlchemy engine

Return type:

Engine

property db_engine#

Database engine

property db_path#

Connection path for sqlite database

property db_string#

Connection string for the database

delete_database()[source]#

Reset all schemas

initialize_database()[source]#

Initialize the database with database schema

property session#

Construct database session

Parameters:

**kwargs – Keyword arguments to pass to the Session

Returns:

SqlAlchemy session

Return type:

sessionmaker