Click here to Skip to main content
15,898,010 members
Articles / Database Development / SQL Server / SQL Server 2008

DbExpressions - A Step Towards Independency

Rate me:
Please Sign up or sign in to vote.
4.24/5 (12 votes)
2 Feb 2011CPOL9 min read 73.8K   317   18  
An abstract syntax tree implementation for SQL
namespace DbExpressions
{
    /// <summary>
    /// Describes the node types for the nodes of an <see cref="DbExpression"/> tree.     
    /// </summary>
    /// <value></value>
    public enum DbExpressionType
    {
        /// <summary>
        /// A node that represents a <see cref="DbBinaryExpressionType"/>
        /// <seealso cref="DbBinaryExpression"/>
        /// </summary>
        Binary,
        
        /// <summary>
        /// A node that represents a list of <see cref="DbExpression"/> instances.
        /// </summary>
        List,


        /// <summary>
        /// A node that represents the execution of multiple statements as one batch
        /// </summary>
        Batch,

        ///// <summary>
        ///// A node that represents an aggregate function 
        ///// </summary>
        //Aggregate,
        
        /// <summary>
        /// A node that represents calling a function.
        /// </summary>
        Function,

        /// <summary>
        /// A node that represents a <see cref="DbExpression"/> that has a constant value.
        /// </summary>
        Constant,

        /// <summary>
        /// A node the represents the 'SELECT' clause of the query
        /// </summary>
        Select,
        
        /// <summary>
        /// A node the represents the 'INSERT' clause of the query
        /// </summary>
        Insert,

        /// <summary>
        /// A node the represents the 'UPDATE' clause of the query
        /// </summary>
        Update,

        /// <summary>
        /// A node the represents the 'DELETE' clause of the query
        /// </summary>
        Delete,

        /// <summary>
        /// A node that represents a <see cref="DbQuery{TQueryExpression}"/> 
        /// </summary>
        Query,

        /// <summary>
        /// A node that represents an element in the 'ORDER BY' clause of the query
        /// </summary>
        OrderBy,

        /// <summary>
        /// A node the represents the 'GROUP BY' clause of the query
        /// </summary>
        GroupBy,

        /// <summary>
        /// A node that represents a table reference in the query.
        /// </summary>
        Table,

        /// <summary>
        /// A node that represents a column reference in the query.
        /// </summary>
        Column,

        /// <summary>
        /// A node that represents a 'JOIN' in the query.
        /// </summary>
        Join,

        /// <summary>
        /// A node that represents an 'EXISTS' subquery.
        /// </summary>
        Exists,

        /// <summary>
        /// A node that represents an alised <see cref="DbExpression"/>.
        /// </summary>
        Alias,

        /// <summary>
        /// A node that represents a <see cref="DbExpression"/> prefix.
        /// </summary>
        Prefix,

        /// <summary>
        /// A node the represents a <see cref="DbUnaryExpression"/>.
        /// </summary>
        Unary,

        /// <summary>
        /// A node that represents a <see cref="DbConditionalExpression"/>.
        /// </summary>
        Conditional,
 
        /// <summary>
        /// A node that represents a <see cref="DbConcatExpression"/>
        /// </summary>
        Concat,

        /// <summary>
        /// A node that represents a <see cref="DbInExpression"/>
        /// </summary>
        In,

        /// <summary>
        /// A node that represents a sql fragment.
        /// </summary>
        Sql


    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Norway Norway
I'm a 39 year old software developer living in Norway.
I'm currently working for a software company making software for the retail industry.

Comments and Discussions