Coder Social home page Coder Social logo

music_db_workshop's Introduction

MusicDB

A playground for experimenting with Ecto.

Installation

Prerequisites

  • Elixir >= 1.5 (1.9 recommended)
  • PostgreSQL >= 9.0 (MySQL or SQLite may work - see "Other Databases" below)

Database Configuration

By default, the app will attempt to connect to the database using your system username and an empty password. If your database needs different credentials, you'll need to set up the following environment variables:

export DATABASE_USERNAME=[your username]
export DATABASE_PASSWORD=[your password]

Setup

Clone the repo, then run:

bin/setup

This will check for Elixir, load dependencies, setup the database, and run a few smoke tests to verify that the app is communicating with the database.

If all goes well, you'll see this at the end:

Setup complete - everything looks good! ๐Ÿ‘

Other Databases

This is app has been tested with PostgreSQL, but other databases supported by Ecto may work. If you want to use a different database, you'll need to:

  1. Add the database driver as a dependency in the deps function in mix.exs
  2. Change the adapter setting in lib/music_db/repo.ex

See the Ecto README for a list of supported adapters and driver dependencies.

Data Model

This app sets up four schemas: Artist, Album, Track, and Genre. To help keep things simple, 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.

data model

music_db_workshop's People

Contributors

darinwilson avatar zberkom avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.