Closed BalbinoOrtus closed 2 years ago
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. :sob:
@BalbinoOrtus before I merge this, I need a test case. @michaelborn can you assist!
I added a test case to @BalbinoOrtus 's PR.
https://github.com/BalbinoOrtus/cborm/pull/1
As soon as he merges that, it will appear in this PR here.
@lmajano @michaelborn merged the test case
@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