Loading envfile +5 −5 Original line number Diff line number Diff line DATABASE_HOST=postgres DATABASE_DB=postgres DATABASE_PORT=5432 DATABASE_USER=postgres DATABASE_PW=postgres DATABASE_HOST_PG=postgres DATABASE_DB_PG=postgres DATABASE_PORT_PG=5432 DATABASE_USER_PG=postgres DATABASE_PW_PG=postgres DATABASE_TIMEOUT=60 DATABASE_LOG_FILE=/tmp/test.log DATABASE_LOG_MODE=w Loading envfile_mssql +5 −5 Original line number Diff line number Diff line DATABASE_HOST=mssql DATABASE_DB=CommonDB DATABASE_PORT=1433 DATABASE_USER=sa DATABASE_PW=5nowDog5 DATABASE_HOST_MS=mssql DATABASE_DB_MS=CommonDB DATABASE_PORT_MS=1433 DATABASE_USER_MS=sa DATABASE_PW_MS=5nowDog5 DATABASE_TIMEOUT=60 DATABASE_LOG_FILE=/tmp/test.log DATABASE_LOG_MODE=w Loading src/common/database.py +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ class Database(ABC): :note: File logging is disabled by default. """ DEFAULT_TIMEOUT = ce('DATABASE_TIMEOUT', 60) DEFAULT_DB = ce('DATABASE_DB', 'postgres') DEFAULT_USER = ce('DATABASE_USER', 'postgres') DEFAULT_PW = ce('DATABASE_PW', 'postgres') Loading @@ -58,6 +57,7 @@ class Database(ABC): DEFAULT_PORT = int(ce('DATABASE_PORT', 5432)) DEFAULT_SCHEMA = ce('DATABASE_SCHEMA', 'public') DEFAULT_ENGINE = ce('DATABASE_ENGINE', 'postgresql') DEFAULT_TIMEOUT = ce('DATABASE_TIMEOUT', 60) DEFAULT_LOG_PATH = ce('DATABASE_LOG_FILE', '') DEFAULT_LOG_MODE = ce('DATABASE_LOG_MODE', 'a') DEFAULT_LOG_ENCODING = ce('DATABASE_LOG_ENCODING', 'utf-8') Loading src/common/env.py +4 −0 Original line number Diff line number Diff line Loading @@ -38,3 +38,7 @@ def check_environment(env_var, default=None): if env_var in locals(): return locals()[env_var] return default def check_multi_environment(env_var1, default1=None, env_var2, default2=None): return No newline at end of file src/common/mixins/mssql.py +1 −2 Original line number Diff line number Diff line #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Allow opening with a pymssql connection.""" from common.env import check_environment as ce import pymssql import traceback import logging Loading @@ -11,7 +11,6 @@ class MSSQLMixin(): """Provides a convenient API-like interface to Microsoft SQL databases. The database object is the interface to the database. """ def __del__(self): """ Close the connection to database. Ensure function call is superior to Database i.e: Loading Loading
envfile +5 −5 Original line number Diff line number Diff line DATABASE_HOST=postgres DATABASE_DB=postgres DATABASE_PORT=5432 DATABASE_USER=postgres DATABASE_PW=postgres DATABASE_HOST_PG=postgres DATABASE_DB_PG=postgres DATABASE_PORT_PG=5432 DATABASE_USER_PG=postgres DATABASE_PW_PG=postgres DATABASE_TIMEOUT=60 DATABASE_LOG_FILE=/tmp/test.log DATABASE_LOG_MODE=w Loading
envfile_mssql +5 −5 Original line number Diff line number Diff line DATABASE_HOST=mssql DATABASE_DB=CommonDB DATABASE_PORT=1433 DATABASE_USER=sa DATABASE_PW=5nowDog5 DATABASE_HOST_MS=mssql DATABASE_DB_MS=CommonDB DATABASE_PORT_MS=1433 DATABASE_USER_MS=sa DATABASE_PW_MS=5nowDog5 DATABASE_TIMEOUT=60 DATABASE_LOG_FILE=/tmp/test.log DATABASE_LOG_MODE=w Loading
src/common/database.py +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,6 @@ class Database(ABC): :note: File logging is disabled by default. """ DEFAULT_TIMEOUT = ce('DATABASE_TIMEOUT', 60) DEFAULT_DB = ce('DATABASE_DB', 'postgres') DEFAULT_USER = ce('DATABASE_USER', 'postgres') DEFAULT_PW = ce('DATABASE_PW', 'postgres') Loading @@ -58,6 +57,7 @@ class Database(ABC): DEFAULT_PORT = int(ce('DATABASE_PORT', 5432)) DEFAULT_SCHEMA = ce('DATABASE_SCHEMA', 'public') DEFAULT_ENGINE = ce('DATABASE_ENGINE', 'postgresql') DEFAULT_TIMEOUT = ce('DATABASE_TIMEOUT', 60) DEFAULT_LOG_PATH = ce('DATABASE_LOG_FILE', '') DEFAULT_LOG_MODE = ce('DATABASE_LOG_MODE', 'a') DEFAULT_LOG_ENCODING = ce('DATABASE_LOG_ENCODING', 'utf-8') Loading
src/common/env.py +4 −0 Original line number Diff line number Diff line Loading @@ -38,3 +38,7 @@ def check_environment(env_var, default=None): if env_var in locals(): return locals()[env_var] return default def check_multi_environment(env_var1, default1=None, env_var2, default2=None): return No newline at end of file
src/common/mixins/mssql.py +1 −2 Original line number Diff line number Diff line #!/usr/bin/env python3 # -*- coding: utf-8 -*- """Allow opening with a pymssql connection.""" from common.env import check_environment as ce import pymssql import traceback import logging Loading @@ -11,7 +11,6 @@ class MSSQLMixin(): """Provides a convenient API-like interface to Microsoft SQL databases. The database object is the interface to the database. """ def __del__(self): """ Close the connection to database. Ensure function call is superior to Database i.e: Loading