How to serialize an ItemStack into a database column?

I saw from older posts that there is a way to serialize and deserialize ItemStacks built into the configuration API. My problem is that I want to save the data into a database. Is there some method in sponge that allows me to serialize an ItemStack and insert it into a database?

Theres probably better ways but this is how I do it.

https://github.com/trentech/ProjectInventories/blob/5.0.0/src/main/java/com/gmail/trentech/pji/data/inventory/extra/InventorySerializer.java