<commit_before>var Postgres = function() {
  this.output = [];
  this.params = [];
}

Postgres.prototype.getQuery = function(node) {
  this.visit(node);
  //automatic 'from'
  if(!this._visitedFrom) {
  }
  return { text: this.output.join(' '), params: this.params };
}

Postgres.prototype.visit = function(node) {
  switch(node.type) {
    case 'QUERY': return this.visitQuery(node);
    case 'SELECT': return this.visitSelect(node);
    case 'FROM': return this.visitFrom(node);
    case 'WHERE': return this.visitWhere(node);
    case 'BINARY': return this.visitBinary(node);
    case 'TABLE': return this.visitTable(node);
    case 'COLUMN': return this.visitColumn(node);
    case 'JOIN': return this.visitJoin(node);
    case 'TEXT': return node.text;
    case 'UNARY': return this.visitUnary(node);
    case 'PARAMETER': return this.visitParameter(node);
    default: throw new Error("Unrecognized node type " + node.type);
  }
}

Postgres.prototype.quote = function(word) {
  return '"' + word + '"';
}

Postgres.prototype.visitSelect = function(select) {
  var result = ['SELECT', select.nodes.map(this.visit.bind(this)).join(', ')];
  this._selectEndIndex = this.output.length + result.length;
  return result;
}
<commit_msg>remove dead method<commit_after>var Postgres = function() {
  this.output = [];
  this.params = [];
}

Postgres.prototype.getQuery = function(queryNode) {
  this.visit(queryNode);
  //automatic 'from'
  if(!this._visitedFrom) {
    var from = new From().add(queryNode.table.toNode());
    var fromText = this.visitFrom(from);
  }
  return { text: this.output.join(' '), params: this.params };
}

Postgres.prototype.visit = function(node) {
  switch(node.type) {
    case 'QUERY': return this.visitQuery(node);
    case 'SELECT': return this.visitSelect(node);
    case 'FROM': return this.visitFrom(node);
    case 'WHERE': return this.visitWhere(node);
    case 'BINARY': return this.visitBinary(node);
    case 'TABLE': return this.visitTable(node);
    case 'COLUMN': return this.visitColumn(node);
    case 'JOIN': return this.visitJoin(node);
    case 'TEXT': return node.text;
    case 'UNARY': return this.visitUnary(node);
    case 'PARAMETER': return this.visitParameter(node);
    default: throw new Error("Unrecognized node type " + node.type);
  }
}

Postgres.prototype.quote = function(word) {
  return '"' + word + '"';
}

Postgres.prototype.visitSelect = function(select) {
  var result = ['SELECT', select.nodes.map(this.visit.bind(this)).join(', ')];
  this._selectEndIndex = this.output.length + result.length;
  return result;
}

{'fraction_non_alphanumeric': 0.1602787456445993, 'fraction_numerical': 0.0, 'mean_word_length': 4.168, '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': '3675252', 'n_tokens_mistral': 830, 'n_tokens_neox': 829, 'n_words': 179}