Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Phoenix Framework without Ecto

I'm developing an application with a web interface backed by Phoenix and I'm exploring alternate methods of storage to the current SQLite (and its Ecto driver) (yes I've heard of PGSQL, no I'm not willing to use it.)

I'd like to use LevelDB and H2LevelDB, which has an Erlang driver available on Github

However, at compile time I realise that Phoenix seems to rely a lot on Ecto, even in modules charged of rendering the eex templates. Which I find a bit scary, a bit strange and a bit annoying at the same time. So, would it be safe to blindly purge all references to Ecto from the pre-generated files or should I switch to something else for my web UI?

like image 205
Hécate Avatar asked Jun 24 '16 23:06

Hécate


People also ask

Is Phoenix a good framework?

Awesome Phoenix web framework Phoenix framework is where Elixir shines. It's built-in a very elegant manner and gives you everything you need to build robust web applications as well as advanced APIs.

How do you make a Phoenix Project?

create We have a working application! Run your Phoenix application: $ mix phoenix. server You can also run your app inside IEx (Interactive Elixir) as: $ iex -S mix phoenix. server Load `http://localhost:4000` into your browser and you will see the default landing page of your application.

Is Phoenix framework fast?

For any company that currently uses Ruby on Rails, Phoenix Framework should be on your radar, because it adds considerable performance gains. To top that off, Phoenix makes it incredibly fast to build web applications.


1 Answers

Phoenix does not rely on ecto in any way. One can be successfully used without the other. The integration is done through couple protocols, which are implemented in the phoenix_ecto package.

The default phoenix generator will create an application with ecto - the reason is to give the user something "with batteries included". You can easily remove this by passing the --no-ecto flag to the mix phoenix.new generator.

like image 114
michalmuskala Avatar answered Oct 09 '22 00:10

michalmuskala