<commit_before>package com.getbase.android.db.fluentsqlite;

import com.getbase.android.db.fluentsqlite.query.QueryBuilder.Query;
import com.getbase.android.db.fluentsqlite.query.RawQuery;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Iterables;

import java.util.Arrays;
import java.util.Iterator;

public final class Expressions {
  private Expressions() {
  }

  public interface UnaryOperator {
    ExpressionCore not();
  }

  public interface Expression {
    String toRawSql();
  }

  public interface ExpressionCore {
    // basic stuff
    ExpressionCombiner column(String col);
    ExpressionCombiner column(String table, String col);
    ExpressionCombiner arg();
    ExpressionCombiner nul();
    ExpressionCombiner literal(Number number);
    ExpressionCombiner literal(Object object);

    // aggregate functions
    ExpressionCombiner sum(Expression e);
    ExpressionCombiner count(Expression e);
    ExpressionCombiner count();
    ExpressionCombiner max(Expression e);
    ExpressionCombiner min(Expression e);

    // coalescing functions
    ExpressionCombiner ifNull(Expression left, Expression right);
    ExpressionCombiner nullIf(Expression left, Expression right);
    ExpressionCombiner coalesce(Expression... expressions);

    // strings operations
    ExpressionCombiner length(Expression e);
    ExpressionCombiner concat(Expression... e);
    ExpressionCombiner join(String on, Expression... e);
  }
<commit_msg>Add interfaces for fluent sqlite API for building CASE expressions<commit_after>package com.getbase.android.db.fluentsqlite;

import com.getbase.android.db.fluentsqlite.query.QueryBuilder.Query;
import com.getbase.android.db.fluentsqlite.query.RawQuery;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.AbstractIterator;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Iterables;

import java.util.Arrays;
import java.util.Iterator;

public final class Expressions {
  private Expressions() {
  }

  public interface UnaryOperator {
    ExpressionCore not();
  }

  public interface Expression {
    String toRawSql();
  }

  public interface ExpressionCore {
    // basic stuff
    ExpressionCombiner column(String col);
    ExpressionCombiner column(String table, String col);
    ExpressionCombiner arg();
    ExpressionCombiner nul();
    ExpressionCombiner literal(Number number);
    ExpressionCombiner literal(Object object);

    // aggregate functions
    ExpressionCombiner sum(Expression e);
    ExpressionCombiner count(Expression e);
    ExpressionCombiner count();
    ExpressionCombiner max(Expression e);
    ExpressionCombiner min(Expression e);

    // coalescing functions
    ExpressionCombiner ifNull(Expression left, Expression right);
    ExpressionCombiner nullIf(Expression left, Expression right);
    ExpressionCombiner coalesce(Expression... expressions);

    // strings operations
    ExpressionCombiner length(Expression e);
    ExpressionCombiner concat(Expression... e);
    ExpressionCombiner join(String on, Expression... e);
  }

  public interface CaseExpressions {
    CaseCondition cases();
    CaseCondition cases(Expression e);
  }

  public interface CaseCondition {
    CaseValue when(Expression e);
  }

  public interface CaseValue {
    CaseExpressionBuilder then(Expression e);
  }

  public interface CaseExpressionBuilder extends CaseCondition, CaseExpressionEndStep {
    ExpressionCombiner otherwise(Expression e);
  }

  public interface CaseExpressionEndStep {
    ExpressionCombiner end();
  }

{'fraction_non_alphanumeric': 0.08459135866736076, 'fraction_numerical': 0.0, 'mean_word_length': 4.513629842180775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3405039', 'n_tokens_mistral': 1004, 'n_tokens_neox': 1017, 'n_words': 253}