コード例 #1
0
        // Constructors

        private PostCompiler(SqlPostCompilerConfiguration configuration, int estimatedResultLength)
        {
            int capacity = estimatedResultLength + ResultCapacityMargin;

            result             = new StringBuilder(capacity < MinimalResultCapacity ? MinimalResultCapacity : capacity);
            this.configuration = configuration;
        }
コード例 #2
0
        public static string Process(Node root, SqlPostCompilerConfiguration configuration, int estimatedResultLength)
        {
            var compiler = new PostCompiler(configuration, estimatedResultLength);

            compiler.VisitNodeSequence(root);
            return(compiler.result.ToString());
        }
コード例 #3
0
        /// <summary>
        /// Gets the textual representation of SQL DOM statement compilation.
        /// Query is postprocessed using the specified <paramref name="configuration"/>.
        /// </summary>
        /// <param name="configuration">The postcompiler configuration.</param>
        /// <returns>The SQL text command.</returns>
        public string GetCommandText(SqlPostCompilerConfiguration configuration)
        {
            if (resultText != null)
            {
                return(resultText);
            }
            string result = PostCompiler.Process(resultNode, configuration, lastResultLength);

            lastResultLength = result.Length;
            return(result);
        }