db.mapper: auto-register struct at encoder/decoder definition