public Window Name(string name, string definition) { _components.Add(new StringComponent(name)); _components.Add(new StringComponent(Constants.QueryComponents.AS)); _components.Add(new StringComponent(definition)); return(this); }
internal Compound(QueryComponents components, CompoundType type) { _components = components; switch (type) { case CompoundType.Union: _components.Add(new StringComponent(Constants.QueryComponents.UNION)); break; case CompoundType.UnionAll: _components.Add(new StringComponent(Constants.QueryComponents.UNION)); _components.Add(new StringComponent(Constants.QueryComponents.SELECT_ALL)); break; case CompoundType.Intersects: _components.Add(new StringComponent(Constants.QueryComponents.INTERSECT)); break; case CompoundType.Except: _components.Add(new StringComponent(Constants.QueryComponents.EXCEPT)); break; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public Values Begin(bool beginValues = true) { StringComponent values = new StringComponent(Constants.QueryComponents.VALUES); StringComponent comma = new StringComponent(Constants.QueryComponents.COMMA); _components.Add(beginValues ? values : comma); _components.Add(new StringComponent(Constants.QueryComponents.PARENTHESIS_OPEN)); return(this); }
public Insert Begin(InsertMode mode, ConflictMode?conflictMode = null) { if (conflictMode.HasValue) { _components.Add(new InsertComponent(conflictMode.Value)); return(this); } _components.Add(new InsertComponent(mode)); return(this); }
public On Column(string name) { _components.Add(new StringComponent(name)); return(this); }
public Select Begin() { _components.Add(new StringComponent(Constants.QueryComponents.SELECT)); return(this); }
public GroupBy Expression(string expression) { _components.Add(new StringComponent(expression)); return(this); }
internal GroupBy(QueryComponents components) { _components = components; _components.Add(new StringComponent(Constants.QueryComponents.GROUP_BY)); }
public Joins Left() { _components.Add(new StringComponent(Constants.QueryComponents.LEFT)); return(this); }
internal OrderBy(QueryComponents components) { _components = components; _components.Add(new StringComponent(Constants.QueryComponents.ORDER_BY)); }
public As Alias(string alias) { _components.Add(new StringComponent(alias)); return(this); }
public Where Column(string columnName) { _components.Add(new StringComponent(columnName)); return(this); }
internal Where(QueryComponents components) { _components = components; _components.Add(new StringComponent(Constants.QueryComponents.WHERE)); }
public ForeignKeys Begin() { _components.Add(new StringComponent(Constants.QueryComponents.FOREIGN_KEY)); return(this); }
public Table Begin(TableMode mode, bool isView = false) { switch (mode) { case TableMode.Create: StringComponent createTable = new StringComponent(Constants.QueryComponents.CREATE_TABLE); StringComponent createView = new StringComponent(Constants.QueryComponents.CREATE_VIEW); _components.Add(isView ? createView : createTable); break; case TableMode.Alter: if (isView) { throw new NotSupportedException("Sqlite error: Cannot alter a view"); } _components.Add(new StringComponent(Constants.QueryComponents.ALTER_TABLE)); break; case TableMode.Drop: StringComponent dropTable = new StringComponent(Constants.QueryComponents.DROP_TABLE); StringComponent dropView = new StringComponent(Constants.QueryComponents.DROP_VIEW); _components.Add(isView ? dropView : dropTable); break; default: throw new ArgumentOutOfRangeException(nameof(mode), mode, null); } return(this); }
internal Window(QueryComponents components) { _components = components; _components.Add(new StringComponent(Constants.QueryComponents.WINDOW)); }
internal As(QueryComponents components) { _components = components; _components.Add(new StringComponent(Constants.QueryComponents.AS)); }
public Columns Begin() { _components.Add(new StringComponent(Constants.QueryComponents.PARENTHESIS_OPEN)); return(this); }
public Delete With() { _components.Add(new StringComponent(Constants.QueryComponents.WITH)); return(this); }
internal Limit(QueryComponents components) { _components = components; _components.Add(new StringComponent(Constants.QueryComponents.LIMIT)); }