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

Method _get_cursor

lib/utils/hashdb.py:40–55  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

38 self._last_flush_time = time.time()
39
40 def _get_cursor(self):
41 threadData = getCurrentThreadData()
42
43 if threadData.hashDBCursor is None:
44 try:
45 connection = sqlite3.connect(self.filepath, timeout=10, isolation_level=None, check_same_thread=False)
46 self._connections.append(connection)
47 threadData.hashDBCursor = connection.cursor()
48 threadData.hashDBCursor.execute("CREATE TABLE IF NOT EXISTS storage (id INTEGER PRIMARY KEY, value TEXT)")
49 connection.commit()
50 except Exception as ex:
51 errMsg = "error occurred while opening a session "
52 errMsg += "file '%s' ('%s')" % (self.filepath, getSafeExString(ex))
53 raise SqlmapConnectionException(errMsg)
54
55 return threadData.hashDBCursor
56
57 def _set_cursor(self, cursor):
58 threadData = getCurrentThreadData()

Callers

nothing calls this directly

Calls 7

getCurrentThreadDataFunction · 0.90
getSafeExStringFunction · 0.90
commitMethod · 0.80
connectMethod · 0.45
appendMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected