(self, db)
| 88 | db.query(q) |
| 89 | |
| 90 | def get_database_version(self, db): |
| 91 | schema = self.read_schema(db) |
| 92 | |
| 93 | if "seq" not in schema: |
| 94 | return 10 |
| 95 | elif "data" not in schema["transaction"]: |
| 96 | return 11 |
| 97 | elif "changes" not in schema["transaction"]: |
| 98 | return 12 |
| 99 | elif "transaction_index" not in schema: |
| 100 | return 13 |
| 101 | else: |
| 102 | return LATEST_VERSION |
| 103 | |
| 104 | def read_schema(self, db): |
| 105 | rows = db.query("SELECT table_name, column_name, data_type FROM information_schema.columns WHERE table_schema = 'public'") |