Skip to content

Commit

Permalink
Update connection_manager.py
Browse files Browse the repository at this point in the history
support kingbase database
  • Loading branch information
zhouziyang2012 authored Dec 11, 2020
1 parent ea0b3d4 commit afddd4b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DatabaseLibrary/connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ def connect_to_database(self, dbapiModuleName=None, dbName=None, dbUsername=None
host=dbHost,
port=dbPort
)
elif dbapiModuleName in ["ksycopg2"]:
dbPort = dbPort or 54321
logger.info('Connecting using : %s.connect(database=%s, user=%s, password=%s, host=%s, port=%s) ' % (
dbapiModuleName, dbName, dbUsername, dbPassword, dbHost, dbPort))
self._dbconnection = db_api_2.connect(database=dbName, user=dbUsername, password=dbPassword, host=dbHost,
port=dbPort)
else:
logger.info('Connecting using : %s.connect(database=%s, user=%s, password=%s, host=%s, port=%s) ' % (dbapiModuleName, dbName, dbUsername, dbPassword, dbHost, dbPort))
self._dbconnection = db_api_2.connect(database=dbName, user=dbUsername, password=dbPassword, host=dbHost, port=dbPort)
Expand Down

0 comments on commit afddd4b

Please sign in to comment.