<commit_before>module PostgresqlTools
  class SchemaCreator
    def initialize(schema, connection)
      @schema = schema
      @connection = connection
    end

    def from_sql(file)
      original_path = @connection.schema_search_path
      @connection.create_schema(@schema)
      @connection.schema_search_path = @schema
      @connection.execute(File.read(file))
    ensure
      @connection.schema_search_path = original_path
    end
  end
end<commit_msg>Create schema only if it not exists<commit_after>module PostgresqlTools
  class SchemaCreator
    def initialize(schema, connection)
      @schema = schema
      @connection = connection
    end

    def from_sql(file)
      original_path = @connection.schema_search_path
      @connection.execute("CREATE SCHEMA IF NOT EXISTS #{@schema}")
      @connection.schema_search_path = @schema
      @connection.execute(File.read(file))
    ensure
      @connection.schema_search_path = original_path
    end
  end
end
{'fraction_non_alphanumeric': 0.0750256937307297, 'fraction_numerical': 0.0, 'mean_word_length': 3.467889908256881, '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': '7043856', 'n_tokens_mistral': 274, 'n_tokens_neox': 271, 'n_words': 62}