Axione-IPE-Viewer/webapp/ipe_fetcher/sqlite_connector/cursor.py
Johan Le Baut 0fb3de88e1 clean code
2023-02-28 22:31:35 +01:00

15 lines
386 B
Python

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