All Projects → darinwilson → music_db

darinwilson / music_db

Licence: other
A playground for Ecto using a simple music database

Programming Languages

elixir
2628 projects

Labels

Projects that are alternatives of or similar to music db

Phoenix Ecto Encryption Example
🔐 A detailed example for how to encrypt data in a Phoenix (Elixir) App before inserting into a database using Ecto Types
Stars: ✭ 166 (+472.41%)
Mutual labels:  ecto
fat ecto
Query mechanism for Ecto
Stars: ✭ 20 (-31.03%)
Mutual labels:  ecto
strong migrations
Catch unsafe migrations in your Elixir application
Stars: ✭ 58 (+100%)
Mutual labels:  ecto
Formex
A better form library for Phoenix
Stars: ✭ 206 (+610.34%)
Mutual labels:  ecto
Params
Easy parameters validation/casting with Ecto.Schema, akin to Rails' strong parameters.
Stars: ✭ 239 (+724.14%)
Mutual labels:  ecto
ecto shorts
Shortcuts for ecto
Stars: ✭ 81 (+179.31%)
Mutual labels:  ecto
Mipha
Proj Elixir Forum build with phoenix 1.5.
Stars: ✭ 153 (+427.59%)
Mutual labels:  ecto
querie
Compose Ecto query from the client side
Stars: ✭ 20 (-31.03%)
Mutual labels:  ecto
ecto erd
A mix task for generating Entity Relationship Diagram from Ecto schemas available in your project.
Stars: ✭ 173 (+496.55%)
Mutual labels:  ecto
ex operation
A library for making domain operations in Elixir
Stars: ✭ 33 (+13.79%)
Mutual labels:  ecto
Ex audit
Ecto auditing library that transparently tracks changes and can revert them.
Stars: ✭ 214 (+637.93%)
Mutual labels:  ecto
Etso
Ecto 3 adapter allowing use of Ecto schemas held in ETS tables
Stars: ✭ 226 (+679.31%)
Mutual labels:  ecto
prometheus-ecto
Prometheus.io collector for Elixir.Ecto
Stars: ✭ 74 (+155.17%)
Mutual labels:  ecto
Rummage ecto
Search, Sort and Pagination for ecto queries
Stars: ✭ 190 (+555.17%)
Mutual labels:  ecto
algoliax
Algolia integration to elixir application
Stars: ✭ 38 (+31.03%)
Mutual labels:  ecto
Filtrex
A library for performing and validating complex filters from a client (e.g. smart filters)
Stars: ✭ 157 (+441.38%)
Mutual labels:  ecto
absinthe error payload
Bridges the gap between Ecto and Absinthe for mutation payload
Stars: ✭ 102 (+251.72%)
Mutual labels:  ecto
ecto profiler
Project for Ecto DB profiling
Stars: ✭ 16 (-44.83%)
Mutual labels:  ecto
phoenix pagination
Simple pagination for Ecto and Phoenix that uses plain EEx templates.
Stars: ✭ 20 (-31.03%)
Mutual labels:  ecto
query builder
Compose Ecto queries without effort
Stars: ✭ 56 (+93.1%)
Mutual labels:  ecto

MusicDb

A playground for Ecto using a simple music database

I created this repo to have examples for my talk at ElixirConf 2016, "Leveling Up With Ecto". The video is available here and the slides are here.

Requirements

  • Elixir >= 1.2
  • Postgres >= 9.0

Setup

  • clone this repo
  • make sure Postgres is running
  • edit the database configuration in config/dev.exs to match your system
  • mix deps.get
  • mix ecto.setup

This will create the database and load some sample data. If you see

The database for MusicDb.Repo has been created

you should be all set.

Working with the playground

Open up priv/repo/playground.exs in your editor, and find the play function (it's fairly well marked with a PUT YOUR TEST CODE HERE comment).

Put whatever code you'd like in there, then run the script with:

mix run priv/repo/playground.exs

The return value of play/0 will be written to the console

Restoring the data

After playing around for awhile, your data will probably get into a weird state. You can restore it back to its original state by running

mix ecto.reset

The test data is set up in priv/repo/seeds.exs - feel free to make any changes to that script if there are things you would like to add to the sample data.

Schemas

This app sets up four schemas: Artist, Album, Track, and Genre. For testing purposes, they're fairly stripped down, and have a minimal configuration. See the corresponding modules for details.

As you might expect, Artist has_many Albums, which has_many Tracks. Albums has a many_to_many relationship with Genres.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].