Integrate database into posts.
Also added integration testing.

Signed-off-by: Se7enChat <se7enchat@zoho.com>