// Path: sane-dbc-core/src/main/java/com/novarto/sanedbc/core/SqlStringUtils.java
// public enum StatementKind
// {
//     SELECT, UPDATE, DELETE, INSERT, UNKNOWN
// }


import fj.function.Effect2;
import static com.novarto.sanedbc.core.SqlStringUtils.StatementKind.*;
import static java.text.MessageFormat.format;

    /**
     * Shorthand for whereExpressionWithPlaceholders(colNames, AND)
     */
    public static StringBuilder whereExpressionWithPlaceholders(Iterable<String> colNames)
    {
        return whereExpressionWithPlaceholders(colNames, LogicalOperator.AND);
    }


    private static StringBuilder expressionWithPlaceholders(Iterable<String> colNames, String separator)
    {
        StringBuilder result = new StringBuilder();

        for (String colName : colNames)
        {
            result.append(colName).append("=?").append(separator);
        }
        return result.delete(result.length() - separator.length(), result.length());
    }


    /**
     * Tries to detect the type of an sql statement as one of the enums in StatementKind.
     * This method does no lexing or parsing, and almost no normalization, trying to strike a balance
     * between efficiency and utility. It is not intended to be used in application code. Its result should
     * only be interpreted as a hint.
     * @param sql
     * @return a value hinting the statement kind
     */
// Path: sane-dbc-core/src/main/java/com/novarto/sanedbc/core/SqlStringUtils.java
// public enum StatementKind
// {
//     SELECT, UPDATE, DELETE, INSERT, UNKNOWN
// }


// Path: sane-dbc-core/src/main/java/com/novarto/sanedbc/core/SqlStringUtils.java
import fj.function.Effect2;
import static com.novarto.sanedbc.core.SqlStringUtils.StatementKind.*;
import static java.text.MessageFormat.format;


    /**
     * Shorthand for whereExpressionWithPlaceholders(colNames, AND)
     */
    public static StringBuilder whereExpressionWithPlaceholders(Iterable<String> colNames)
    {
        return whereExpressionWithPlaceholders(colNames, LogicalOperator.AND);
    }


    private static StringBuilder expressionWithPlaceholders(Iterable<String> colNames, String separator)
    {
        StringBuilder result = new StringBuilder();

        for (String colName : colNames)
        {
            result.append(colName).append("=?").append(separator);
        }
        return result.delete(result.length() - separator.length(), result.length());
    }


    /**
     * Tries to detect the type of an sql statement as one of the enums in StatementKind.
     * This method does no lexing or parsing, and almost no normalization, trying to strike a balance
     * between efficiency and utility. It is not intended to be used in application code. Its result should
     * only be interpreted as a hint.
     * @param sql
     * @return a value hinting the statement kind
     */
    public static StatementKind getStatementKind(String sql)