-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ecto 3 #2
base: master
Are you sure you want to change the base?
Ecto 3 #2
Conversation
Had to remove migration support (it was moved to ecto_sql) in the Ecto 3 upgrade. Logging is spewing errors (to be fixed next).
NEEDS update in the mongodb driver to support naive dates
This fixes a problem where keys would be string + atom.
This seems concerning to me, however, I think the only time it comes up is when you're querying arbitrary maps. Still, it would probably be good to convert all keys to strings, but that doesn't seem easy at this point. At least, this makes it consistent.
Mongo doesn't support date arithmetic in queries
Appears the tests pass without this -- not sure why
Awesome work. If you had to guess, how far are you from supporting Ecto 3? |
Thanks, @a8t! So, it's working in our app! We don't have this branch in production yet, but our hope is to test it out and get it in production in the next two weeks. A few caveats:
So, in other words, you should be able to immediately start using this adapter with Ecto 3 and it should just work with your existing code. I would LOVE more eyes on this as I'm sure there's probably something that the test aren't picking up (like logging) which need to be addressed. |
@a8t I just updated the PR description with the tags that aren't passing. I've ignored those tags and many won't ever be turned on (e.g. joins). The test suite now passes. |
@scottmessinger this is brilliant work! |
For the future, MongoDB does support something akin to a join in the form of the aggregate Aggregates are a powerful feature of MongoDB but can easily result in very heavy queries so even if there were support, it wouldn't necessarily be a good idea to use them all the time. Despite this difficulty I think it might be marginally preferable to have support for it in mongodb_ecto, since it would make for a transparent developer experience (one less difference between ecto drivers to worry about). The same goes for several of the test tags that you currently have commented out. MongoDB does have support for them and (in theory at least) support could be added. |
This would be great! I looked briefly at trying to do this and it didn't appear to be easy as the query has to be changed from a standard query to an aggregate if there's a lookup involved. I imagine it's possible. I welcome any PRs to add it!
Completely agree. There are a number of tags I commented out which should and could be implemented. I would welcome any and all PRs to address those! |
Excellent. I will be in a position to take a look in a couple of weeks time. |
Great work everyone! I dont have anything to add but I appreciate the hardwork |
I'm continuing to make improvements to the existing work from Scott and others at https://github.com/avid-technology/mongodb_ecto on the ecto3 branch. Please let me know if there is anything particularly that folks would like me to work on first. @scottmessinger it occurs to me that a viable ecto3 merge request would make for an excellent conversation starter when it comes to a possible change of maintainership. |
@joeapearson I'm dipping my toes back into Mongoland after being away for 5 years. I've used the Ruby Mongoid ORM last time. I'm surprised at the state of ecto drivers because Elixir has not let me down yet. I think I just want a community approved version of mongo and ecto that we can all rally around. |
Agreed. Get something decent going and then start building! IMHO it's best for the community to avoid fragmentation as much as we can. It'd be the worst of all worlds if we end up with a forked project. I think our goal should be to try and get this work merged back into the original. Same goes for the If we have several interested folks that are able to donate some time then perhaps we should think about coordinating efforts a bit to avoid duplication. Open to ideas. |
@joeapearson I'm an idiot -- I had totally thought I already had this. I just opened it. Thanks for saying this! Hopefully this will jump start the process.
I would love to see support added for the upserts! This has long been something I've hoped the ecto adapter would support.
Awesome! I'll send you an email and we can coordinate. |
As I've been working on this I discovered that the way that mix tasks work has been changed sometime during Ecto 3 development. For example... in various places the docs say you can run:
... however, those tasks have now moved (migrated, haha) to |
This is an embarrassing series of 3 commits.
Current status. All tests pass given these excluded tags: