Creating Models with ecto without database for testing purpose

I am working on umbrella application . In my app I don’t have any data base configured. I have ecto. I want to create some models for testing in iex. How i do that?
Any help will be much appreciated.

so i figure out a way to use embeded_schema to define a schema that doesn’t persist in the database and use it in the iex

1 Like

You can use schema as well. All the persistence logic is in Ecto.Repo, not Ecto.Schema.

Your schemas define a struct. You can use the struct syntax to create one. For example:

%MyApp.User{id: 1, email: "bob@example.com"}

If you want to test it on tests you could define the schemas inside your .exs