<commit_before>'use strict';

var Utils = require(__dirname + '/utils')
  , DataTypes = require(__dirname + '/data-types')
  , SQLiteQueryInterface = require(__dirname + '/dialects/sqlite/query-interface')
  , Transaction = require(__dirname + '/transaction')
  , Promise = require(__dirname + '/promise')
  , QueryTypes = require('./query-types');

module.exports = (function() {
  /*
   * The interface that Sequelize uses to talk to all databases
   * @class QueryInterface
  **/
  var QueryInterface = function(sequelize) {
    this.sequelize = sequelize;
    this.QueryGenerator = require('./dialects/' + this.sequelize.options.dialect + '/query-generator');
    this.QueryGenerator.options = this.sequelize.options;
    this.QueryGenerator._dialect = this.sequelize.dialect;
    this.QueryGenerator.sequelize = this.sequelize;
  };

  QueryInterface.prototype.createSchema = function(schema) {
    var sql = this.QueryGenerator.createSchema(schema);
    return this.sequelize.query(sql, null, {logging: this.sequelize.options.logging});
  };

  QueryInterface.prototype.dropSchema = function(schema) {
    var sql = this.QueryGenerator.dropSchema(schema);
    return this.sequelize.query(sql, null, {logging: this.sequelize.options.logging});
  };

  QueryInterface.prototype.dropAllSchemas = function() {
    var self = this;

    if (!this.QueryGenerator._dialect.supports.schemas) {
      return this.sequelize.drop();
    } else {
      return this.showAllSchemas().map(function(schemaName, index, length) {
        return self.dropSchema(schemaName);
      });
    }<commit_msg>remove hard require to query generator (should go through dialect instead)<commit_after>'use strict';

var Utils = require(__dirname + '/utils')
  , DataTypes = require(__dirname + '/data-types')
  , SQLiteQueryInterface = require(__dirname + '/dialects/sqlite/query-interface')
  , Transaction = require(__dirname + '/transaction')
  , Promise = require(__dirname + '/promise')
  , QueryTypes = require('./query-types');

module.exports = (function() {
  /*
   * The interface that Sequelize uses to talk to all databases
   * @class QueryInterface
  **/
  var QueryInterface = function(sequelize) {
    this.sequelize = sequelize;
    this.QueryGenerator = this.sequelize.dialect.QueryGenerator;
  };

  QueryInterface.prototype.createSchema = function(schema) {
    var sql = this.QueryGenerator.createSchema(schema);
    return this.sequelize.query(sql, null, {logging: this.sequelize.options.logging});
  };

  QueryInterface.prototype.dropSchema = function(schema) {
    var sql = this.QueryGenerator.dropSchema(schema);
    return this.sequelize.query(sql, null, {logging: this.sequelize.options.logging});
  };

  QueryInterface.prototype.dropAllSchemas = function() {
    var self = this;

    if (!this.QueryGenerator._dialect.supports.schemas) {
      return this.sequelize.drop();
    } else {
      return this.showAllSchemas().map(function(schemaName, index, length) {
        return self.dropSchema(schemaName);
      });
    }
{'fraction_non_alphanumeric': 0.13130979874628834, 'fraction_numerical': 0.0, 'mean_word_length': 4.0365448504983386, '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': '5249382', 'n_tokens_mistral': 904, 'n_tokens_neox': 878, 'n_words': 172}