Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brittle sqlite metadata parsing #18

Open
yifanwu opened this issue Aug 26, 2020 · 0 comments
Open

brittle sqlite metadata parsing #18

yifanwu opened this issue Aug 26, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@yifanwu
Copy link
Owner

yifanwu commented Aug 26, 2020

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 yifanwu added the bug Something isn't working label Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant