import psycopg2
from decouple import config
import pandas as pd
import dbconnect

cursor, connection = dbconnect.connect_to_db()
sql = """
SELECT "table_name","column_name", "data_type", "table_schema"
FROM INFORMATION_SCHEMA.COLUMNS
WHERE "table_schema" = 'public'
ORDER BY table_name  
"""
df = pd.read_sql(sql, con=connection)
print(df.to_string())
[((6, 21, 6, 46), 'dbconnect.connect_to_db', 'dbconnect.connect_to_db', ({}, {}), '()', False, 'import dbconnect\n'), ((13, 5, 13, 37), 'pandas.read_sql', 'pd.read_sql', (), '', True, 'import pandas as pd\n')]