Skip to content
This repository was archived by the owner on Jan 29, 2022. It is now read-only.

ATS for Requirement 4 - PRAGMA does not show UNIQUE constraint, only PK #51

Closed
tabinfl opened this issue Apr 2, 2018 · 3 comments
Closed

Comments

@tabinfl
Copy link
Contributor

tabinfl commented Apr 2, 2018

1. PRAGMA table_info(gpkgext_relations) 
[...]
3. Pass if the column names, types, nullability, default values,
primary key, and unique key constraints match all of those in
the contents of [gpkgext_relations_table].

The PRAGMA query return data allows checking everything but the UNIQUE constraint on the mapping_table_name field.

could add

PRAGMA index_list(gpkgext_relations);

to check for unique = 1 and then

PRAGMA index_info({index_name});

to verify that it's on the correct (mapping_table_name) column.

There may be an easier way, I keep running into sqlite's limited SQL.

@bradh
Copy link
Collaborator

bradh commented Apr 2, 2018

I think this is the only sane way - there is code that does something similar in the ETS core. It would be possible to parse the schema to see how the table was created, but that is probably too brittle.

@jyutzler
Copy link
Collaborator

@jyutzler
Copy link
Collaborator

moved to ☝️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants