flexeval.db_utils#

Peewee database utilities.

Functions

bind_to_database(database_path)

Utility function for binding to a FlexEval database so that ORM functionality can be used.

initialize_database(database_path[, ...])

flexeval.db_utils.bind_to_database(database_path: str) Database[source]#

Utility function for binding to a FlexEval database so that ORM functionality can be used.

See: https://docs.peewee-orm.com/en/latest/peewee/database.html#setting-the-database-at-run-time

Returns:

The new database created for the models to bind to.

Return type:

pw.Database

flexeval.db_utils.initialize_database(database_path: str, clear_tables: bool = False)[source]#