Closed (fixed)
Project:
DBTNG
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Jun 2009 at 16:35 UTC
Updated:
22 Oct 2010 at 02:10 UTC
zOMGz this rocks! :-)
That said, upon further consideration the new constructors (db_insert(), db_select(), etc.) should probably not use the dbtng_ prefix, but just db_. That way, when D7 comes out modules using this backport module will already work with the new API without needing to rename all of their methods.
Comments
Comment #1
mikey_p commentedWhich functions would you say should be left as db_ ?
I was thinking:
'db_insert',
'db_merge',
'db_update',
'db_delete',
'db_truncate',
'db_select',
'db_transaction',
Comment #2
Crell commentedThat sounds about right. Basically any that are in DBTNG but not in DB-Classic, so that modules using the dbtng module have the least amount of work to do when upgrading to D7.
Comment #3
mikey_p commentedFixed, see http://drupal.org/cvs?commit=225544.
Now I just need to roll some docs to explain this.
Comment #4
sinasalek commentedI'm not completely agree with @Crell, it might causes confusion for Drupal6 modules' next maintainers and it's not really necessary. Upgrading db functions written with DBTNG is as easy as replacing the prefix , and we will have to do the replace anyway for the other functions which should use dbtn_ prefix.
The only advantage might be a bit ease when back porting D7 modules to D6.
Comment #5
mikey_p commented@sinasalek I think the way it's split now makes the most sense. I'd say 95% of the use cases of this module are going to be using the query builder functions listed in #1, and if that is the case the DB calls should require 0 change to the code to update to D7.
Comment #6
sinasalek commented@mikey_p , mmm, i see. i checked the functions list, you're right. Thanks.
Comment #7
mikey_p commentedMarking this fixed. If anyone has any questions about how this is split or managed, look at the split script that I hacked together at http://github.com/shomeya/dbtng/blob/master/split.php.