OK. So are you also having to implement the database itself? Does that give you control over the RDBMS you use on the backend?
If you get to design the database, you get to make things possible. If you are handed a database to query against, then you can discover the list of tables, hopefully programmaticly. One can hope that the relationships can also be discovered on the fly.