add mysql, postgres
update docs for gem
update docs for gem
reduce some code duplication