MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / __init__

Method __init__

lib/core/replication.py:56–70  ·  view source on GitHub ↗
(self, parent, name, columns=None, create=True, typeless=False)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 4

executeMethod · 0.95
getSafeExStringFunction · 0.90

Tested by

no test coverage detected