예제 #1
0
        public int Count(DatabaseTableExpression expression)
        {
            return(DoCommand(delegate(SQLiteCommand command) {
                command.CommandText = expression.BuildCount(this, command.Parameters);

                return command.ExecuteScalar().Convert <int>();
            }));
        }
예제 #2
0
        public IEnumerable <DatabaseTableRow> Retrieve(DatabaseTableExpression expression)
        {
            return(DoCommand(delegate(SQLiteCommand command) {
                command.CommandText = expression.BuildSelect(this, command.Parameters);

                List <DatabaseTableRow> rows = new List <DatabaseTableRow>();
                using (SQLiteDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        rows.Add(new DatabaseTableRow(reader, this));
                    }
                }

                return rows;
            }));
        }
예제 #3
0
 static public DatabaseTableExpression NotEqualsExpression(this DatabaseTableExpression item, DatabaseTableExpression expression)
 {
     return(new DatabaseTableExpression_Operation_Binary_NotEquals(item, expression));
 }
예제 #4
0
 static public DatabaseTableExpression ContainsExpression(this DatabaseTableExpression item, DatabaseTableExpression expression)
 {
     return(new DatabaseTableExpression_Operation_Binary_Contains(item, expression));
 }
예제 #5
0
 static public DatabaseTableExpression ContainsExpression(this DatabaseTableField item, DatabaseTableExpression expression)
 {
     return(item.GetExpression().ContainsExpression(expression));
 }
예제 #6
0
 public DatabaseTableExpression_Operation_Binary_LogicalOr(DatabaseTableExpression l, DatabaseTableExpression r)
     : base("?LEFT OR ?RIGHT", l, r)
 {
 }
예제 #7
0
 static public DatabaseTableExpression NotEqualsExpression(this DatabaseTableField item, DatabaseTableExpression expression)
 {
     return(item.GetExpression().NotEqualsExpression(expression));
 }
예제 #8
0
 public DatabaseTableExpression_Operation_Binary_Multiply(DatabaseTableExpression l, DatabaseTableExpression r)
     : base("?LEFT * ?RIGHT", l, r)
 {
 }
예제 #9
0
 public DatabaseTableExpression_Operation_Binary_Divide(DatabaseTableExpression l, DatabaseTableExpression r)
     : base("?LEFT / ?RIGHT", l, r)
 {
 }
예제 #10
0
 public DatabaseTableExpression_Operation_Binary_Subtract(DatabaseTableExpression l, DatabaseTableExpression r)
     : base("?LEFT - ?RIGHT", l, r)
 {
 }
예제 #11
0
 public DatabaseTableExpression_Operation_Binary_Add(DatabaseTableExpression l, DatabaseTableExpression r)
     : base("?LEFT + ?RIGHT", l, r)
 {
 }
예제 #12
0
 public DatabaseTableExpression_Operation_Binary_Contains(DatabaseTableExpression l, DatabaseTableExpression r)
     : base("?LEFT LIKE '%'||?RIGHT||'%'", l, r)
 {
 }
예제 #13
0
 public DatabaseTableExpression_Operation_Binary_NotEquals(DatabaseTableExpression l, DatabaseTableExpression r)
     : base("?LEFT != ?RIGHT", l, r)
 {
 }
예제 #14
0
 public DatabaseTableExpression_Operation_Binary(string lo, DatabaseTableExpression l, DatabaseTableExpression r) : base(lo)
 {
     left  = l;
     right = r;
 }