anchor.diff:      %next_record        -> ?record_info_gen(next_record);
           _ -> {error, unsupported_record}
       end).
  +
  +
  +%% Record-wrapper for regular records that needs to be saved in DB. Adds UUID and Revision info to each record.
  +%% `uuid` is document UUID, `rev_info` is documents' current revision number
  +%% `record` is an record representing this document (its data), `force_update` is a flag
  +%% that forces dao:save_record/1 to update this document even if rev_info isn't valid or up to date.
  +-record(veil_document, {uuid = "", rev_info = 0, record = none, force_update = false}).
  +
  +%% Those records represent view result Each #view_resault contains list of #view_row.
  +%% If the view has been queried with `include_docs` option, #view_row.doc will contain #veil_document, therefore
  +%% #view_row.id == #view_row.doc#veil_document.uuid. Unfortunately wrapping demanded record in #veil_document is
  +%% necessary because we may need revision info for that document.
  +-record(view_row, {id = "", key = "", value = 0, doc = none}).
  +-record(view_result, {total = 0, offset = 0, rows = []}).
  +
  +%% These records allows representing databases, design documents and their views.
  +%% Used in DAO initial configuration in order to easily setup/update views in database.
  +-record(db_info, {name = "", designs = []}).
  +-record(design_info, {name = "", version = 0, views = []}).
  +-record(view_info, {name = "", design = "", db_name = ""}).
   
   %% ====================================================================
   %% DB definitions
  
positive.code:             Design == DesignName, DbName2 == DbName]
      } || #view_info{db_name = DbName1, design = DesignName} <- ?VIEW_LIST, DbName1 == DbName]
  } || DbName <- ?DB_LIST]).
  
  -endif.
negative.code: -define(USER_BY_EMAIL_VIEW, #view_info{name = "user_by_email", design = ?USER_BY_EMAIL_DESIGN_NAME, db_name = ?USERS_DB_NAME}).
  -define(USER_BY_LOGIN_VIEW, #view_info{name = "user_by_login", design = ?USER_BY_LOGIN_DESIGN_NAME, db_name = ?USERS_DB_NAME}).
  -define(USER_BY_DN_VIEW, #view_info{name = "user_by_dn", design = ?USER_BY_DN_DESIGN_NAME, db_name = ?USERS_DB_NAME}).
  -define(USER_BY_UNVERIFIED_DN_VIEW, #view_info{name = "user_by_unverified_dn", design = ?USER_BY_UNVERIFIED_DN_DESIGN_NAME, db_name = ?USERS_DB_NAME}).
  -define(USER_BY_UID_VIEW, #view_info{name = "user_by_uid", design = ?USER_BY_UID_DESIGN_NAME, db_name = ?USERS_DB_NAME}).
  
  -define(SHARE_BY_FILE_VIEW, #view_info{name = "share_by_file", design = ?SHARE_BY_FILE_DESIGN_NAME, db_name = ?FILES_DB_NAME}).
  