-
Notifications
You must be signed in to change notification settings - Fork 1.3k
insertMulti implementation by using transactions #504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks good, but can you please remove all spacing related changes please? |
|
as well, please make function smaller by remove double \n |
|
one more observation. insertMulti() will never return false. Seems after rollback you would need to return false. As well, Please check if getLastError and getLastErrId() are returning errors from an actual failed insert() and not from rollback() |
|
Reverting the spacing changes might by a problem I look into tomorrow. I just removed some empty lines and unnecessary comments to make the actual method smaller. I'm not sure what you mean by "insertMulti() will never return false. Seems after rollback you would need to return false". The current behavior is to return an array in success, and Actual |
|
you are correct, sorry |
- MysqliDb::insertMulti() requires at least a table-name and two-dimensional array containing the data-sets - the third parameter $dataKeys can contain an array, setting|overriding the table column names in the data-sets - removes some unnecessary linebreaks and comments - fixes typo - adds insertMulti() to Readme - adds MysqliDB::insertMulti() insertion tests - removes whitespace changes
|
I've reverted all whitespace related changes with the last commit. Anything else to do?
|
|
awesome. As for whitespaces, you could just do git checkout and paste back needed code :) |
|
Well, that would be to simple!
Have a nice weekend, and thanks for merging |
this is a first implementation for
MysqliDB:: insertMulti()method to insert multiple datasets at once by utilizing mysql-transactions.Please excuse the additional changed lines in the commits, where only spaces where deleted. My Editor does this by default.
This is only a proposal and therefor may be not the best or fastest solution.
The changes include:
MysqliDB::insertMulti()method intoMysqliDb.phptests/mysqliDbTests.phpreadme.mdPlease tell, if something should be changed or does not adapt the classes coding style.