X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/06602b4ec0102d89e3c80a966eec1388de71c0f3..8b90ee4364b54b71b790cf52c1ccca31048437d7:/nominatim/db/connection.py diff --git a/nominatim/db/connection.py b/nominatim/db/connection.py index 1eb3599b..1319ac16 100644 --- a/nominatim/db/connection.py +++ b/nominatim/db/connection.py @@ -26,6 +26,16 @@ class _Cursor(psycopg2.extras.DictCursor): super().execute(query, args) + + def execute_values(self, sql, argslist, template=None): + """ Wrapper for the psycopg2 convenience function to execute + SQL for a list of values. + """ + LOG.debug("SQL execute_values(%s, %s)", sql, argslist) + + psycopg2.extras.execute_values(self, sql, argslist, template=template) + + def scalar(self, sql, args=None): """ Execute query that returns a single value. The value is returned. If the query yields more than one row, a ValueError is raised.