def db_to_dict(db):
    """
    Returns the :class:`dict` representation of a database object.

    The returned :class:`dict` is meant to be consumed by
    :class:`~bang.deployers.cloud.ServerDeployer` objects.

    """
    return {
            A.database.HOST: db.hostname,
            A.database.PORT: db.port,
            }