mlos_bench.storage.sql.schema
DB schema definition for the SqlStorage
backend.
Notes
The SQL statements are generated by SQLAlchemy, but can be obtained using
repr
or str
(e.g., via print()
) on this object.
The mlos_bench
CLI will do this automatically if the logging level is set to
DEBUG
.
Classes
A class to define and create the DB schema. |
Module Contents
- class mlos_bench.storage.sql.schema.DbSchema(engine: sqlalchemy.engine.Engine)[source]
A class to define and create the DB schema.
Declare the SQLAlchemy schema for the database.
- Parameters:
engine (sqlalchemy.engine.Engine)
- __repr__() str [source]
Produce a string with all SQL statements required to create the schema from scratch in current SQL dialect.
That is, return a collection of CREATE TABLE statements and such. NOTE: this method is quite heavy! We use it only once at startup to log the schema, and if the logging level is set to DEBUG.
- Returns:
sql – A multi-line string with SQL statements to create the DB schema from scratch.
- Return type: