public SqlStatement Parse(SqlQueryParser parser) { return(new SqlDelete() { FromSource = parser.ParseQuery(Parent), }); }
public SqlStatement Parse(SqlQueryParser parser) { return(new SqlSelect() { FromSource = parser.ParseQuery(SelectQuery), }); }
public SqlStatement Parse(SqlQueryParser parser) { return(new SqlSet() { Expression = parser.ParseExpression(ValueExpression), Variable = Variable, }); }
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)); }
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)); }
public SqlStatement Parse(SqlQueryParser parser) { return(new SqlDeclareVariable() { VariableName = VariableName, VariableType = typeof(T), SqlTypeInfo = SqlTypeInfo, }); }
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, }); }
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, }); }