//---------------------------------------------------------------------
//
// Portions of this file copyright (c) Microsoft Corporation
// and are released under the Microsoft Pulic License. See
// http://archive.msdn.microsoft.com/EFSampleProvider/Project/License.aspx
// or License.txt for details.
// All rights reserved.
//
//---------------------------------------------------------------------
namespace System.Data.SQLite
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
#if USE_ENTITY_FRAMEWORK_6
using System.Data.Entity.Core.Common.CommandTrees;
#else
using System.Data.Common.CommandTrees;
#endif
///
/// This class is like StringBuilder. While traversing the tree for the first time,
/// we do not know all the strings that need to be appended e.g. things that need to be
/// renamed, nested select statements etc. So, we use a builder that can collect
/// all kinds of sql fragments.
///
internal sealed class SqlBuilder : ISqlFragment
{
private List