Does a field preprocessing (if needed) based on its type (e.g. image to text) Note: used primarily in dumping of custom tables
(self, table, field)
| 655 | return rootQuery.concatenate.query % (first, second) |
| 656 | |
| 657 | def preprocessField(self, table, field): |
| 658 | """ |
| 659 | Does a field preprocessing (if needed) based on its type (e.g. image to text) |
| 660 | Note: used primarily in dumping of custom tables |
| 661 | """ |
| 662 | |
| 663 | retVal = field |
| 664 | if conf.db and table and conf.db in table: |
| 665 | table = table.split(conf.db)[-1].strip('.') |
| 666 | try: |
| 667 | columns = kb.data.cachedColumns[safeSQLIdentificatorNaming(conf.db)][safeSQLIdentificatorNaming(table, True)] |
| 668 | for name, type_ in columns.items(): |
| 669 | if type_ and type_.upper() in DUMP_DATA_PREPROCESS.get(Backend.getDbms(), {}) and name == field: |
| 670 | retVal = DUMP_DATA_PREPROCESS[Backend.getDbms()][type_.upper()] % name |
| 671 | break |
| 672 | except KeyError: |
| 673 | pass |
| 674 | return retVal |
| 675 | |
| 676 | def concatQuery(self, query, unpack=True): |
| 677 | """ |