The key idea is to traverse a tree datastructure which will map to database entities, for instance:
database my_db { int /basic/i float /basic/f string /basic/s stored /r intmap(stored) /imap }
But DbGen has support for several types of database including PostgreSQL: See for instance this blog http://www.josetteorama.com/to-sql-from-nosql/