improve sql support