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

Add Table.Validate(schema) #95

Open
cuducos opened this issue Dec 2, 2020 · 2 comments
Open

Add Table.Validate(schema) #95

cuducos opened this issue Dec 2, 2020 · 2 comments
Labels

Comments

@cuducos
Copy link
Contributor

cuducos commented Dec 2, 2020

Overview

In some use cases, it might make sense to just load a table and a schema and validate whether the table data matches what is expected by the schema.

This is different than Schema.Validate() (which validate the schema itself) and from iterating through table rows casting them to a struct (in that case, validation would be made against the struct, not against the schema).

If that sounds interesting for this package I'd be happy to try to implement it.

Intended roadmap

A suggested API would be something like func (t *Table) Validate(s Schema) error.

This function/method would iterate over the table and over its rows trying to cast each field. If casting fails, validates returns false and we can add an error message pointing the user to the lines that caused the validation to fail.


Please preserve this line to notify @danielfireman (lead of this repository)

@stale
Copy link

stale bot commented Mar 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 19, 2021
@stale
Copy link

stale bot commented Jun 20, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 20, 2021
@roll roll added feature and removed wontfix labels Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants