| 134 | |
| 135 | |
| 136 | class CLISessionDatabaseWriter: |
| 137 | _WRITE_RECORD = """ |
| 138 | INSERT OR REPLACE INTO session ( |
| 139 | key, session_id, timestamp |
| 140 | ) VALUES (?, ?, ?) |
| 141 | """ |
| 142 | |
| 143 | def __init__(self, connection): |
| 144 | self._connection = connection |
| 145 | |
| 146 | def write(self, data): |
| 147 | self._connection.execute( |
| 148 | self._WRITE_RECORD, |
| 149 | ( |
| 150 | data.key, |
| 151 | data.session_id, |
| 152 | data.timestamp, |
| 153 | ), |
| 154 | ) |
| 155 | |
| 156 | |
| 157 | class CLISessionDatabaseReader: |
no outgoing calls