Helper method to run a select and retrieve a single field value :param cur: cursor :param sql: string :return: string
(self, cur, sql)
| 285 | return short_host |
| 286 | |
| 287 | def _select_one(self, cur, sql): |
| 288 | """ |
| 289 | Helper method to run a select and retrieve a single field value |
| 290 | :param cur: cursor |
| 291 | :param sql: string |
| 292 | :return: string |
| 293 | """ |
| 294 | cur.execute(sql) |
| 295 | return cur.fetchone() |
| 296 | |
| 297 | def failed_transaction(self): |
| 298 | return self.conn.info.transaction_status == psycopg.pq.TransactionStatus.INERROR |