Closed (won't fix)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Reporter:
Created:
11 Nov 2010 at 13:45 UTC
Updated:
22 Apr 2011 at 19:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
q0rban commentedComment #2
q0rban commentedHmm, looks like this is hard coded into pager as well. One kind of startling thing I just realized is that Views 3 no longer uses the pager_query function. All along I had been assuming that paged views were actually being routed to slaves in Pressflow 6, since pager_query() selects from the slave.
Comment #3
Letharion commentedComment #4
dawehnerCan't we add a wrapper for db_result, too?
One use case would be to allow to write a pgsql query backend which can query against pgsql even you are on a mysql installation.
db_result wouldn't be availible on the pager plugin, too.
Comment #5
merlinofchaos commentedViews hasn't used pager_query in years. Views 2 gave up on it very early in its development cycle due to the inability to support offset + paging. It has always used db_query_range() since Views 2 was even a little bit functional.
The patch seems safe enough. I don't see a point in wrapping db_result -- at the moment, all uses of db_result are in individual handlers, and you run db_result on top of db_query anyway, so it seems unlikely there's anything to actually change there.
dereine if you have time to commit this before I do, feel free.
Comment #6
dawehnerOkay for db_result:
There is a query plugin which allows to connect to pgsql additional. https://github.com/dereine/views_pgsql
But it needs his own pager plugin, because of this code in views_plugin_pager.inc
This patch allows to replace db_query but this still wouldn't work for this plugin, see https://github.com/dereine/views_pgsql/blob/master/views_pgsql_plugin_pa...
So here is a new version of the patch
Comment #7
q0rban commentedAh, good to know. A little bird had told me that Views 2 was using pager_query and therefore queried the db slave. Goes to show you should believe everything you hear, especially if it's a bird talking about Drupal stuff.
Comment #8
merlinofchaos commentedNow that I've thought about what this means, upgrading this to major. Changing to a task to indicate the acceptance of the feature request and the desire to get it in.
Comment #9
merlinofchaos commentedAlso this.
Comment #10
merlinofchaos commentedCommitted to 6.x-3.x. Does not apply to 7.x -- needs porting.
Comment #11
merlinofchaos commentedReassigning.
Comment #12
dawehnerI'm wondering whether this is really needed in d7.
Porting isn' this easy.
Comment #13
bojanz commentedCorrect me if I'm wrong but...
The point of this patch is to provide slave server support.
Drupal 7 has this support by default, and there are no changes needed for Views.
Quoting http://drupal.org/node/310071:
I haven't used slave servers, so there might be additional changes needed for Views (allow the user to specify a "target" in the query options that we pass to db_select?) to use slave servers properly, but that change is not the one from the patch, there's no need to abstract out the query functions another time.
So... "fixed"?
Comment #14
dawehner> I haven't used slave servers, so there might be additional changes needed for Views (allow the user to specify a "target" in the query options that we pass to db_select?) to use slave servers properly, but that change is not the one from the patch, there's no need to abstract out the query functions another time.
There is another issue already which has a patch attached and it's need review or something like this.
Would like to hear the oppinion of earl and or q0rban.
Comment #15
q0rban commentedI'm sorry, my only experience with Drupal 7 database layer at this point is dbtng module on Drupal 6, so I can't really answer these questions. :(
Comment #16
bojanz commentedI think it's safe to close this now.
Comment #17
dawehnerA somehow better status
Comment #18
merlinofchaos commentedI don't think this needs to be 'fixed' for 7.