mCleaner.Logics.Commands.CommandLogic_Chrome.CleanDatabases C# (CSharp) Method

CleanDatabases() public static method

public static CleanDatabases ( string file ) : string
file string
return string
        public static string CleanDatabases(string file)
        {
            string ret = string.Empty;
            string sql = string.Empty;
            sql = "";
            string where = string.Empty;
            string[] cols = new string[] {
                "origin", "name", "description"
            };
            where = "where origin not like 'chrome-%'";
            if (Shred)
            {
                sql += CreateRandomBlobQuery(cols, "Databases", where);
            }
            sql = string.Format("delete from Databases {0};", where);

            string result = SQLite.ExecuteNonQuery(file, sql);

            if (result != string.Empty)
            {
                ret = "An unkown error occured while executing a query in CommandLogic_Chrome.CleanDatabase";

                if (result.Contains("database is locked"))
                {
                    ret = "database is locked";
                }
            }

            return ret;
        }