When you take a look at Helper::get_products() you will find that I've limited the number of unique vendors and categories to a hundred results each. That's just for the sake of creating key-collision so the update part of the query is fired to, demonstrating the desired behaviour. (Albeit only accumulating data at this point)

Then we've got the Extractor(cue dramatic music)
It's whole purpose is just to extract the meta-info from the API's data, induce the assembly of the query string, and initiate the lookup optimization.

...sigh.

Yeah, and then there's the weird uncle at the family reunion, that no one is sure of his actual relation to your family. He also stinks, and doesn't like you.

Ladies and gentlemen, please welcome: the Database-Emulator!

I can't quite explain what led my to produce this piece of... this thing. But hey! It does it's job!

It emulates an extremely reduced subset of a DBMS, taking an actual SQL-Query, extracting the wanted data from it, and storing it in a projection of what should've been some sort of Relational DBMS scheme.

Also, not wanting to overcomplicate it too much, I just gave it a few quick'n'dirty shorthand methods, to make it obey. :)

As I said, check the source! It's always fun to see, what the human brain comes up with, when you're actually drifting into insanity. :D