Пример #1
0
        /// <summary>
        /// Run the comparison.
        /// </summary>
        /// <returns></returns>
        public string Execute()
        {
            var sb = new StringBuilder();

            var compareTables = new CompareTables(sb, _writer);
            //make sure they are in topological order- if 2 tables are added, the first must not have a foreign key to the second...
            var comparedTables = SchemaTablesSorter.TopologicalSort(_compareSchema);

            compareTables.Execute(_baseSchema.Tables, comparedTables);

            //compare sequences
            var compareSequences = new CompareSequences(sb, _writer);

            compareSequences.Execute(_baseSchema.Sequences, _compareSchema.Sequences);

            //compare views
            var compareViews = new CompareViews(sb, _writer);

            compareViews.Execute(_baseSchema.Views, _compareSchema.Views);

            //compare stored procedures and functions
            var compareProcedures = new CompareProcedures(sb, _writer);

            compareProcedures.Execute(_baseSchema.StoredProcedures, _compareSchema.StoredProcedures);
            var compareFunctions = new CompareFunctions(sb, _writer);

            compareFunctions.Execute(_baseSchema.Functions, _compareSchema.Functions);

            //compare packages
            var comparePackages = new ComparePackages(sb, _writer);

            comparePackages.Execute(_baseSchema.Packages, _compareSchema.Packages);

            return(sb.ToString());
        }
Пример #2
0
        /// <summary>
        /// Run the comparison and returns a <see cref="CompareResult"/>.
        /// </summary>
        /// <returns></returns>
        public IList<CompareResult> ExecuteResult()
        {
            var list = new List<CompareResult>();

            var compareTables = new CompareTables(list, _writer);
            //make sure they are in topological order- if 2 tables are added, the first must not have a foreign key to the second...
            var comparedTables = SchemaTablesSorter.TopologicalSort(_compareSchema);
            compareTables.Execute(_baseSchema.Tables, comparedTables);

            //compare sequences
            var compareSequences = new CompareSequences(list, _writer);
            compareSequences.Execute(_baseSchema.Sequences, _compareSchema.Sequences);

            //compare views
            var compareViews = new CompareViews(list, _writer);
            compareViews.Execute(_baseSchema.Views, _compareSchema.Views);

            //compare stored procedures and functions
            var compareProcedures = new CompareProcedures(list, _writer);
            compareProcedures.Execute(_baseSchema.StoredProcedures, _compareSchema.StoredProcedures);
            var compareFunctions = new CompareFunctions(list, _writer);
            compareFunctions.Execute(_baseSchema.Functions, _compareSchema.Functions);

            //compare packages
            var comparePackages = new ComparePackages(list, _writer);
            comparePackages.Execute(_baseSchema.Packages, _compareSchema.Packages);

            return list;
        }
Пример #3
0
        /// <summary>
        /// Run the comparison and returns a <see cref="CompareResult"/>.
        /// </summary>
        /// <returns></returns>
        public IList <CompareResult> ExecuteResult()
        {
            var list = new List <CompareResult>();

            var compareTables = new CompareTables(list, _writer);
            //make sure they are in topological order- if 2 tables are added, the first must not have a foreign key to the second...
            var comparedTables = SchemaTablesSorter.TopologicalSort(_compareSchema);

            compareTables.Execute(_baseSchema.Tables, comparedTables);

            //compare sequences
            var compareSequences = new CompareSequences(list, _writer);

            compareSequences.Execute(_baseSchema.Sequences, _compareSchema.Sequences);

            //compare views
            var compareViews = new CompareViews(list, _writer);

            compareViews.Execute(_baseSchema.Views, _compareSchema.Views);

            //compare stored procedures and functions
            var compareProcedures = new CompareProcedures(list, _writer);

            compareProcedures.Execute(_baseSchema.StoredProcedures, _compareSchema.StoredProcedures);
            var compareFunctions = new CompareFunctions(list, _writer);

            compareFunctions.Execute(_baseSchema.Functions, _compareSchema.Functions);

            //compare packages
            var comparePackages = new ComparePackages(list, _writer);

            comparePackages.Execute(_baseSchema.Packages, _compareSchema.Packages);

            return(list);
        }