anchor.diff:          , fail/1
           , get_tables_count/0
           , sql_jp_bind/1
  +        , sql_bind_jp_values/2
           ]).
   
   -export([ schema/0
  
positive.code: -ifdef(TEST).
  
  -include_lib("eunit/include/eunit.hrl").
  
  setup() ->
      ?imem_test_setup.
  
negative.code:                  {match,["r",    Jp]} -> [ref,       Jp];
                   {match,["s",    Jp]} -> [string,    Jp];
                   {match,["t",    Jp]} -> [term,      Jp];
                   {match,["bt",   Jp]} -> [binterm,   Jp];
                   {match,["ts",   Jp]} -> [timestamp, Jp];
                   {match,["tp",   Jp]} -> [tuple,     Jp];
                   {match,["u",    Jp]} -> [userid,    Jp];
                   {match,[X,     _Jp]} -> ?ClientError({"Unknown type", X});
                   Other1               -> ?ClientError({"Bad format", Other1})
               end]) || {M,R} <- ParamsMap]
      }.
  
  -spec sql_bind_jp_values(BindParamsMeta :: [{BindParam :: binary()
                                               , BindType :: atom()
                                               , JPPath :: string()}]
                          , JpPathBinds :: [{BindName :: binary()
                                             , BindObj :: any()}]) ->
      {Values :: list()} | no_return().
  sql_bind_jp_values(BindParamsMeta, JpPathBinds) ->
      [imem_json:eval(Jp, JpPathBinds) || {_,_,Jp} <- BindParamsMeta].
      
  %% ----- DATA TYPES ---------------------------------------------
  
  