Add a function that returns a serialized data from tables in a database