Пример #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;
 }