Is it a bad idea to ask my erstwhile PI to say in a recommendation letter he "forgot" to acknowledge me in a prior work?
You should ask the professor to describe your contribution to the database and the relationship between the database and the publication.
No matter what the reason is that you are not an author on the publication, there is no benefit to including the reason in your letter of recommendation. A correction to the author list could benefit you, but only someone familiar with the details of your work could determine if that is appropriate.
Asking them directly to acknowledge "forgetting" you is a battle that you cannot win, I am afraid. However, if you approach this strategically, you can still probably get a letter that bears the same message as being acknowledged on the paper would.
From your description it seems safe to assume that your authorship was omitted accidentally. It is a sad but not entirely unusual reality that contributions of undergraduate students who helped with a large project over time can get forgotten, not out of malice but simply because nobody keeps track of who did what. Reminding the supervisor of your contributions (be as specific as you can) that ultimately led to a high-impact publication should do no harm then. If this was an honest mistake, I can imagine they will want to make it up to you.
On the other hand, failing to acknowledge contributions of co-authors is a serious academic misconduct. Admitting it openly and in writing could possibly harm your supervisor's credibility and I don't expect that this is a risk they would be willing to take just to increase your chances to get a position. If you want them to acknowledge something specific in the letter, you need to ask for something they are likely to agree to.
Consider the impact of being properly listed as a co-author of the said Nature publication. People assessing your application have a good idea how preparing such large publications work and that the success of it depends primarily on the first author / supervisor developing the original ideas and orchestrating the work. Undergraduate students often do rather the mechanical labor. From this perspective, being listed as a co-author doesn't say more than: "I have an experience from a successful lab and I can do the mechanical labor good enough."
The first part of that message is on your CV already. You can ask your supervisor to testify the other part in the recommendation letter.
It would of course be a tremendous feather in your cap to be a coauthor, even one of zillions, of an article in a prestigious journal. And even if not a coauthor, it is personally satisfying to be acknowledged. However, no one else pays much attention to acknowledgements.
What you now need to achieve is fair recognition of your contributions in the letter of reference. The facts, as you present them, support the hypothesis that the PI likely has forgotten the nature or extent of your contributions, was never wholly aware, or confused your contributions with someone else's. That happens. Regardless, every reasonable recommendation letter writer appreciates a "cheat sheet" from the recommendee, so I'd suggest you write something like:
Dear X, ... This is to request a letter of recommendation from you for ... Since it's been a couple of years, for convenience let me summarize that I worked on your team from ... to ... My principal contributions were .... and ...., which I described in my senior thesis and which was used in the publication [insert citation]. As you can imagine, given my hope for an eventual research career [or whatever], I think to the extent you are able to connect the dots between by work and the publication in particular would be very helpful.
Basically, swallow your injured pride (and don't expect any acknowledgement revisions!), but in a respectful fashion make sure the PI has the information to now be able to represent your contributions accurately. Present it factually but impersonally, implicitly assuming forgetfulness or lack of awareness, not trying to prove it with bullet-proof evidence.
Finally, I'm writing this all taking at face value the facts as you have presented them. Do be open to the possibility that your picture may not be fully complete either. Could your "database" have needed significant rework or updating, for instance? I'm not trying to challenge you and know nothing more about your situation, but after several decades in applied research, I've encountered various instances where valued but junior contributors accidentally overvalued their contributions as well.