Have you considered if you can work with SQLite? It's the defacto standard in "SQL on files", but it doesn't sound like it's a drop in solution.

Matthew