def create_index(self, table_name, attr_name):
        """
        :param str table_name:
            Table name that contains the attribute to be indexed.
        :param str attr_name: Attribute name to create index.
        :raises IOError: |raises_write_permission|
        :raises simplesqlite.NullDatabaseConnectionError:
            |raises_check_connection|
        :raises simplesqlite.TableNotFoundError:
            |raises_verify_table_existence|
        """

        self.verify_table_existence(table_name)
        self.validate_access_permission(["w", "a"])

        query_format = "CREATE INDEX IF NOT EXISTS {index:s} ON {table}({attr})"
        query = query_format.format(
            index=make_index_name(table_name, attr_name),
            table=Table(table_name),
            attr=Attr(attr_name),
        )

        logger.debug(query)
        self.execute_query(query, logging.getLogger().findCaller())
def create_index ( self , table_name , attr_name ) : self . verify_table_existence ( table_name ) self . validate_access_permission ( [ "w" , "a" ] ) query_format = "CREATE INDEX IF NOT EXISTS {index:s} ON {table}({attr})" query = query_format . format ( index = make_index_name ( table_name , attr_name ) , table = Table ( table_name ) , attr = Attr ( attr_name ) , ) logger . debug ( query ) self . execute_query ( query , logging . getLogger ( ) . findCaller ( ) )
:param str table_name:
            Table name that contains the attribute to be indexed.
        :param str attr_name: Attribute name to create index.
        :raises IOError: |raises_write_permission|
        :raises simplesqlite.NullDatabaseConnectionError:
            |raises_check_connection|
        :raises simplesqlite.TableNotFoundError:
            |raises_verify_table_existence|