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

Cannot read property 'COLUMN_NAME' of undefined #40

Open
aidenfoxx opened this issue May 2, 2021 · 2 comments
Open

Cannot read property 'COLUMN_NAME' of undefined #40

aidenfoxx opened this issue May 2, 2021 · 2 comments

Comments

@aidenfoxx
Copy link
Contributor

When calling columnInfo with a table and column name, if the search query returns undefined the function throws Cannot read property 'COLUMN_NAME' of undefined when mapping the response to Column.

This can be easily fixed, but it feels like we should consider what return type we want in this scenario. Personally I think columnInfo should return Column | undefined in this instance, but this would be a breaking change.

@rijkvanzanten
Copy link
Collaborator

Should we return null/undefined, or throw an error that the table/column name is invalid? In the last case, it wouldn't be a breaking change

@aidenfoxx
Copy link
Contributor Author

I personally feel like this function should return undefined, which lines up more with how other knex functions operate. But I also don't think it's worth doing a major increment just to make things a bit nicer! So probably best to just throw an error for now.

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

No branches or pull requests

2 participants