mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
13 lines
303 B
Python
13 lines
303 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)
|
|
conn.commit()
|