app: make DataStore a class and refine on each platform
[nit.git] / lib / linux / data_store.nit
index 5924822..6270bd2 100644 (file)
@@ -19,15 +19,10 @@ module data_store
 
 import app::data_store
 private import xdg_basedir
-private import sqlite3
+import sqlite3
 private import json
 
-redef class App
-       redef var data_store = new LinuxStore
-end
-
-private class LinuxStore
-       super DataStore
+redef class DataStore
 
        # File path of the Sqlite3 DB file
        fun db_file: String do return "data_store.db"
@@ -35,7 +30,7 @@ private class LinuxStore
        # Sqlite3 table used
        fun db_table: String do return "data_store"
 
-       var db_cache: nullable Sqlite3DB = null
+       private var db_cache: nullable Sqlite3DB = null
 
        # Database to use to implement the `DataStore`
        fun db: nullable Sqlite3DB