| summaryrefslogtreecommitdiff | 
diff options
| author | nsensfel <SpamShield0@noot-noot.org> | 2018-06-04 17:39:23 +0200 | 
|---|---|---|
| committer | nsensfel <SpamShield0@noot-noot.org> | 2018-06-04 17:39:23 +0200 | 
| commit | 25b3f31c8a451044459d104a3a36f919557b8d20 (patch) | |
| tree | 43e1a9a19cc6cd479de604ff45a93f8982c75cc3 /src/db/include | |
| parent | 4aa208ada20eaa3795740424d3519083fef1df65 (diff) | |
Analysis of 'db' -> crash. Always a good sign...
Diffstat (limited to 'src/db/include')
| -rw-r--r-- | src/db/include/db_item.hrl | 15 | ||||
| -rw-r--r-- | src/db/include/db_query.hrl | 10 | ||||
| -rw-r--r-- | src/db/include/db_user.hrl | 7 | 
3 files changed, 26 insertions, 6 deletions
| diff --git a/src/db/include/db_item.hrl b/src/db/include/db_item.hrl new file mode 100644 index 0000000..86d5863 --- /dev/null +++ b/src/db/include/db_item.hrl @@ -0,0 +1,15 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-record +( +   db_item, +   { +      id :: any(), +      perm :: db_user:permission(), +      val :: any() +   } +). + +-type db_item() :: #db_item{}. + diff --git a/src/db/include/db_query.hrl b/src/db/include/db_query.hrl index 45c040b..ac7745a 100644 --- a/src/db/include/db_query.hrl +++ b/src/db/include/db_query.hrl @@ -1,8 +1,6 @@  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --type db_user() :: ({'user', any()} | 'admin' | 'any'). -  -record  (     set_field, @@ -34,9 +32,9 @@  -record  ( -   set_user, +   set_perm,     { -      user :: db_user() +      perm :: db_user:permission()     }  ). @@ -46,12 +44,12 @@     {        db :: atom(),        id :: any(), -      user :: db_user(), +      user :: db_user:user(),        ops :: list(db_query_master_op())     }  ).  -type db_query_op() :: (#set_field{} | #add_to_field{} | #update_indexed{}). --type db_query_master_op() :: (db_query_op() | #set_user{}). +-type db_query_master_op() :: (db_query_op() | #set_perm{}).  -type db_query() :: #db_query{}. diff --git a/src/db/include/db_user.hrl b/src/db/include/db_user.hrl new file mode 100644 index 0000000..c5b033e --- /dev/null +++ b/src/db/include/db_user.hrl @@ -0,0 +1,7 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-type db_named_user() :: {'user', any()}. +-type db_user() :: (db_named_user() | 'admin' | 'any'). +-type db_permission() :: (list(db_named_user()) | 'any'). + | 


