You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know if it's possible to throw an error to indicates that a key has not been found in the parameter list ?
For example:
return$this->find('foo = :foo AND bar = :bar AND baz = :baz', [
'foo' => 42,
'baar' => 'Wrong key',
'baz' => null
]);
In my code, I expect a key bar that is not provided, and would like to throw an error because my query will be wrongly executed if i mistype a parameter key.
I understand that when a value is null, it should work properly by removing the condition internally. But I expect that for not found key, it should not behave like that.
Is there any way to avoid the query to be executed if a key is missing ?
Thank you !
The text was updated successfully, but these errors were encountered:
This is an interesting idea but that would be a huge BC break (as people using the current API may rely on the fact that "a key is absent = a key is null")
This should actually be pushed down to the mouf/magic-query package. From there, we can add a "strict" option and we could add a "strict" mode in TDBM that uses magic-query strict mode.
Hello !
I would like to know if it's possible to throw an error to indicates that a key has not been found in the parameter list ?
For example:
In my code, I expect a key
bar
that is not provided, and would like to throw an error because my query will be wrongly executed if i mistype a parameter key.I understand that when a value is
null
, it should work properly by removing the condition internally. But I expect that for not found key, it should not behave like that.Is there any way to avoid the query to be executed if a key is missing ?
Thank you !
The text was updated successfully, but these errors were encountered: