MCPcopy Create free account
hub / github.com/ElementsProject/lightning / query

Method query

contrib/pyln-testing/pyln/testing/db.py:92–105  ·  view source on GitHub ↗
(self, query)

Source from the content-addressed store, hash-verified

90 )
91
92 def query(self, query):
93 cur = self.conn.cursor()
94 cur.execute(query)
95
96 # Collect the results into a list of dicts.
97 res = []
98 for r in cur:
99 t = {}
100 # Zip the column definition with the value to get its name.
101 for c, v in zip(cur.description, r):
102 t[c.name] = v
103 res.append(t)
104 cur.close()
105 return res
106
107 def execute(self, query: str, params: tuple = ()) -> None:
108 """Execute a single statement with bound params. Placeholders: '%s'"""

Callers

nothing calls this directly

Calls 2

executeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected