(self, get_connection, schema, owner=None)
| 196 | |
| 197 | class SqliteStorage: |
| 198 | def __init__(self, get_connection, schema, owner=None): |
| 199 | # type: (Callable[[], sqlite3.Connection], TableSchema, Union[str, int, None]) -> None |
| 200 | if not callable(get_connection): |
| 201 | raise ValueError(f'"get_connection" should be callable.') |
| 202 | self.get_connection = get_connection |
| 203 | if not isinstance(schema, TableSchema): |
| 204 | raise ValueError(f'"schema": Invalid type. TableSchema expected') |
| 205 | self.schema = schema |
| 206 | self.owner = None |
| 207 | if owner: |
| 208 | if not schema.owner_column: |
| 209 | raise ValueError(f'"owner": schema does not define owner column.') |
| 210 | if not isinstance(owner, schema.owner_column_type or str): |
| 211 | raise ValueError(f'"owner": Invalid type. {(schema.owner_column_type or str).__name__} expected') |
| 212 | self.owner = owner |
| 213 | self._queries = {} # type: Dict[str, str] |
| 214 | |
| 215 | def _populate_data_object(self, values): # type: (Sequence[Any]) -> Any |
| 216 | obj = self.schema.class_type() |
nothing calls this directly
no outgoing calls
no test coverage detected