Skip to content

Conversation

@BalbinoOrtus
Copy link
Contributor

No description provided.

@BalbinoOrtus BalbinoOrtus changed the title bug fix countWhere method Bug Fix countWhere method Jun 8, 2022
@BalbinoOrtus
Copy link
Contributor Author

@michaelborn @lmajano we need to tweak the countWhere( ) function so the if ( structCount( arguments ) > 1 ) { statement wraps around the entire parameter handling, including the 1 = 1 addition

@michaelborn
Copy link
Contributor

For more context, this resolves a SQL syntax error when only the entityName parameter is provided.

By only running .countWhere( entityName = "User" ), you get SQL like this:

SELECT count(id) FROM User 1 = 1

Which is obviously not valid SQL. 😭

@lmajano
Copy link
Contributor

lmajano commented Jun 27, 2022

@BalbinoOrtus before I merge this, I need a test case. @michaelborn can you assist!

@michaelborn
Copy link
Contributor

I added a test case to @BalbinoOrtus 's PR.

BalbinoOrtus#1

As soon as he merges that, it will appear in this PR here.

@BalbinoOrtus
Copy link
Contributor Author

@lmajano @michaelborn merged the test case

@lmajano lmajano merged commit 62359e8 into coldbox-modules:development Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants