Skip to content

Crud concern to use in helper's schema implementation with Repo methods.

Notifications You must be signed in to change notification settings

edouardmenayde/ecto_crux

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EctoCrux

Crud concern to use in helper's schema implementation with Repo methods. Replace methods generated with mix phx.gen.schema.

Hex documentation: here

Guide usage

Installation

def deps do
  [
    {:ecto_crux, "~> 1.2.4"}
  ]
end

configuration

config :ecto_crux, repo: MyApp.Repo

usage example

From a schema module MyApp.Schema.Baguette, create a MyApp.Schema.Baguettes module containing:

defmodule MyApp.Schema.Baguettes do
  use EctoCrux, module: MyApp.Schema.Baguette

  # This module is also the perfect place to implement all your custom accessors/operations arround this schema.
  # This allows you to have all your query/repo code centralized in one file, keeping your code-base clean.
end

ideas:

pluck (?) count(filter)

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/crux.

About

Crud concern to use in helper's schema implementation with Repo methods.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Elixir 100.0%