Using pgdb connection I am passing SQL to get results into a DF which are further processed. As the module grows, python class (queries.py below) that keeps track of all the SQL is growing longer and longer. Any suggestions how to handle it as it grows longer and longer?
connection.py
import pgdb
class DBConnect:
def __init__(self, host, dbname, user, password):
pgdb.connect(host=self.host, database=self.dbname, user=self.user, password=self.password)
....
queries.py
class Queries():
def __init__(self):
return
def sql1(self):
return '''select column from ...'''
def sql2(self):
return '''select column from ...'''
....
some_module.py
import queries
import connection
import pandas
query = queries.Queries()
connect = DBConnect(host, dbname, user, password)
sql1results = pd.DataFrame(connect.executeQuery(query.sql1))
def do_something():
....