Description
Bourne provides more powerful streaming mechanisms than those offered by Ecto or Tributary. Notably, it provides both cursor and keyset pagination methods, as well as the ability to create a GenStage producer with similar semantics to GenStage.from_enumerable.
Bourne alternatives and similar packages
Based on the "ORM and Datamapping" category.
Alternatively, view Bourne alternatives based on common mentions on social networks and blogs.
-
paper_trail
Track and record all the changes in your database with Ecto. Revert back to anytime in history. -
ecto_psql_extras
Ecto PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Bourne or a related project?
Popular Comparisons
README
Bourne
Bourne provides more powerful streaming mechanisms than those offered by Ecto or Tributary. Notably, it provides both cursor and keyset pagination methods, as well as the ability to create a GenStage
producer with similar semantics to GenStage.from_enumerable
.
Example
defmodule My.Repo do
use Ecto.Repo, otp_app: :mine
use Bourne
end
import Ecto.Query
q = from(actor in Actor, where: actor.born <= 1980)
# You can stream through an `Enumerable`:
My.Repo.stream(q) |> Stream.each(&IO.inspect) |> Stream.run
# Alternatively, you can stream through a GenStage producer:
defmodule InspectorConsumer do
use GenStage
def start_link do
GenStage.start_link(InspectorConsumer, [])
end
def init([]) do
{:consumer, :ok}
end
def handle_events(rows, _from, state) do
Enum.each(rows, &IO.inspect/1)
{:noreply, [], state}
end
end
method = Enum.take_random(~W{cursor keyset}a, 1)
{:ok, producer} = My.Repo.streamer(q, method: method)
{:ok, consumer} = InspectorConsumer.start_link
GenStage.sync_subscribe(consumer, to: producer)
Installation
- Add
bourne
to your list of dependencies inmix.exs
:
def deps do
[{:bourne, "~> 1.0"}]
end
- Fetch and compile your new dependency:
mix do deps.get bourne, deps.compile
Drink your :tea:
That's it!
Usage
Refer to the documentation.
License
Bourne is free and unencumbered software released into the public domain, with fallback provisions for jurisdictions that don't recognize the public domain.
For details, see LICENSE.md
.
*Note that all licence references and agreements mentioned in the Bourne README section above
are relevant to that project's source code only.