Db Base¶
- class dffml.db.base.BaseDatabase(config: Optional[Type[BaseConfig]])[source]¶
Base class for database interaction
- class dffml.db.base.BaseDatabaseContext(parent: BaseDatabase)[source]¶
Base context class for database interaction
- abstract create_table(table_name: str, cols: Dict[str, str]) None [source]¶
Creates a table with name table_name if it doesn’t exist
- abstract insert(table_name: str, data: Dict[str, Any]) None [source]¶
Inserts values to corresponding cols (according to position) to the table table_name
- abstract lookup(table_name: str, cols: Optional[List[str]] = None, conditions: Optional[Union[List[List[Condition]], List[List[Tuple[str]]]]] = None) AsyncIterator[Dict[str, Any]] [source]¶
Returns list of rows (satisfying conditions if provided) from table_name