i have written my code below allow me to explain what is problem and end goal i am trying to achieve. this function is used for data serialization data coming from (AWS rds)