Add generateBatch method to db API.

Fix #61.

:rocket: