     @doc """
     Insert Ecto Schema Instance to mnesia database.
     """
-    def  insert(_repo, %{schema: schema, source: {_, table}}, params, autogen, opts) do
+    def  insert(_repo, %{schema: schema, source: {_, table}}, params, _autogen, _opts) do
 
          rec = Ecto.Mnesia.Query.make_tuple(schema, params, String.to_atom table)
-         res = :mnesia.dirty_write(rec)
+         :mnesia.dirty_write(rec)
 
          {:ok, []}
     end

    @doc """
    Convert Ecto Qeury to Erlang MatchSpec, include caching.
    """
    def  prepare(:all, %{from: {table, model},
                         select: %{expr: expr, fields: fields, take: take} = select,
                         wheres: wheres,
                         order_bys: ordering} = arg) do

         :io.format("Args: ~p~n",[arg])
         :io.format("Take: ~p~n",[take])

         fields    = pre_fields(fields, model)
         #spec     = Ecto.Mnesia.Query.match_spec(model, table, fields: fields, wheres: wheres)
         spec      = wheres
         ordering  = Ecto.Mnesia.Query.ordering(ordering, table)

         {:cache, {:all, spec, ordering}}
    end

    def  prepare(:delete_all, %{from: {table, _},
                                select: nil,
                                wheres: wheres} = arg) do

         {:cache, {:delete_all, Ecto.Mnesia.Query.match_spec(table, nil, wheres, nil)}}
    end

    @doc """
    Perform `mnesia:select` on prepared query and convert the results to Ecto Schema.
    """
    def  execute(repo, %{sources: {{table, model}}, fields: fields, take: take},
                        {:cache, fun, {:all, wheres, ordering}} = query,
                        params, preprocess, options) do



    @doc """
    Mnesia starting during Adapter boot.
    """
    def ensure_all_started(_, _),     do: Application.ensure_all_started(:mnesia)

    @doc """
    Stopping Mnesia Adapter.
