https://github.com/lfex/moneta-tutorial
The LFE Mnesia Tutorial Adapted for Moneta
https://github.com/lfex/moneta-tutorial
Last synced: 9 months ago
JSON representation
The LFE Mnesia Tutorial Adapted for Moneta
- Host: GitHub
- URL: https://github.com/lfex/moneta-tutorial
- Owner: lfex
- Created: 2016-03-09T04:53:20.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-10T20:13:21.000Z (over 10 years ago)
- Last Synced: 2025-05-14T11:17:45.777Z (about 1 year ago)
- Language: Erlang
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
###################
LFE Moneta Tutorial
###################
Introduction
============
This repo holds the source code for the LFE Mnesia Tutorial available `here`_.
Dependencies
------------
This project assumes that you have `rebar`_ installed somwhere in your
``$PATH``.
This project depends upon the following, which installed to the ``deps``
directory of this project when you run ``make deps``:
* `LFE`_ (Lisp Flavored Erlang; needed only to compile)
* `lfeunit`_ (needed only to run the unit tests)
Download
========
Get the code from github and compile it:
.. code:: shell
$ git clone git@github.com:oubiwann/mnesia-tutorial.git
$ cd mnesia-tutorial
$ make get-deps
$ make compile
Walk-Through
============
Start the REPL:
.. code:: bash
$ DB=./Company.DB make mnesia-shell
.. code:: cl
> (mnesia:create_schema (list (node)))
ok
> (mnesia:start)
ok
> (slurp '"src/structure.lfe")
#(ok structure)
> (init)
(#(create-set-tables (#(atomic ok) #(atomic ok) #(atomic ok) #(atomic ok)))
#(create-bag-tables (#(atomic ok) #(atomic ok))))
>
Actually, I take it back -- no walk-through.
Go read the tutorial!
* http://docs.lfe.io/tutorials/mnesia/1.html
.. Links
.. -----
.. _here: http://lfe.github.io/tutorials/mnesia/1.html
.. _rebar: https://github.com/rebar/rebar
.. _LFE: https://github.com/rvirding/lfe
.. _lfeunit: https://github.com/lfe/lfeunit