first attempt at SQL export