Hide Spatialite system tables

They were getting on my nerves.
This commit is contained in:
Russ Garrett 2018-04-11 22:20:25 +01:00 committed by Simon Willison
commit d08a133140
2 changed files with 18 additions and 3 deletions

View file

@ -372,6 +372,11 @@ def get_all_foreign_keys(conn):
return table_to_foreign_keys
def detect_spatialite(conn):
rows = conn.execute('select 1 from sqlite_master where tbl_name = "geometry_columns"').fetchall()
return len(rows) > 0
def detect_fts(conn, table, return_sql=False):
"Detect if table has a corresponding FTS virtual table and return it"
rows = conn.execute(detect_fts_sql(table)).fetchall()