Skip to content

Latest commit

 

History

History
113 lines (81 loc) · 4.25 KB

CHANGELOG.md

File metadata and controls

113 lines (81 loc) · 4.25 KB

Changelog

v1.0.11 (unreleased)

  • Feature: Handle sync vs async via an option passed in at Dataloader.new() and KV.new(). Example:
  def dataloader(ctx \\ %{}) do
    Dataloader.new(async?: !MyApp.Repo.in_transaction?())
    |> Dataloader.add_source(MainLoader, MainLoader.data(ctx))
  end

Note that ecto sources will automatically handle whether to perform queries sync or async depending on if it's in a transaction. IMPORTANT: The option MUST be passed to Dataloader.new for this to work properly. In order for this to happen automatically, upgrade to 2.0

v1.0.10 2021-12-22

  • Support Telemetry 1.0
  • Various typo and doc fixes.

v1.0.9 2021-08-20

  • Improvement: KV data sources now pass opts to Dataloader.run_tasks/3 (#94)
  • Improvement: Add support for where and join_where in has_many and many_to_many associations (#119)
  • Bug Fix: Avoid preloads in lateral subqueries (#98)
  • Bug Fix: Use existing database prefix when preloading via lateral join (#107)
  • Bug Fix: Fix issue with Dataloader.Ecto.run_batches/1 (#126)
  • Doc improvements

v1.0.8 - 2020-08-25

  • Improvement: Telemetry integration (#89)
  • Improvement: limit support via lateral joins (#93)

v1.0.7 - 2020-01-09

  • Improvement: Optimize out inspect calls when keys are not found (#84)
  • KV source bug fixes (#75)
  • Doc improvements

v1.0.6 - 2019-02-06

  • Bug Fix: Depend on ecto instead of ecto_sql. Fixes Ecto 2.x support (#67)

v1.0.5 - 2019-02-03

  • Improvement: Ecto 3 support (which is just improving the tests)
  • Improvement: Better error messages if you pass a non-ecto schema to Dataloader.load/4 or Datalaoder.get/4
  • Bug Fix: Fix dialyzer spec for run_batch function
  • Bug Fix: Fix loading of nested through associations (#65)

Breaking change: Dependency changed from ecto to ecto_sql which unintentionally breaks Dataloader.Ecto on Ecto 2.x projects (#67).

v1.0.4 - 2018-09-14

  • Bug Fix: Poor supervisor structure has been improved, which fixes large memory usage issues

v1.0.3 - 2018-08-19

  • Enhancement: Improved error handling when sources fail to load This provides two additional configurable methods of error handling (these options can be passed to Dataloader.new/1):

    • :return_nil_on_error - This is the previous default. Errors are logged, and values return nil.
    • :raise_on_error - this will raise a Dataloader.GetError when one of the get methods are called. This is now the default behaviour for handling errors
    • :tuples - this changes the get/4/get_many/4 methods to return :ok/:error tuples instead of just the value. This frees up the caller to handle errors any way they see fit
  • Enhancement: Improved caching characteristics on the KV source

  • Enhancement: More flexible cardinality mapping for Ecto source

  • Enhancement: Uniq the batched KV and Ecto values

  • Bug Fix: When using the Ecto source it properly coerces all inputs for known fields.

Note: when upgrading it may be necessary to clear out your _build directory so that the compiler picks up the protocol change.

Breaking Changes

  • Errors are raised instead of silently returning nil. See :return_nil_on_error option to keep the previous behavior.
  • Dataloader.get/4 will raise an error if you pass in an item_key that was not previously loaded. See #52 for discussion.

v1.0.2 - 2018-04-10

  • Enhancement: Custom batch functions for Ecto

v1.0.1 - 2018-02-04

  • Bug Fix: Ecto source properly caches results now.

v1.0.0 - 2017-11-13

  • Initial release