Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/iboard/axrepo

Simple repository for Altex projects
https://github.com/iboard/axrepo

Last synced: 16 days ago
JSON representation

Simple repository for Altex projects

Awesome Lists containing this project

README

        

# README – Altex.Repo

[![Documentation](https://img.shields.io/badge/docs-hexpm-blue.svg)](http://hexdocs.pm/axrepo/)
[![Elixir CI](https://github.com/iboard/axrepo/actions/workflows/elixir.yml/badge.svg)](https://github.com/iboard/axrepo/actions/workflows/elixir.yml)

A Repository for the "Altex Mix Projects".

## Installation

[Available in Hex](https://hex.pm/packages/axrepo), the package can be installed
by adding `axrepo` to your list of dependencies in `mix.exs`:

```elixir
def deps do
[
{:axrepo, "~> 0.1"}
]
end
```

## Configuration

Configure the data path in your `config/.exs`

config: :axrepo, :dets_path, "../wherever/your/data/are"

## Usage

```elixir
alias Altex.{Entity, Repo}

Repo.start_repo(:people)

{:ok, bob} = %{ name: "Bob", age: 57 }
|> Entity.init()
|> Repo.store(:people)

{:ok, ^bob} = Repo.load(:people, bob.id)

%{ bob | age: bob.age + 1 } |> Repo.store(:people)
```