-
Notifications
You must be signed in to change notification settings - Fork 892
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
Add optional $params argument to query/execute adapter methods #1962
Add optional $params argument to query/execute adapter methods #1962
Conversation
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
This is marked as a draft as I've still got some amount of work to do to get this to work, and add tests across all adapters, but wanted input from @dereuromark, @garas, @Roy-Orbison that this would work for everyone's needs / expectations. |
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
This will cover most use cases. All other problems/features I raised are voided by that fact that, when using the connection directly, one can call the |
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
…inx into mpeveler-feat-query-params
@dereuromark alright, finally returned to this and got it working, and should be ready for review, with fixed test case, and have also added to the docs for this. |
Closes #1954
This allows a new optional parameter to the
query
andexecute
adapter methods to allow you to pass in an array of parameters to be used in a prepared query on the underlying PDOAdapter. It's assume that custom adapters people may implement will also have some mechanism of utilizing a concept of prepared queries. To maintain backwards compatibility, if the optional parameter is empty, then we use the directexec()
andquery()
methods on the connection to maintain support for executing multiple queries in one go.The aim here was to keep the return result for the two methods consistent with that's there, just adding the optional parameter. This is then also exposed upwards in the
MigrationInterface
andSeedInterface
classes.