コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: Compound.cs プロジェクト: aquiris/unity-sqlite
        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);
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 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);
 }
コード例 #5
0
ファイル: On.cs プロジェクト: aquiris/unity-sqlite
 public On Column(string name)
 {
     _components.Add(new StringComponent(name));
     return(this);
 }
コード例 #6
0
 public Select Begin()
 {
     _components.Add(new StringComponent(Constants.QueryComponents.SELECT));
     return(this);
 }
コード例 #7
0
ファイル: GroupBy.cs プロジェクト: aquiris/unity-sqlite
 public GroupBy Expression(string expression)
 {
     _components.Add(new StringComponent(expression));
     return(this);
 }
コード例 #8
0
ファイル: GroupBy.cs プロジェクト: aquiris/unity-sqlite
 internal GroupBy(QueryComponents components)
 {
     _components = components;
     _components.Add(new StringComponent(Constants.QueryComponents.GROUP_BY));
 }
コード例 #9
0
 public Joins Left()
 {
     _components.Add(new StringComponent(Constants.QueryComponents.LEFT));
     return(this);
 }
コード例 #10
0
 internal OrderBy(QueryComponents components)
 {
     _components = components;
     _components.Add(new StringComponent(Constants.QueryComponents.ORDER_BY));
 }
コード例 #11
0
 public As Alias(string alias)
 {
     _components.Add(new StringComponent(alias));
     return(this);
 }
コード例 #12
0
ファイル: Where.cs プロジェクト: aquiris/unity-sqlite
 public Where Column(string columnName)
 {
     _components.Add(new StringComponent(columnName));
     return(this);
 }
コード例 #13
0
ファイル: Where.cs プロジェクト: aquiris/unity-sqlite
 internal Where(QueryComponents components)
 {
     _components = components;
     _components.Add(new StringComponent(Constants.QueryComponents.WHERE));
 }
コード例 #14
0
 public ForeignKeys Begin()
 {
     _components.Add(new StringComponent(Constants.QueryComponents.FOREIGN_KEY));
     return(this);
 }
コード例 #15
0
        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);
        }
コード例 #16
0
 internal Window(QueryComponents components)
 {
     _components = components;
     _components.Add(new StringComponent(Constants.QueryComponents.WINDOW));
 }
コード例 #17
0
 internal As(QueryComponents components)
 {
     _components = components;
     _components.Add(new StringComponent(Constants.QueryComponents.AS));
 }
コード例 #18
0
ファイル: Columns.cs プロジェクト: aquiris/unity-sqlite
 public Columns Begin()
 {
     _components.Add(new StringComponent(Constants.QueryComponents.PARENTHESIS_OPEN));
     return(this);
 }
コード例 #19
0
ファイル: Delete.cs プロジェクト: aquiris/unity-sqlite
 public Delete With()
 {
     _components.Add(new StringComponent(Constants.QueryComponents.WITH));
     return(this);
 }
コード例 #20
0
 internal Limit(QueryComponents components)
 {
     _components = components;
     _components.Add(new StringComponent(Constants.QueryComponents.LIMIT));
 }