Beispiel #1
0
        private void refreshTables()
        {
            var tables = this.Connection.Query <Table>("SELECT * FROM 'Table'");

            foreach (var table in tables)
            {
                if (!Tables.ContainsKey(table.Name))
                {
                    TableSameDatabase tblDB = new TableSameDatabase(table.Name, this.Connection);
                    Tables.Add(table.Name, tblDB);
                }
            }
        }
Beispiel #2
0
        private void SQLiteDataEntityImpl(bool initDb = true, bool isReadOnly = false)
        {
            _tableName  = typeof(T).Name;
            _isReadOnly = isReadOnly;
            if (initDb)
            {
                InitEntityDatabase();
            }

            else
            {
                _table = AppDatabase.CurrentInstance.Tables[_tableName];
            }
            //Context.Current.RegisterEntity<T>();
        }
Beispiel #3
0
 //todo: optimization on columns to determine if they changed and thus do a DeleteAllColumns and rebuild
 private void InitEntityDatabase()
 {
     AppDatabase.CurrentInstance.AddTable(_tableName, _defaultCreator);
     _table = AppDatabase.CurrentInstance.Tables[_tableName];
 }