// Constructors private PostCompiler(SqlPostCompilerConfiguration configuration, int estimatedResultLength) { int capacity = estimatedResultLength + ResultCapacityMargin; result = new StringBuilder(capacity < MinimalResultCapacity ? MinimalResultCapacity : capacity); this.configuration = configuration; }
public static string Process(Node root, SqlPostCompilerConfiguration configuration, int estimatedResultLength) { var compiler = new PostCompiler(configuration, estimatedResultLength); compiler.VisitNodeSequence(root); return(compiler.result.ToString()); }
/// <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); }