diel icon indicating copy to clipboard operation
diel copied to clipboard

brittle sqlite metadata parsing

Open yifanwu opened this issue 4 years ago • 0 comments

For example, data from https://www.kaggle.com/rtatman/188-million-us-wildfires, if you run the current query from DIEL

SELECT sql, name  FROM sqlite_master  WHERE type='table'    AND sql not null    AND name != 'sqlite_sequence'

You will get the following:

CREATE TABLE views_geometry_columns (
view_name TEXT NOT NULL,
view_geometry TEXT NOT NULL,
view_rowid TEXT NOT NULL,
f_table_name TEXT NOT NULL,
f_geometry_column TEXT NOT NULL,
read_only INTEGER NOT NULL,
CONSTRAINT pk_geom_cols_views PRIMARY KEY (view_name, view_geometry),
CONSTRAINT fk_views_geom_cols FOREIGN KEY (f_table_name, f_geometry_column) REFERENCES geometry_columns (f_table_name, f_geometry_column) ON DELETE CASCADE,
CONSTRAINT ck_vw_rdonly CHECK (read_only IN (0,1)))

DIEL will attempt to parse this, and some of the syntax is currently not handled by DIEL, e.g., CASCADE. The easiest way to fix this would be to remove the constraints (since we only need to reason with the columns), or to expand DIEL parsing to include all of SQLite's syntax.

yifanwu avatar Aug 26 '20 23:08 yifanwu