Called by MySQL and PostgreSQL plugins to write a file on the back-end DBMS underlying file system
(self, fcEncodedList)
| 102 | return sameFile |
| 103 | |
| 104 | def fileToSqlQueries(self, fcEncodedList): |
| 105 | """ |
| 106 | Called by MySQL and PostgreSQL plugins to write a file on the |
| 107 | back-end DBMS underlying file system |
| 108 | """ |
| 109 | |
| 110 | counter = 0 |
| 111 | sqlQueries = [] |
| 112 | |
| 113 | for fcEncodedLine in fcEncodedList: |
| 114 | if counter == 0: |
| 115 | sqlQueries.append("INSERT INTO %s(%s) VALUES (%s)" % (self.fileTblName, self.tblField, fcEncodedLine)) |
| 116 | else: |
| 117 | updatedField = agent.simpleConcatenate(self.tblField, fcEncodedLine) |
| 118 | sqlQueries.append("UPDATE %s SET %s=%s" % (self.fileTblName, self.tblField, updatedField)) |
| 119 | |
| 120 | counter += 1 |
| 121 | |
| 122 | return sqlQueries |
| 123 | |
| 124 | def fileEncode(self, fileName, encoding, single, chunkSize=256): |
| 125 | """ |
no test coverage detected