class_docstr: SQLite3 TaskRecord backend.
docstr: Connect to the database and get new session number.
docstr_tok: ["Connect","to","the","database","and","get","new","session","number","."]
code: def _init_db(self):
      """Connect to the database and get new session number."""
      # register adapters
      sqlite3.register_adapter(dict, _adapt_dict)
      sqlite3.register_converter("dict", _convert_dict)
      sqlite3.register_adapter(list, _adapt_bufs)
      sqlite3.register_converter("bufs", _convert_bufs)
      sqlite3.register_adapter(datetime, _adapt_timestamp)
      sqlite3.register_converter("timestamp", _convert_timestamp)
      # connect to the db
      dbfile = os.path.join(self.location, self.filename)
      self._db = sqlite3.connect(
          dbfile,
          detect_types=sqlite3.PARSE_DECLTYPES,
          # isolation_level = None)#,
          cached_statements=64,
      )
      # print dir(self._db)
      first_table = previous_table = self.table
      i = 0
      while not self._check_table():
          i += 1
          self.table = first_table + "_%i" % i
          self.log.warning(
              "Table %s exists and doesn't match db format, trying %s"
              % (previous_table, self.table)
          )
          previous_table = self.table
  
      self._db.execute(
          """CREATE TABLE IF NOT EXISTS '%s'
                  (msg_id text PRIMARY KEY,
                  header dict text,
                  metadata dict text,
                  content dict text,
                  buffers bufs blob,
                  submitted timestamp,
                  client_uuid text,
                  engine_uuid text,
                  started timestamp,
                  completed timestamp,
                  resubmitted text,
                  received timestamp,
                  result_header dict text,
                  result_metadata dict text,
                  result_content dict text,
                  result_buffers bufs blob,
                  queue text,
                  execute_input text,
                  execute_result text,
                  error text,
                  stdout text,
                  stderr text)
                  """
          % self.table
      )
      self._db.commit()
  
imports: import json
  import os
  from datetime import datetime
  from dateutil.parser import parse
  from tornado import ioloop
  from traitlets import Dict, Instance, List, Unicode
  from ..util import ensure_timezone, extract_dates
  from .dictdb import BaseDB
label_desc: Use image node_id 5 for calling the SQLiteDB obj's underlying member method code with example usage: obj._init_db() without return types