public SelectSqlSection(Database db, QueryTable table, params ExpressionClip[] columns) { this.db = db; this.tableName = table.TableName; string aliasName = table.TableAlias; this.whereClip = new WhereClip(new FromClip(this.tableName, string.IsNullOrEmpty(aliasName) ? this.tableName : aliasName)); if (table is IExpression) { SqlQueryUtils.AddParameters(this.whereClip.Parameters, table as IExpression); } if (columns != null && columns.Length > 0) { this.columnNames = new string[columns.Length]; for (int i = 0; i < columns.Length; ++i) { this.columnNames[i] = columns[i].ToString(); //add parameters in column to whereClip if (columns[i].Parameters.Count > 0) { SqlQueryUtils.AddParameters(this.whereClip.Parameters, columns[i]); } } } }
public UpdateSqlSection(Database db, QueryTable table) { //Check.Require(db != null, "db could not be null."); //Check.Require(table != null, "table could not be null."); this.db = db; this.tableName = table.TableName; }
public static QueryColumn All(QueryTable table) { if (table == null) { return(new QueryColumn("*", DbType.Int32)); } return(new QueryColumn(string.Format("[{0}].*", table.TableAlias), DbType.Int32)); }
public SelectSqlSection RightJoin(QueryTable joinTable, string joinTableAliasName, WhereClip joinOnWhere) { this.whereClip.From.RightJoin(joinTable.TableName, joinTableAliasName, joinOnWhere); if (joinOnWhere.Parameters.Count > 0) { SqlQueryUtils.AddParameters(whereClip.Parameters, joinOnWhere); } return(this); }
public DeleteSqlSection(Database db, QueryTable table) { this.db = db; this.tableName = table.TableName; }
public SelectSqlSection RightJoin(QueryTable joinTable, WhereClip joinOnWhere) { return(RightJoin(joinTable, joinTable.TableAlias, joinOnWhere)); }