Exemplo n.º 1
0
        /// <summary>
        /// Delete all data (be careful with it, make secure copy)
        /// </summary>
        public void Truncate()
        {
            SQLiteManager db    = GetDb();
            List <string> names = db.GetTableNames();

            foreach (string name in names)
            {
                db.TruncateTable(name);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Print row count of all tables to the console
        /// </summary>
        public void PrintTableCount()
        {
            SQLiteManager db    = GetDb();
            List <string> names = db.GetTableNames();

            foreach (string name in names)
            {
                string sql = "SELECT COUNT(*) AS cnt FROM " + name;
                print(name + ": " + db.GetResultReader(sql)["cnt"]);
            }
        }
Exemplo n.º 3
0
        private SQLiteManager GetDb()
        {
            UseDatabase   udb = GetComponent <UseDatabase>();
            SQLiteManager db  = null;

            try {
                db = new SQLiteManager(udb.GetDatabaseFilePath());
            } catch (Exception e) {
                udb.UnselectBinary();
                Debug.LogException(e);
                throw e;
            }
            return(db);
        }