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

Show a specific error for an unintended "not null" query #223

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

walterdavis
Copy link

The same error and message is used for many different ambiguous query compositions. In the case of the has keyword, it's such a common part of speech that it could inadvertently creep into a naïve query: "walter has a big nose" might throw the same error (unless you have a column in your database named a) as many other cases. This makes it difficult to understand, since that generic error message is designed to serve so many purposes.

This PR introduces a specific error to be used for a missing or unmatched field, and the error message includes both the parent class and the specific token which has been interpreted as a field name by the query builder.

@walterdavis
Copy link
Author

Ugh. I wasn't able to run the tests locally (except for the SQLite ones). I will fix this quoting issue...

lib/scoped_search.rb Outdated Show resolved Hide resolved
Gemfile Outdated
@@ -16,4 +16,5 @@ platforms :ruby do
gem 'sqlite3'
gem 'mysql2'
gem 'pg'
gem 'mutex_m'
Copy link
Collaborator

@adamruzicka adamruzicka Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks as though I could move this into just the 6.0 and 6.1 variants of the gemfile. Not sure if that's the right way or not.

@walterdavis
Copy link
Author

Can you advise me how to configure the GH actions so I can run these on my account? Trying to peck at this, but fixing one error shows me another one.

@walterdavis
Copy link
Author

walterdavis commented Jul 16, 2024 via email

@adamruzicka
Copy link
Collaborator

Can you advise me how to configure the GH actions so I can run these on my account?

If you open a pull request from your fork against your fork, it maybe could run the tests? Or at least it seems to do so for me.

Alternatively, if you're on matrix, feel free to reach out to me (@aruzicka:matrix.org) tomorrow, I might be able to help you to get the tests to run locally

@walterdavis
Copy link
Author

I didn't have any time to look at this today, but I did sign up at matrix. I am @waltd:matrix.org. What time zone are you in? I am in EDT. I tried getting the runners to go on my fork, but I have never set any of that stuff up in this account, and the only available option seemed to be the self-hosted runner. Is that what you use?

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

Successfully merging this pull request may close these issues.

2 participants