v0.8.0
------

.. currentmodule:: databroker

API Changes
+++++++++++

``databroker.core``
^^^^^^^^^^^^^^^^^^^

This module is semi-private

* Removed ``process``, ``stream``, and ``restream`` as top-level
  functions.  The implementation now lives in
  `databroker.broker.BrokerES`.  These functions knew too much about the
  internals of the databroker to remain as separate functions.
* ``Broker.__call__`` returns an iterable ``Results`` object, akin to a
  generator, instead of a list. This means that queries with large results sets
  return quickly. Iterating through the Headers in the result set is up to the
  caller.

``Header``
^^^^^^^^^^

Change ``Header` from a ``doct.Document`` subclass to a ``attr`` based
class.  A majority of the API has been maintained, however there are
changes in what exceptions are raised when trying to mutate the
instance.

+----------------+--------------------------+---------------------------------------+
| Method         | Old Exception            | New Exception                         |
+================+==========================+=======================================+
| ``h.pop``      | `doc.DocumentIsReadOnly` | `AttributeError`                      |
+----------------+--------------------------+---------------------------------------+
| ``h.update``   | `doc.DocumentIsReadOnly` | `AttributeError`                      |
+----------------+--------------------------+---------------------------------------+
| ``del h.x``    | `doc.DocumentIsReadOnly` | `attr.exceptions.FrozenInstanceError` |
+----------------+--------------------------+---------------------------------------+
| ``del h['x']`` | `doc.DocumentIsReadOnly` | `TypeError`                           |
+----------------+--------------------------+---------------------------------------+
| ``h.x = V``    | `doc.DocumentIsReadOnly` | `attr.exceptions.FrozenInstanceError` |
+----------------+--------------------------+---------------------------------------+
| ``h['x'] * V`` | `doc.DocumentIsReadOnly` | `TypeError`                           |
+----------------+--------------------------+---------------------------------------+

``Header.from_run_start``
^^^^^^^^^^^^^^^^^^^^^^^^^

Take a :class:`Broker` object instead of a ``MetadataStore`` object.  This
is now tacked on the :class:`Header` object.

Changes to functions in ``databroker.core``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Explicitly passed mds/fs have been removed, instead relying on the
DataBroker instance included in the header.

Break up internal structure of databroker
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* The core functions that touch events have a new required argument, ``es``.
  This does not affect the API of the ``Broker`` object, only the functions in
  the ``core`` module.

Top level insert
^^^^^^^^^^^^^^^^

:class:`Broker` now has an ``insert`` method, use this over ``db.mds.insert``.
