-
Notifications
You must be signed in to change notification settings - Fork 122
Add insert ignore #336
Add insert ignore #336
Conversation
As |
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.
Didn't check all the tests, but the added functionality is simple and easy to understand - some nitpicks apply.
* @var array Specification array | ||
*/ | ||
protected $specifications = [ | ||
self::SPECIFICATION_INSERT => 'INSERT IGNORE INTO %1$s (%2$s) VALUES (%3$s)', |
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.
Are all supported drivers capable of evaluating INSERT IGNORE
?
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.
probably MySQL only, that's why I didn't add insertIgnore()
function to Sql
and AbstractTableGateway
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.
Hmm, can we please survey that before introducing it then?
class InsertIgnore extends Insert | ||
{ | ||
/** | ||
* @var array Specification array |
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 specify the type of the array
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.
it is copied originally from Insert
class, do you have sample of "type of the array"?
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.
string[]
in this case, or even array<string, string>
(unsure if the tooling craps out with that, though)
test/unit/Sql/InsertIgnoreTest.php
Outdated
} | ||
|
||
/** | ||
* @covers \Zend\Db\Sql\InsertIgnore::into |
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.
I suggest dropping all these @covers
, ans only adding one at class level
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.
removed @covers
Thanks, @samsonasik! |
Useful to ignore duplicate entry error.
develop
branch, and submit against that branch.CHANGELOG.md
entry for the new feature.