From 8e9cc5c821904b9ae5d94b98f0eab82fdfb0d413 Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Sat, 20 Mar 2021 09:52:24 +0100 Subject: [PATCH] journal/2021-03-14--13-00-04Z--the_service_pattern.org --- .../2021-03-14--13-00-04Z--the_service_pattern.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/journal/2021-03-14--13-00-04Z--the_service_pattern.org b/journal/2021-03-14--13-00-04Z--the_service_pattern.org index a3871ac5..dc485300 100644 --- a/journal/2021-03-14--13-00-04Z--the_service_pattern.org +++ b/journal/2021-03-14--13-00-04Z--the_service_pattern.org @@ -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