hamiltop / rethinkdb_ecto

Shim library for using Ecto with RethinkDB. Not a full adapter.
24 stars 4 forks source link

Roadmap #7

Open hamiltop opened 8 years ago

hamiltop commented 8 years ago

This was a quick n dirty proof of concept from a few months ago that seems to be quite popular.

master is the original PoC, but the rough_migrations branch has a bunch of other stuff.

I think it's time to try to prioritize features that are useful.

The intentions in putting this together were somewhat scattered:

  1. Validations in Ecto were useful.
  2. Scaffolding in Phoenix is a useful starting point.
  3. Migrations are very useful for creating indexes, changing the shape of stored data, etc.
  4. Common operations require a lot of boilerplate (CRUD, associations, etc.)

The solutions present here are, respective:

  1. Instead of having to manually extract a struct or map from a changeset, you can just insert the changeset directly.
  2. By mimicking the Ecto.Repo interface, a one line change is all that's needed to piggyback off the generated code.
  3. Ecto migrations work with a limited set of operations.
  4. CRUD is all there, I have no idea how to do associations.

Alternatives to piggybacking on Ecto:

  1. Something along the lines of https://thinky.io/
  2. A bunch of helper libaries, like https://gist.github.com/sikanhe/7baa02cd9986bc62d92e
  3. ???

Downsides to Ecto:

  1. Unsupported integration could lead to problems down the line.
  2. Deviating from the standard Ecto integration will be confusing to some new comers. Being 99% the same causes more confusion that being 50% the same.

I'd love some feedback to determine the priorities of the library and whether or not this is a good direction to go.

hamiltop commented 8 years ago

I guess an initial proposal:

  1. Finish all the query methods from Repo, document how to use phoenix scaffolding
  2. Add support for associations. This will likely not mirror Ecto.
  3. Add support for migrations. Partially complete.
AdamBrodzinski commented 8 years ago

Alternatives to piggybacking on Ecto: ...

  1. A bunch of helper libaries, like https://gist.github.com/sikanhe/7baa02cd9986bc62d92e

Lately i've been playing around with GraphQL. If i'm using this instead of REST and controllers I could easily use something like those helpers to extract the data out of the struct and pass it to the resolve.

GraphQL would handle the schema, parsing params, and calling a function to fetch data. However, GraphQL is not quite there for Elixir yet unfortunately.

walter commented 8 years ago

Hey there,

First off, great work on integrating rethinkdb into Elixir, etc. I'm just getting started in with Elixir and Phoenix and I'm psyched to see that I can try it out with RethinkDB with what I'm building. Thanks!

My question in regards to the roadmap is how does this project relate to almightycouch/rethinkdb_ecto?

Their doesn't look to be coordination yet, but both projects seem to have roughly the same purpose.

hamiltop commented 8 years ago

The approaches are drastically different. My approach is to avoid Ecto.Query. It's an experiment and the deeper I've gone, the more difficult it is to avoid Ecto.Query. The other project is a traditional adapter (therefore based around Ecto.Query).

I haven't had a chance to play with it yet. I'm not sure how well it works, but honestly this project gaining momentum sort of snuck up on me (as I said it was just an experiment). I'll have to take a look at the other project when I have time.

On Tue, Mar 1, 2016, 8:11 PM Walter McGinnis notifications@github.com wrote:

Hey there,

First off, great work on integrating rethinkdb into Elixir, etc. I'm just getting started in with Elixir and Phoenix and I'm psyched to see that I can try it out with RethinkDB with what I'm building. Thanks!

My question in regards to the roadmap is how does this project relate to almightycouch/rethinkdb_ecto https://github.com/almightycouch/rethinkdb_ecto?

Their doesn't look to be coordination yet, but both projects seem to have roughly the same purpose.

— Reply to this email directly or view it on GitHub https://github.com/hamiltop/rethinkdb_ecto/issues/7#issuecomment-191048837 .

walter commented 8 years ago

@hamiltop thanks for the clarification. I'm only at the stage of a proof-of-concept myself, so can switch later if I get to the point of building something real. Will keep an eye on how things progresses with both projects.