wrap sql execution