def connection_details(con):
    """
    Given one connection objects returns information about it.

    :param con:
        An instance of :class:`!pyodbc.Connection`.

    return:
        A ``dict`` with the following keys / values:

        host
            Connected node IP address

        user
            Connected username

        db
            Connected database name

    """
    details = con.execute(
        """
        SELECT
            n.node_address as host
          , CURRENT_USER() as user
          , CURRENT_DATABASE() as db
        FROM v_monitor.current_session cs
        JOIN v_catalog.nodes n ON n.node_name=cs.node_name
        """
        ).fetchone()
    return {'host': details.host, 'user': details.user, 'db': details.db}
