Now I (only) need the UTXO database and check each generated address against it.
Should I extract addresses with balance from the blockchain and put them in a sql database or something?
What would be the general approach for such a thing?
Yes. You should parse blockchain and get the set of utxo.
The set is not very large.
https://statoshi.info/dashboard/db/unspent-transaction-output-setThere are ~32 mln unspent outputs today according to statoshi.info
It is quite possible to hold this set in memory in hashtable.
You can even use plain-text file for storing this data without using SQL engines.
I'm busy doing number 2.
Let us discuss number (1). I can create such engine for you. Not for free of course.