コード例 #1
0
        /// <summary>
        /// Applies the change script.
        /// </summary>
        /// <param name="script">The script.</param>
        /// <param name="output">The output from applying the change script.</param>
        protected void ApplyChangeScript(ChangeScript script, StringBuilder output)
        {
            ICollection <string> statements = this.splitter.Split(script.GetContent());

            int i = 0;

            foreach (var statement in statements)
            {
                try
                {
                    if (statements.Count > 1)
                    {
                        this.infoTextWriter.WriteLine(" -> statement " + (i + 1) + " of " + statements.Count + "...");
                    }

                    this.queryExecuter.Execute(statement, output);

                    i++;
                }
                catch (DbException e)
                {
                    throw new ChangeScriptFailedException(e, script, i + 1, statement);
                }
                finally
                {
                    // Write out SQL execution output.
                    if (output.Length > 0)
                    {
                        this.infoTextWriter.WriteLine(output.ToString());
                    }
                }
            }
        }
コード例 #2
0
        protected void ApplyChangeScript(ChangeScript script)
        {
            ICollection <string> statements = this.splitter.Split(script.GetContent());

            int i = 0;

            foreach (var statement in statements)
            {
                try
                {
                    if (statements.Count > 1)
                    {
                        this.infoTextWriter.WriteLine(" -> statement " + (i + 1) + " of " + statements.Count + "...");
                    }

                    this.queryExecuter.Execute(statement);

                    i++;
                }
                catch (DbException e)
                {
                    throw new ChangeScriptFailedException(e, script, i + 1, statement);
                }
            }
        }
コード例 #3
0
 public new void ApplyChangeScript(ChangeScript script, StringBuilder output)
 {
     base.ApplyChangeScript(script, script.GetContent(), output);
 }