improve docs and add sql support