database

Package Contents

Classes

Database

Main database connector.

Functions

init_core()

Load core models and create their tables.

init_modules()

Load all database models and create their tables.

_list_directory_directories(directory: str) → List[str]

Return filtered list of directories.

_import_database_tables()

Import database tables from the modules/ directory.

Attributes

database

session

class database.Database

Main database connector.

database.database
database.session
database.init_core()

Load core models and create their tables.

This function is responsible for creation of all core tables (see the sumodules of this class).

database.init_modules()

Load all database models and create their tables.

This function is responsible for creation of all module tables.

database._list_directory_directories(directory: str) List[str]

Return filtered list of directories.

Parameters

directory – Absolute or relative (from the __main__ file) path to the directory.

Returns

List of paths to directories inside the requested directory. Directories starting with underscore (e.g. __pycache__) are not included.

This function is used for repository & module discovery in _import_database_tables() function.

database._import_database_tables()

Import database tables from the modules/ directory.

When the tables are imported, init_modules() can create their tables.