journal/2021-03-14--13-00-04Z--the_service_pattern.org

This commit is contained in:
Yann Esposito (Yogsototh) 2021-03-20 09:52:24 +01:00
parent 2aa4f98560
commit 8e9cc5c821
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646

View file

@ -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