-
Notifications
You must be signed in to change notification settings - Fork 37
Postgres Support
I would love help with postgresql support. First, take a look at this first stab (incomplete and somewhat poor): https://github.com/nofxx/query_reviewer/commit/b735abe1b00654842a70566147d18cdaf5b31075#diff-6
Then I will link you to a few key changes that would need to be adapted for postgresql:
-
postgresql_adapter_extensions based on https://github.com/nesquena/query_reviewer/blob/master/lib/query_reviewer/mysql_adapter_extensions.rb
-
postgresql_analyzer based on https://github.com/nesquena/query_reviewer/blob/master/lib/query_reviewer/mysql_analyzer.rb
-
Fix the way extensions are included (support PG): https://github.com/nesquena/query_reviewer/blob/master/lib/query_reviewer/rails.rb#L9
-
Load PG analyzer as done here: https://github.com/nesquena/query_reviewer/blob/master/lib/query_reviewer/sql_sub_query.rb#L4 https://github.com/nesquena/query_reviewer/blob/master/lib/query_reviewer/sql_sub_query.rb#L20
-
Load new PG analyzer and extensions: https://github.com/nesquena/query_reviewer/blob/master/lib/query_reviewer.rb#L41
The real trick to this is simply adapting the extensions and the analyzer work here is adapting these two files:
- https://github.com/nesquena/query_reviewer/blob/master/lib/query_reviewer/mysql_analyzer.rb
- https://github.com/nesquena/query_reviewer/blob/master/lib/query_reviewer/mysql_adapter_extensions.rb
The rest is just properly loading PG / Mysql depending on which adapter is loaded. Again, check out https://github.com/nofxx/query_reviewer/commit/b735abe1b00654842a70566147d18cdaf5b31075 for a good base for how to start PG support.
Let me know if you have any specific questions.