You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't been super consistent on the naming of all the utilities in models, need to do through and audit and rename them.
Current thinking is for extreme clarity, so things like, CreateContact should be InsertContact and things like GetContact should be SelectContact.. IE if we know for sure we are going to hit the DB, then we use Select .. if there may be a cache in between then we can use Get. Same rules for Update etc..
The text was updated successfully, but these errors were encountered:
Thought about this a bit when I was adding all the new import stuff. I think I would lean toward verbs that provide some information about the higher-level contract rather than the db operations, since there's often multiple db operations involved.
So exported functions that look like:
CreateX - create new X and return it, or error
GetX - return existing X or an error
GetOrCreateX - return existing or newly created X or an error
LookupX - X may or may not exist, may return nil and no error
UpdateX
ReleaseX
But those might call lower-level utilities which do actually describe their DB behavior:
I haven't been super consistent on the naming of all the utilities in
models
, need to do through and audit and rename them.Current thinking is for extreme clarity, so things like,
CreateContact
should beInsertContact
and things likeGetContact
should beSelectContact
.. IE if we know for sure we are going to hit the DB, then we useSelect
.. if there may be a cache in between then we can useGet
. Same rules forUpdate
etc..The text was updated successfully, but these errors were encountered: