| 106 | |
| 107 | class SqliteRecordStorage(sqlite_dao.SqliteStorage, IRecordStorage): |
| 108 | def __init__(self, get_connection, schema, owner): |
| 109 | # type: (Callable[[], sqlite3.Connection], sqlite_dao.TableSchema, Union[str, int]) -> None |
| 110 | super(SqliteRecordStorage, self).__init__(get_connection, schema, owner) |
| 111 | if not schema.owner_column: |
| 112 | raise ValueError(f'SqliteRecordStorage: Schema \"{schema.table_name}\" should have an owner') |
| 113 | if schema.primary_key: |
| 114 | raise ValueError(f'SqliteRecordStorage: Schema \"{schema.table_name}\" should not have primary key') |
| 115 | |
| 116 | def load(self): |
| 117 | return next(self.select_all(), None) |