Can tqdm be used with Database Reads? Can tqdm be used with Database Reads? pandas pandas

Can tqdm be used with Database Reads?


Edit: Answer may be misleading - chunksize has no effect on database side of the operation. See comments below.

You could use the chunksize parameter to do something like this:

chunks = pd.read_sql('SELECT * FROM table', con=conn, chunksize=100)df = pd.DataFrame()for chunk in tqdm(chunks):    df = pd.concat([df, chunk])

I think this would use less memory as well.