{"repo":"MikaAK/ecto_shorts","free":true,"listed":false,"github":"https://github.com/MikaAK/ecto_shorts","clone":"git clone https://github.com/MikaAK/ecto_shorts.git","description":"Shortcuts for ecto","language":"Elixir","stars":119,"topics":["ecto","elixir","postgresql","postgres","ecto-db"],"license":"MIT","category":"databases-storage","readme_excerpt":"EctoShorts Ecto Shorts is a library focused around making Ecto easier to use in an application and helping to write shorter code Installation Documentation can be found at https://hexdocs.pm/ecto shorts. Usage There are 4 main modules to EctoShorts . SchemaHelpers , CommonFilters , CommonChanges and Actions With our Actions.create and related functions we can also define create changeset(params) on our schema, this usually looks like: or some other variation of changeset that runs specifically on creates Actions This module takes a schema and filter parameters and runs them through CommonFilters, essentially a wrapper around Repo. All actions can accept an optional argument of a keyword list that can be used to configure which Repo the Action should use. Options :repo - A module that uses the Ecto.Repo Module. :replica - If you don't want to perform any reads against your Primary, you can specify a replica to read from. For more info on filter options take a look at Common Filters Common Changes This module is responsible for determining put/cast assoc as well as creating and updating model relations Extra Magic If you pass a list of id's to a many to many relation it will count that as a member update and remove or add members to the relations list E.G. User many to many Fruit This would update the user to have only fruits with id 1 and 3 Schema Helpers This module contains helpers to check schema data Common Filters This module creates query from filter paramters like is th","default_branch":null,"files":null,"tree":[],"storefront":"/r/MikaAK","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MikaAK/ecto_shorts/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}