import sqlite3 def getCursorWithSpatialite(db_path: str = None) -> sqlite3.Cursor: print(db_path) db = sqlite3.connect(db_path) cur = db.cursor() db.enable_load_extension(True) cur.execute('SELECT load_extension("mod_spatialite")') return cur