Skip to content
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

PostgreSQL support #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

PostgreSQL support #63

wants to merge 3 commits into from

Conversation

yak
Copy link

@yak yak commented Feb 27, 2013

Hi Paul,

Many thanks for your work. About a year and a half ago, I added support for PostgreSQL for profiling a production backend by hacking the source with a sledge hammer. I now decided to sit down and see what it would take to add proper support which could be pushed back to trunk using the budding new database abstraction layer. This is it. Changes were required in quite a few places and as such this patch is likely to break at least some pull requests which have not been merged in. I would appreciate any comments you have and will be happy to clean things up further as needed should you wish to merge.

Keep up the great work!
-Kris

remaining MySQL specifics found here and there. MySQL and PostgreSQL
seem to be working nicely now, further testing is encouraged. MS SQL and
SQL Server seemed broken from the outset and no effort has been made to
fix them as I do not have access to either. Inconsistent line endings in
the code base and having a mix of spaces and tabs in some places makes
the diff a little less clean than one would wish.

Main changes:

 * added PostgreSQL database abstraction class

 * MySQL purging: abstract out the identifier quote style to remove hardcoded MySQL
   backticks, abstract out FROM_UNIXTIME, remove MySQL schema doc from
   XHProfRuns_Default, use explicit aliases in getRunComparativeData() to
   not rely on implicit MySQL aggregate column naming.

 * Fix method declarations and some variable issues in the database
   abstractions which leads me to believe that not all of the database
   classes actually work. Added notes about remaining portability issues
   for other databases than MySQL and PostgreSQL.

 * Remove unused dir property and constructor param from
   XHProfRuns_Default. This is a left-over from the Facebook file
   backend and there should be no compelling reason to retain it
   anymore.

Cosmetics/refactorings:

 * centralized (un)serializing, made things a bit DRYer

 * Use XHPROF_LIB_ROOT everywhere in index.php.

 * fix typos here and there.

 * declare xhprof global in the header and footer includes too to
   fix scope when including files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant