def generate_metadata_table_sql(nodes_metadata: list, table_name: str):
    """generate_metadata_table_sql Generate Metadata Table Sql

    Generate a sql for creating the node metadata table

    Args:
        nodes_metadata (list): nodes metadata list
        table_name (str): table name 

    Returns:
        str: sql string
    """
    column_names = list(nodes_metadata[0].keys())
    column_str = ""
    for i, column in enumerate(column_names):
        column_str += column + " TEXT, "
    column_str = column_str[:-2]
    metadata_table_sql = f" CREATE TABLE IF NOT EXISTS {table_name} \
        ( NodeID SERIAL PRIMARY KEY, {column_str}, UNIQUE (NodeID));"
    return metadata_table_sql