Welcome Guest, Not a member yet? Register   Sign In
nice to have before and after for insertBatch
#1

Hello, 
Would be nice to have in modal's beforeInsertBatch and afterInsertBatch. I'm seeing insertBatch very usefull for large imports and having also the ability to manipultate the data before inserting would be a great thing. 
In this moment I'm using db->insert() just because I have afterInsert hook, and takes 18 seconds to do it from a loop. while with insertBatch I get 600ms response time. 
Thank you
Reply
#2

Great idea! I could see that being highly useful. I don’t think this would be difficult to add, seeing as all the code is already there it just needs to be adapted for the “batch” methods. Would you be willing to try creating a Pull Request?
Reply
#3

Hi, there will also nice event point from following place.
- before query
- before commit
- after commit
- before render (after controller)
- exception (before render)
If have those event points, will very helpful and more flexible
Reply
#4

$beforeInsertBatch, $afterInsertBatch, $beforeUpdateBatch and $afterUpdateBatch can be used since v4.3.0.
https://codeigniter4.github.io/CodeIgnit...del-events
Reply




Theme © iAndrew 2016 - Forum software by © MyBB