nexrad-archive/lib/nexrad/db.py

12 lines
275 B
Python
Raw Normal View History

2025-02-10 20:05:00 -05:00
import sqlite3
class Database():
def connect(path: str):
2025-02-11 21:12:27 -05:00
db = sqlite3.connect(path)
db.enable_load_extension(True)
2025-02-10 20:05:00 -05:00
2025-02-11 22:18:35 -05:00
db.execute('select load_extension("mod_spatialite.so.8")')
2025-02-11 21:12:27 -05:00
db.execute('select InitSpatialMetadata(1)')
2025-02-10 20:05:00 -05:00
2025-02-11 21:12:27 -05:00
return db