xmet/lib/nexrad/db.py

13 lines
312 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)
2025-02-13 14:42:04 -05:00
db.row_factory = sqlite3.Row
2025-02-11 21:12:27 -05:00
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