anchor.diff:  -type ddPermission() :: atom() | tuple().   %% e.g. manage_accounts, {table,ddDash,select}
   -type ddQuota()      :: {atom(),any()}.     %% e.g. {max_memory, 1000000000}
   
  --record(ddAccount,                          %% imem cluster account (shared by application)
  +%% imem cluster account (shared by application)
  +-record(ddAccount,
                     { id                      ::ddEntityId()
                     , name                    ::ddIdentity()        %% unique login id (mutable)
                     , type='user'             ::atom()              %% user | driver | deamon | application
  
positive.code:                   , conns = local           ::list() | local    %% can be local or a list with remote connections, empty list for all remote connections.
                    , command                 ::binary()          %% erlang term depending on adapter (e.g. SQL text)
                    , opts                    ::any()             %% command options ()
                    }
         ).
  -define(ddCmd, [integer, binstr, userid, list, list, binstr, term]).
  
  -record(ddView,                             %% user representation of a db command including rendering parameters
                    { id                      ::ddEntityId()
                    , interface               ::atom()            %% interface plugin (ddjson for now)  
                    , owner                   ::ddEntityId()      %% account.id of creator / owner
                    , name                    ::binary()          %% should default to command name
                    , cmd                     ::ddEntityId()      %% db command id
                    , state                   ::#viewstate{}      %% transparent viewstate (managed by client application)
                    }
         ).
  -define(ddView, [integer, atom, userid, binstr, integer, term]).
  
  -record(ddDash,                             %% user representation of a dashboard (collection of views)
                    { id                      ::ddEntityId()
                    , interface               ::atom()            %% interface plugin (ddjson for now)  
                    , owner                   ::ddEntityId()      %% account.id of creator / owner
                    , name                    ::binary()          %% should default to command name
                    , views                   ::list()            %% array of proplists with view layout
                    }
         ).
  
  -define(ddDash, [integer, atom, userid, binstr, list]).
  
  
negative.code: -include_lib("imem/include/imem_exports.hrl").
  
  -define(DEFAULT_ROW_SIZE, 100).
  -record(viewstate,
                    { table_layout = []
                    , column_layout = []
                    }).
  
  %% DDerl adapter (connect to databases)
  -record(ddAdapter,
                    { id                      :: atom()             %% oci | imem | ets | os_text | dfs_text | hdfs_text
                    , fullName                :: binary()           %% displayed in drop down box
                    }).
  -define(ddAdapter, [atom, binstr]).
  
  %% DDerl client interface (connect to ui / applications)
  -record(ddInterface,
                    { id                      :: atom()             %% ddjson
                    , fullName                :: binary()           %% displayed in drop down box
                    }).
  -define(ddInterface, [atom, binstr]).
  
  %% DB connection
  -record(ddConn,
                    { id                      ::ddEntityId()       
                    , name                    ::binary()          %% connection name (mutable)
                    , owner                   ::ddEntityId()      %% account.id of creator / owner
                    , adapter                 ::atom()            %% oci | imem | ets | os_text | dfs_text | hdfs_text
                    , access                  ::any()             %% erlang term depending on adapter (e.g. ip+service or tns)
                    , schm                    ::any()             %% erlang term depending on adapter (e.g. name or uri or data root path)
                    }).
  -define(ddConn, [integer, binstr, userid, atom, term, term]).
  
  %% DB command
  -record(ddCmd,
                    { id                      ::ddEntityId()       
                    , name                    ::binary()          %% command template name (mutable)
                    , owner                   ::ddEntityId()      %% account.id of creator / owner
  