update to v2 sql api

Please update the SQL API to v2, thanks!