journal/2021-03-14--13-00-04Z--the_service_pattern.org
This commit is contained in:
parent
2aa4f98560
commit
8e9cc5c821
1 changed files with 12 additions and 0 deletions
|
@ -144,3 +144,15 @@ So you create an intermediate store layer.
|
|||
|
||||
That layer will take a configuration like: DB-type, DB-configuration
|
||||
and given this configuration provide a CRUD interface.
|
||||
|
||||
So basically you could write something like:
|
||||
|
||||
#+begin_src
|
||||
require MyCRUD
|
||||
|
||||
usersCRUDAPI = MyCRUD(db = "postgresql", db_conf = { table:"users", url:... })
|
||||
booksCRUDAPI = MyCRUD(db = "elasticsearch", db_conf = { index:"books", url:... })
|
||||
...
|
||||
|
||||
|
||||
#+end_src
|
||||
|
|
Loading…
Reference in a new issue