<commit_before>require 'pg'

class TripDestination
  # connect_url should look like;
  #  mysql://user:pass@localhost/dbname
  def initialize(connect_url)
    @conn = PG.connect(connect_url)
    @conn.prepare('insert_trip_stmt', 'insert into trips (id, departure_date, departure_time, seats, comfort, description, price, title, smoking, name, age, email, phone, confirmation_token, edition_token, deletion_token, state, creation_ip, deletion_ip, created_at, updated_at) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21)')
    @conn.prepare('insert_point_stmt', 'insert into points (id, kind, rank, trip_id, address1, address2, city, zipcode, country_iso_code, created_at, updated_at, lat, lon) values (default, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)')
  end

  def write(row)
    @conn.exec_prepared('insert_trip_stmt', [
        row[:id],
        row[:departure_date],
        row[:departure_time],
        row[:seats],
        row[:comfort],
        row[:description],
        row[:price],
        row[:title],
        row[:smoking],
        row[:name],
        row[:age],
        row[:email],
        row[:phone],
        row[:creation_token],
        row[:edition_token],
        row[:deletion_token],
        row[:state],
        row[:creation_ip],
        row[:deletion_ip],
        row[:create_at],
        row[:updated_at]
    ])
    row[:points].each do |point|
      @conn.exec_prepared('insert_point_stmt', [
          point[:kind],<commit_msg>typo in the token name<commit_after>require 'pg'

class TripDestination
  # connect_url should look like;
  #  mysql://user:pass@localhost/dbname
  def initialize(connect_url)
    @conn = PG.connect(connect_url)
    @conn.prepare('insert_trip_stmt', 'insert into trips (id, departure_date, departure_time, seats, comfort, description, price, title, smoking, name, age, email, phone, confirmation_token, edition_token, deletion_token, state, creation_ip, deletion_ip, created_at, updated_at) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21)')
    @conn.prepare('insert_point_stmt', 'insert into points (id, kind, rank, trip_id, address1, address2, city, zipcode, country_iso_code, created_at, updated_at, lat, lon) values (default, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)')
  end

  def write(row)
    @conn.exec_prepared('insert_trip_stmt', [
        row[:id],
        row[:departure_date],
        row[:departure_time],
        row[:seats],
        row[:comfort],
        row[:description],
        row[:price],
        row[:title],
        row[:smoking],
        row[:name],
        row[:age],
        row[:email],
        row[:phone],
        row[:confirmation_token],
        row[:edition_token],
        row[:deletion_token],
        row[:state],
        row[:creation_ip],
        row[:deletion_ip],
        row[:create_at],
        row[:updated_at]
    ])
    row[:points].each do |point|
      @conn.exec_prepared('insert_point_stmt', [
          point[:kind],
{'fraction_non_alphanumeric': 0.16693944353518822, 'fraction_numerical': 0.03273322422258593, 'mean_word_length': 3.2622036262203626, '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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '786461', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1046, 'n_words': 245}