(self)
| 72 | kb.data.cachedStatements = [] |
| 73 | |
| 74 | def getCurrentDb(self): |
| 75 | infoMsg = "fetching current database" |
| 76 | logger.info(infoMsg) |
| 77 | |
| 78 | query = queries[Backend.getIdentifiedDbms()].current_db.query |
| 79 | |
| 80 | if not kb.data.currentDb: |
| 81 | kb.data.currentDb = unArrayizeValue(inject.getValue(query, safeCharEncode=False)) |
| 82 | |
| 83 | if not kb.data.currentDb and Backend.isDbms(DBMS.VERTICA): |
| 84 | kb.data.currentDb = VERTICA_DEFAULT_SCHEMA |
| 85 | |
| 86 | if Backend.getIdentifiedDbms() in (DBMS.ORACLE, DBMS.DB2, DBMS.PGSQL, DBMS.MONETDB, DBMS.DERBY, DBMS.VERTICA, DBMS.PRESTO, DBMS.MIMERSQL, DBMS.CRATEDB, DBMS.CACHE, DBMS.FRONTBASE): |
| 87 | warnMsg = "on %s you'll need to use " % Backend.getIdentifiedDbms() |
| 88 | warnMsg += "schema names for enumeration as the counterpart to database " |
| 89 | warnMsg += "names on other DBMSes" |
| 90 | singleTimeWarnMessage(warnMsg) |
| 91 | elif Backend.getIdentifiedDbms() in (DBMS.ALTIBASE, DBMS.CUBRID): |
| 92 | warnMsg = "on %s you'll need to use " % Backend.getIdentifiedDbms() |
| 93 | warnMsg += "user names for enumeration as the counterpart to database " |
| 94 | warnMsg += "names on other DBMSes" |
| 95 | singleTimeWarnMessage(warnMsg) |
| 96 | |
| 97 | return kb.data.currentDb |
| 98 | |
| 99 | def getDbs(self): |
| 100 | if len(kb.data.cachedDbs) > 0: |
no test coverage detected