My code is:
import wrds
db = wrds.Connection()
compustatq = db.raw_sql("""
select *
from comp.fundq
""")
compustatq.to_csv('path.csv',index=False)
The problem is that the dataset is so large that I run out of RAM memory. I was therefore thinking if it is possible to download/save the data directly on the disk? Hence, avoiding the 2 step procedure of downloading into a dataframe and then exporting to a csv file.