derek-zhou

derek-zhou

Using Ecto without a database

I plan to use Ecto only to validate input data, such as a data structure passed in through a JSON api call, before doing some processing then route the result to somewhere else. There is no SQL database involved. Does it sound reasonable, or is there a smaller library that can accomplish the same thing?

Most Liked

gregvaughn

gregvaughn

I gave a talk with this same title, so I’m in favor

17
Post #6
dimitarvp

dimitarvp

I do that all the time and it always worked really well.

There are a few gotchas however e.g. if you put value in the changeset that is the same as the default value (usually nil but not always) then the changeset won’t count it as a change so you might need to use force_change.

That being said, Ecto is amazingly well documented. You will know exactly what you’re getting into, and 99% of the time it will be good and predictable.

13
Post #5
Exadra37

Exadra37

I am using Ecto changesets in my project that only uses a Mnesia database.

The only downside is that I need to require a lot that is not needed to get it to work.

Not aware if any other lib exists.

Last Post!

lc0815

lc0815

glad I found this, great info thanks

Where Next?

Popular in Discussions Top

ricklove
I was just introduced to Elixir and Phoenix. I was told about the 2 million websocket test that was done 2 years ago. From my research, t...
New
restack_oslo
Hello, Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from tho...
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40042 209
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
cvkmohan
The upcoming Phoenix 1.6 release looks very interesting. Became a habit to watch the commits - and - what they are bringing in. phx.gen...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44139 214
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

We're in Beta

About us Mission Statement