From c2e3bd4f00c4079a1c560f4e90b16a21d2073292 Mon Sep 17 00:00:00 2001 From: Tim Glasgow Date: Sun, 24 Jul 2022 14:49:22 -0500 Subject: [PATCH] setup db API --- squarenotsquare/realm/dbAPI.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 squarenotsquare/realm/dbAPI.js diff --git a/squarenotsquare/realm/dbAPI.js b/squarenotsquare/realm/dbAPI.js new file mode 100644 index 0000000..6f5e46e --- /dev/null +++ b/squarenotsquare/realm/dbAPI.js @@ -0,0 +1,27 @@ +import {systemRepo, userRepo, scoreRepo} from './dbInit'; + +class realmAPI { + constructor(){ + if (realmDB === null) { + realmDB = this; + } + + return realmDB; + } + + getAllSystemValues() { + return systemRepo.getAllSystemValues(); + } + + createSystemValue(key, value) { + systemRepo.createSystemValue(key, value); + } + + deleteSystemValue(key) { + systemRepo.deleteSystemValue(key); + } + + getSystemValue(key) { + return systemRepo.getSystemKeyValue(key); + } +} \ No newline at end of file