added direct SQL support