Skip to content

Improvement? Throw error when key parameter not found #177

Open
@Zheness

Description

@Zheness

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:

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 !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions