publish event when executing sql