Serialize function for DBAPI data sources.