示例#1
0
 public SqlStatement Parse(SqlQueryParser parser)
 {
     return(new SqlDelete()
     {
         FromSource = parser.ParseQuery(Parent),
     });
 }
示例#2
0
 public SqlStatement Parse(SqlQueryParser parser)
 {
     return(new SqlSelect()
     {
         FromSource = parser.ParseQuery(SelectQuery),
     });
 }
示例#3
0
 public SqlStatement Parse(SqlQueryParser parser)
 {
     return(new SqlSet()
     {
         Expression = parser.ParseExpression(ValueExpression),
         Variable = Variable,
     });
 }
示例#4
0
        public string GetSql(StatementList statementList, out List <KeyValuePair <string, object> > constants)
        {
            var parser = new SqlQueryParser(new SqlAliasProvider(), new Dictionary <string, SqlSubQueryResult>());
            var stmts  = parser.ParseStatementList(statementList);

            constants = parser.Constants.ToList();
            return(GetSql(stmts));
        }
示例#5
0
        public IEnumerable <T> ExecuteQuery <T>(StatementList statementList)
        {
            var parser    = new SqlQueryParser(new SqlAliasProvider(), new Dictionary <string, SqlSubQueryResult>());
            var stmts     = parser.ParseStatementList(statementList);
            var constants = parser.Constants.ToList();

            return(ExecuteQuery <T>(stmts, constants));
        }
示例#6
0
 public SqlStatement Parse(SqlQueryParser parser)
 {
     return(new SqlDeclareVariable()
     {
         VariableName = VariableName,
         VariableType = typeof(T),
         SqlTypeInfo = SqlTypeInfo,
     });
 }
示例#7
0
        public SqlStatement Parse(SqlQueryParser parser)
        {
            var parameters = new Dictionary <string, SqlSubQueryResult>();
            var inserts    = parser.ParseInsertBuilder(FromQuery, InsertExpression, parameters);

            var primaryKey = FromQuery.Columns.Where(c => c.PrimaryKeyAutoIncrement).FirstOrDefault();

            return(new SqlInsert()
            {
                Inserts = inserts,
                TableName = FromQuery.TableName,
                AutoIncrementPrimaryKeyName = primaryKey?.SqlName,
            });
        }
示例#8
0
        public SqlStatement Parse(SqlQueryParser parser)
        {
            var queryResult = parser.ParseQuery(Parent);
            var parameters  = new Dictionary <string, SqlSubQueryResult>();

            parameters[InsertExpression.Parameters[0].Name] = queryResult.SelectResult; // item
            // parameters[stmt.InsertExpression.Parameters[1].Name] = ; // builder

            var inserts = parser.ParseInsertBuilder(FromQuery, InsertExpression, parameters);

            return(new SqlUpdate()
            {
                FromSource = queryResult,
                Inserts = inserts,
            });
        }