3 ms·
I was quite happy to discover how easily you can use Ecto to integrate with an existing database. I had to override a few things (e.g. the primary key isn't cal
by tonyarkles 9y ago
I was quite happy to discover how easily you can use Ecto to integrate with an existing database. I had to override a few things (e.g. the primary key isn't called "id") but it really worked quite smoothly.
- raarts 9y agoNote that ecto now has a :source option on schema fields which allows you to map a third party db into your own field naming scheme. Very useful.
- tonyarkles 9y agoOoooooooooooh! That's killer! I was quite annoyed by the ugly legacy table's column names polluting the new codebase. I'm looking around for this and I'm not sure that I've found the right information here. Does this apply on a per-field basis?
- raarts 9y agoIt has not been merged yet, but several people are using it in production. Here's the PR: https://github.com/elixir-ecto/ecto/pull/1998 https://github.com/elixir-ecto/ecto/pull/1998