tools/perf/cli_tools/soundwave/tables/__init__.py
def DbSession(filename):
  """Context manage a session with a database connection.

  Ensures that tables have been initialized.
  """
  if filename != ':memory:':
    parent_dir = os.path.dirname(filename)
    if not os.path.exists(parent_dir):
      os.makedirs(parent_dir)
  con = sqlite3.connect(filename)
  try:
    # Tell sqlite to use a write-ahead log, which drastically increases its
    # concurrency capabilities. This helps prevent 'database is locked'
    # exceptions when we have many workers writing to a single database. This
    # mode is sticky, so we only need to set it once and future connections
    # will automatically use the log. More details are available at
    # https://www.sqlite.org/wal.html.
    con.execute('PRAGMA journal_mode=WAL')
    _CreateTablesIfNeeded(con)
    yield con
  finally:
    con.close()
Context manage a session with a database connection.

  Ensures that tables have been initialized.
  
Context manage a session with a database connection.
Ensures that tables have been initialized.
Context manage a session with a database connection . Ensures that tables have been initialized .
def DbSession(filename):
  if filename != ':memory:':
    parent_dir = os.path.dirname(filename)
    if not os.path.exists(parent_dir):
      os.makedirs(parent_dir)
  con = sqlite3.connect(filename)
  try:
    con.execute('PRAGMA journal_mode=WAL')
    _CreateTablesIfNeeded(con)
    yield con
  finally:
    con.close()
def DbSession ( filename ) : if filename != ':memory:' : parent_dir = os . path . dirname ( filename ) if not os . path . exists ( parent_dir ) : os . makedirs ( parent_dir ) con = sqlite3 . connect ( filename ) try : con . execute ( 'PRAGMA journal_mode=WAL' ) _CreateTablesIfNeeded ( con ) yield con finally : con . close ( )
Context manage a session with a database connection.
Context manage a session with a database connection .
"""Context manage a session with a database connection.

  Ensures that tables have been initialized.
  """ # Tell sqlite to use a write-ahead log, which drastically increases its # concurrency capabilities. This helps prevent 'database is locked' # exceptions when we have many workers writing to a single database. This # mode is sticky, so we only need to set it once and future connections # will automatically use the log. More details are available at # https://www.sqlite.org/wal.html.
filename