-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Zend/Db/Sql/Insert - implement insert into select construction #5260
Zend/Db/Sql/Insert - implement insert into select construction #5260
Conversation
@Maks3w see my comment in your PR |
@Maks3w updated. |
@turrsis Could you highlight your changes? Seems that you'v added more stuff since my last review |
@Maks3w this PR was rebased to top develop branch and changed self to static in this lines: |
* | ||
* @param string|TableIdentifier $table | ||
* @return Insert | ||
*/ | ||
public function into($table) | ||
{ | ||
$this->table = $table; | ||
if ($table instanceof \Zend\Db\Sql\Ddl\CreateTable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a use
for this.
After chewing over this, I think I'd feel better if this was a class of its own. This feels like a mostly different responsibility, one which I think most people would not directly associate with the normal use cases of INSERT. That said, what if we created a class called |
To my mind this is the same responsibility - http://en.wikipedia.org/wiki/Insert_(SQL)
As simple user i want put in |
Sold. Good arguments, I'll merge to develop. |
Question on the API though- while I like |
@ralphschindler That's what you've suggested? |
Yeah, I think that looks pretty good. |
@ralphschindler Can you merge this, if ok? |
@ralphschindler Based on your comments, I'm marking this for 2.3.0. Change the milestone if you feel differently. |
@turrsis Overall I like this, but I think it makes sense (until 3.0) to just use the protected $values to house the Select object. Also, (to that effect), I think it makes sense that values() accepts the Select object. I am going to start working on these small changes and unit tests to merge, unless you have an immediate objection. |
Merge branch 'feature/5260-db-insert-with-select' into develop * feature/5260-db-insert-with-select: Zend\Db\Sql\Insert * Added exceptions to Insert for Select/array inconsistencies * reverted property back to 'values' * CS fixes * Additional tests optimize API implement INSERT INTO SELECT construction
recreate the #5143