How to operate two tables with Kong plugins api(1.2.1)

My plugin needs to visit two tables(association query with custom sql ), I can not find api or an example . Can anyone help me ?