Create a table using a list of column definitions given in columndefs. generator must be a function taking arguments (row_number, col_number) returning a suitable data object for insertion into the table.
(self, columndefs)
| 65 | i = i + 1 |
| 66 | |
| 67 | def create_table(self, columndefs): |
| 68 | """Create a table using a list of column definitions given in |
| 69 | columndefs. |
| 70 | |
| 71 | generator must be a function taking arguments (row_number, |
| 72 | col_number) returning a suitable data object for insertion |
| 73 | into the table. |
| 74 | |
| 75 | """ |
| 76 | self.table = self.new_table_name() |
| 77 | self.cursor.execute( |
| 78 | "CREATE TABLE %s (%s) %s" |
| 79 | % (self.table, ",\n".join(columndefs), self.create_table_extra) |
| 80 | ) |
| 81 | |
| 82 | def check_data_integrity(self, columndefs, generator): |
| 83 | # insert |