[DataAccess] Update implemented in query builder

Review Request #40 — Created Jan. 15, 2013 and submitted

Felipe
Lunr
https://github.com/madsmash/lunr/tree/sessionDAO
lunr
Created functions to enable UPDATE queries in queryBuilder
Unit tests
Used already in AMC, it works! (except for the part where you have to deal with wildcards not being wildcards and equals and shit...)

Depends on http://reviews.lunr.nl/r/37/
  • 0
  • 0
  • 4
  • 0
  • 4
Description From Last Updated
Felipe
olivier
  1. 
      
  2. src/Lunr/DataAccess/DatabaseDMLQueryBuilder.php (Diff revision 1)
     
     
     
     
     
     
    Maybe making use of array_push here like for get_select_query?
    1. Nah.. I would need to change then get_replace_query, get_delete_query, get_insert_query..... Select is the special case here
  3. 
      
olivier
  1. 
      
  2. src/Lunr/DataAccess/DatabaseDMLQueryBuilder.php (Diff revision 1)
     
     
     
     
     
     
    Looks like it is already partially made in get_delete_query. for replace and insert the need i less important but maybe we should try to uniformize.
    1. I don't think changes on those functions belong to this branch. You may want to create a new task in chilli->M2mobi->Backend->Lunr to refactor the query builder in order to use array_push() in all those functions.
      
      Then I will assign it to you :)
    2. Sorry, I'm with Olivier here. array_push performs better than [] when you add more than once or twice, that's why I adjusted it in the other methods.
      So, yes, please use array_push here too :)
    3. You'll never get your ship it by acting this way you know!
      But it is a democratic decision...
  3. 
      
Felipe
olivier
  1. - moderated
  2. 
      
pprkut
  1. Missing entries in the DMLQueryBuilderInterface
  2. you fixed the one above, but left this one alone :)
    1. What are you talking about? line 345 is the one I modified to use array_push()
    2. I mean the spacing before the =
    3. Ok, thought it was related to array_push()
  3. src/Lunr/DataAccess/MySQLDMLQueryBuilder.php (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    That belongs further up in the file, at least above select, ideally before insert_mode
    1. How do I know this? what do you base on to decide the position of the methods?
    2. The methods are in the same order as they appear in the interface. The interface is order according to the order of the statements within an SQL query.
      Like this "select" would start the block of methods used for select queries, yet the next method after is "update_mode". That doesn't make finding methods very intuitive.
    3. check
  4. 
      
Felipe
Felipe
Review request changed

Status: Closed (submitted)

Change Summary:

Merged into master
Loading...