-
Notifications
You must be signed in to change notification settings - Fork 442
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
query profiling support #133
Comments
We're using PDO prepared statements which means we don't have access to the SQL generated w/ values @ logging time. The only way to get around this would be to add substitution to the SQL prior to logging. Would you like to take a stab at this? |
I've managed to to something of that flavour: https://github.com/greut/php-activerecord/compare/gh133-profiling How the values are serialized could be improved if any of you have a better idea. |
@greut, nice! Haven't had a chance to give it a try, but that's about what I was thinking. Not too concerned about the values as long as they're in included; it's enough to reconstruct the queries later. Another option would be allowing the user to throw in some kind of shim in the vein of http://daveyshafik.com/archives/605-debugging-pdo-prepared-statements.html, which would keep the project code from getting too bloated with extra conditionals. I didn't find a good way to roll that in without patching Connection. |
@faulkner PHP ActiveRecord uses only |
I've added some tests on the logging which wasn't tested. |
Can this be merged to master ? |
Closing this as a dup of #363 |
I'd like to be able to profile queries in ways similar to Zend_Db and Doctrine.
Was going to just pipe the logger though Zend_Db_Profiler, but the logging calls are made before variable substitution (a bug in itself, IMO).
The text was updated successfully, but these errors were encountered: