MySQLContext¶
- class felis.db.database_context.MySQLContext(engine_url, metadata)¶
Bases:
_BaseContextDatabase context for MySQL.
- Parameters:
Attributes Summary
Methods Summary
drop()Drop the schema in the database if it exists.
Create the target schema in the database if it does not exist already.
Attributes Documentation
Methods Documentation
- drop()¶
Drop the schema in the database if it exists.
Implementations should use
IF EXISTSsemantics to avoid raising an error if the schema does not exist.- Raises:
DatabaseContextError – If there is an error dropping the schema.
- Return type:
- initialize()¶
Create the target schema in the database if it does not exist already.
Sub-classes should implement idempotent behavior so that calling this method multiple times has no adverse effects. If the schema already exists, the method should simply return without raising an error. (A warning message may be logged in this case.)
- Raises:
DatabaseContextError – If there is an error instantiating the schema.
- Return type: