(self, parent, name, columns=None, create=True, typeless=False)
| 54 | """ |
| 55 | |
| 56 | def __init__(self, parent, name, columns=None, create=True, typeless=False): |
| 57 | self.parent = parent |
| 58 | self.name = unsafeSQLIdentificatorNaming(name) |
| 59 | self.columns = columns |
| 60 | if create: |
| 61 | try: |
| 62 | self.execute('DROP TABLE IF EXISTS "%s"' % self.name) |
| 63 | if not typeless: |
| 64 | self.execute('CREATE TABLE "%s" (%s)' % (self.name, ','.join('"%s" %s' % (unsafeSQLIdentificatorNaming(colname), coltype) for colname, coltype in self.columns))) |
| 65 | else: |
| 66 | self.execute('CREATE TABLE "%s" (%s)' % (self.name, ','.join('"%s"' % unsafeSQLIdentificatorNaming(colname) for colname in self.columns))) |
| 67 | except Exception as ex: |
| 68 | errMsg = "problem occurred ('%s') while initializing the sqlite database " % getSafeExString(ex, UNICODE_ENCODING) |
| 69 | errMsg += "located at '%s'" % self.parent.dbpath |
| 70 | raise SqlmapGenericException(errMsg) |
| 71 | |
| 72 | def insert(self, values): |
| 73 | """ |
nothing calls this directly
no test coverage detected