'''

@author: olivier.massot, 2018
'''
from core.db import PostgresDb, OracleDb


class ANTDb_0(OracleDb):
    dsn = "DRIVER={Oracle dans OraClient11g_home1};"
    db = "SIGCG50"
    user = "SIG_REFERENTIEL"
    pwd = "Zl20ENUweN6"
    def __init__(self, **kwargs):
        super(ANTDb_0, self).__init__(dbq=self.db, uid=self.user, pwd=self.pwd, **kwargs)

class ANTDb(PostgresDb):
    server = "clusterpg.linux.infra.cloud.local"
    port="5432"
    db = "sig50"
    user = "sigr"
    pwd = "T38Msh2R4q"
    def __init__(self, **kwargs):
        super(ANTDb, self).__init__(server=self.server, dbname=self.db, user=self.user, pwd=self.pwd, **kwargs)


if __name__ == "__main__":
    ant_db = ANTDb_0()
    print([row[0] for row in ant_db.read("SELECT CODE_INSEE FROM SIG_REFERENTIEL.ADM_CD50_COM;")])
#     print([row[0] for row in ant_db.read("SELECT code_insee FROM sig_referentiel.admn_cd50_com;")])