class JDBCCommitQueries extends JDBCQueriesHelper implements CommitQueries {

    @Override
    public String commitInsertionStatement(int projectId, Commit commit, GitDiff diff) {
        logger.trace("[" + projectId + "] Inserting commit: " + commit.sha
                + " - ordinal: " + commit.ordinal + " - diff: " + diff + " - time: " + commit.date);

        // Escaping double dollars to avoid exiting dollar quoted string too soon.
        String commitMessage = escapeStringEntry(commit.message);

        String mergedCommit = commit.getParentCount() >= 2 ?
                "(" + idFromShaQuery(projectId, commit.getParent(1).sha) + ")" : null;

        String developerQuery = developerQueries.idFromEmailQuery(commit.authorEmail);
        return "INSERT INTO commit_entry (project_id, developer_id, sha1, ordinal, date, " +
                "additions, deletions, files_changed, message, merged_commit_id, in_detector) VALUES ('" +
                projectId + "', (" + developerQuery + "), '" + commit.sha + "', " + commit.ordinal + ", '" + commit.date.toString() +
                "', " + diff.getAddition() + ", " + diff.getDeletion() + ", " + diff.getChangedFiles() +
                ", $$ " + commitMessage + " $$, " + mergedCommit + ", " + commit.isInPaprika() + ") ON CONFLICT DO NOTHING;";
    }

    public  JDBCCommitQueries(DeveloperQueries developerQueries);

}