opscode/sqerl — pull request #72 by joedevivo (2014-07-29 15:46:59+00:00)
Title: Parse Transform for cleaner developer experience

## sqerl_gobot

The `sqerl_gobot` got it's name because at first, it seemed like a transformer knockoff. Also, there's another module called `sqerl_transformers` and I thought calling it `sqerl_transform` would get too confusing.

### Exprecs functionality
The first thing it does is provide a dumbed down version of `exprecs`. Since exprecs was built to allow you to export multiple records from a single module, it had to a lot more work than we needed. The exprecs-ish functions we've preserved are:

* `'#new-'/0`
* `'#get-'/2`
* `'#fromlist-'/2`
* `'#info-'/0`
* `'#is-'/1`
* `'#set-'/2`

It's not the place of this PR to discuss wether or not `'#new-'` is a good name for a function. IMHO, the whole `'#-'` thing makes code harder to read.

### Types
We've also exported a type to encapsulate the record completely, take the following record:

```erlang
-record(notifier_config_object, {
name :: string(),
rank :: string(),
serial_no :: integer(),
non_typed
}).
```

It exports the following dialyzer types:

```erlang
-type notifier_config_object() :: #notifier_config_object{}.

-type attr() :: name | rank | serial_no | non_typed.

-type prop() :: {name, undefined | string()}
| {rank, undefined | string()}
| {serial_no, undefined | integer()}
| {non_typed, any()}.

-export_type([{attr,0},{notifier_config_object,0},{prop,0}]).
```

### sqerl_rec abstractions

For a set of functions defined in `sqerl_rec`, the parse_transform creates abstractions in the module to make development cleaner, take `sqerl_rec:qfecth/3` for example

```erlang
%% The original call
sqerl_rec:qfetch(notifier_config_object, Query, Vals).

%% New call
notifier_config_object:qfetch(Query, Vals).

%% Does so by creating this function
qfetch(Query, Vals) ->
sqerl_rec:qfetch(notifier_config_object, Query, Vals).
```

The following functions are created

```erlang

```