I have something that I'm trying to do that is probably against the norm, but here is what I'm doing.
I am loading a huge amount of data into the database within Laravel. Since the data is so massive (potentially millions of records in one file), I would run into memory errors if I looped it naturally. Since I'm using MySQL, I decided to use the Load Infile option. So, to do this within Laravel I did this (keeping in mind I'm keeping this example simple, I have a number of checks and what not):
$query = "LOAD DATA INFILE..."
DB::getPdo()->exec($query);
This works perfect, data gets loaded in. The problem I'm having is that I don't know how to grab the response in this context. I would like to try and log any error (or any response at all if I can). I could do it in straight PDO, but I'm not sure how using Laravel's methods. Or even if it's possible. If anyone has ran into this before and has a suggestion, that would be great.
Thank you.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community