-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support foreign key checks #88
Conversation
@amercader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
['id', 'height', 'age', 'name', 'occupation'], | ||
[1, 10.0, 1, 'string1', new Date(2012, 6-1, 15)]]) | ||
}) | ||
describe('#foreignKeys', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a test for self reference FK, as in the Python implementation? Can be done on a separate PR though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have for self-referencing in datapackage
tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, sorry I got the two mixed up!
@Stephen-Gates |
@roll here's my attempt at an error message. message: The value {value} in row {row_number} and column {column_name_A} does not have a matching value in column {column_name_B} in table {table_name_B} description: A matching value should exist for a valid foreign key relationship. How it could be resolved:
Not sure if the last dot point is needed - just conforming with format of other messages. |
@Stephen-Gates |
validate
Table
tests (diff just because of indentations only FK tests are new)On
tableschema
level we just acceptsreferences
argument forTable
constructor. It's becausetableschema
layer is not responsible for integrity checks by itself but provides tools for it likeschema.foreignKeys
and table FK checks ifreferences
is passed.So on
datapackage
level thosereferences
should be composed. See this PR tests and readme diff for morereferences
argument information. Seedatapackage
implementation - frictionlessdata/datapackage-js#89