docs: def initdb(self):
          """Create tables and indices as needed."""
          if hasattr(self, 'alchemist'):
              self.alchemist.meta.create_all(self.engine)
              if 'branch' not in self.globl:
                  self.globl['branch'] = 'trunk'
              if 'rev' not in self.globl:
                  self.globl['rev'] = 0
              return
          from sqlite3 import OperationalError
          cursor = self.connection.cursor()
          try:
              cursor.execute('SELECT * FROM global;')
          except OperationalError:
              cursor.execute(self.strings['create_global'])
          if 'branch' not in self.globl:
              self.globl['branch'] = 'trunk'
          if 'turn' not in self.globl:
              self.globl['turn'] = 0
          if 'tick' not in self.globl:
              self.globl['tick'] = 0
          for table in (
              'branches',
              'turns',
              'graphs',
              'graph_val',
              'nodes',
              'node_val',
              'edges',
              'edge_val',
              'plans',
              'plan_ticks'
          ):
              try:
                  cursor.execute('SELECT * FROM ' + table + ';')
              except OperationalError:
                  cursor.execute(self.strings['create_' + table])