(self)
| 934 | |
| 935 | @stackedmethod |
| 936 | def getSchema(self): |
| 937 | infoMsg = "enumerating database management system schema" |
| 938 | logger.info(infoMsg) |
| 939 | |
| 940 | try: |
| 941 | pushValue(conf.db) |
| 942 | pushValue(conf.tbl) |
| 943 | pushValue(conf.col) |
| 944 | |
| 945 | kb.data.cachedTables = {} |
| 946 | kb.data.cachedColumns = {} |
| 947 | |
| 948 | self.getTables() |
| 949 | |
| 950 | infoMsg = "fetched tables: " |
| 951 | infoMsg += ", ".join(["%s" % ", ".join("'%s%s%s'" % (unsafeSQLIdentificatorNaming(db), ".." if Backend.isDbms(DBMS.MSSQL) or Backend.isDbms(DBMS.SYBASE) else '.', unsafeSQLIdentificatorNaming(_)) if db else "'%s'" % unsafeSQLIdentificatorNaming(_) for _ in tbl) for db, tbl in kb.data.cachedTables.items()]) |
| 952 | logger.info(infoMsg) |
| 953 | |
| 954 | for db, tables in kb.data.cachedTables.items(): |
| 955 | for tbl in tables: |
| 956 | conf.db = db |
| 957 | conf.tbl = tbl |
| 958 | |
| 959 | self.getColumns() |
| 960 | finally: |
| 961 | conf.col = popValue() |
| 962 | conf.tbl = popValue() |
| 963 | conf.db = popValue() |
| 964 | |
| 965 | return kb.data.cachedColumns |
| 966 | |
| 967 | def _tableGetCount(self, db, table): |
| 968 | if not db or not table: |
no test coverage detected