@ajc a database system typically has some sort of meta data information you can query. In the case of H2 it is INFORMATION_SCHEMA.
With big data it can be DESCRIBE (EXTENDED)
So if you know how to access the structure you can extract the information.