mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
12 lines
285 B
Python
12 lines
285 B
Python
"""
|
|
Helper functions for handling DB accesses.
|
|
"""
|
|
|
|
def execute_file(conn, fname):
|
|
""" Read an SQL file and run its contents against the given connection.
|
|
"""
|
|
with fname.open('r') as fdesc:
|
|
sql = fdesc.read()
|
|
with conn.cursor() as cur:
|
|
cur.execute(sql)
|