MCPcopy
hub / github.com/dbcli/pgcli / _select_one

Method _select_one

pgcli/pgexecute.py:287–295  ·  view source on GitHub ↗

Helper method to run a select and retrieve a single field value :param cur: cursor :param sql: string :return: string

(self, cur, sql)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

fetchoneMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected