<commit_before>import { expectTypeOf } from "expect-type";
import { Association, BelongsToManyGetAssociationsMixin, DataTypes, HasOne, Model, Optional, Sequelize } from 'sequelize';
import { ModelDefined } from '../lib/model';

expectTypeOf<HasOne>().toMatchTypeOf<Association>();
class MyModel extends Model {
  public num!: number;
  public static associations: {
    other: HasOne;
  };
  public static async customStuff() {
    return this.sequelize!.query('select 1');
  }
}

class OtherModel extends Model {}

const Instance: MyModel = new MyModel({ int: 10 });

expectTypeOf(Instance.get('num')).toEqualTypeOf<number>();

MyModel.findOne({
  include: [
    {
      through: {
        as: "OtherModel",
        attributes: ['num']
      }
    }
  ]
});

MyModel.findOne({
  include: [
    { model: OtherModel, paranoid: true }
  ]
});

MyModel.hasOne(OtherModel, { as: 'OtherModelAlias' });

MyModel.findOne({ include: ['OtherModelAlias'] });

MyModel.findOne({ include: OtherModel });

MyModel.count({ include: OtherModel });

MyModel.build({ int: 10 }, { include: OtherModel });

MyModel.bulkCreate([{ int: 10 }], { include: OtherModel });

MyModel.update({}, { where: { foo: 'bar' }, paranoid: false});

const sequelize = new Sequelize('mysql://user:user@localhost:3306/mydb');

const model: typeof MyModel = MyModel.init({
  virtual: {<commit_msg>feat(test): add test for nested column in where query (#13478)<commit_after>import { expectTypeOf } from "expect-type";
import { Association, BelongsToManyGetAssociationsMixin, DataTypes, HasOne, Model, Optional, Sequelize } from 'sequelize';
import { ModelDefined } from '../lib/model';

expectTypeOf<HasOne>().toMatchTypeOf<Association>();
class MyModel extends Model {
  public num!: number;
  public static associations: {
    other: HasOne;
  };
  public static async customStuff() {
    return this.sequelize!.query('select 1');
  }
}

class OtherModel extends Model {}

const Instance: MyModel = new MyModel({ int: 10 });

expectTypeOf(Instance.get('num')).toEqualTypeOf<number>();

MyModel.findOne({
  include: [
    {
      through: {
        as: "OtherModel",
        attributes: ['num']
      }
    }
  ]
});

MyModel.findOne({
  include: [
    { model: OtherModel, paranoid: true }
  ]
});

MyModel.hasOne(OtherModel, { as: 'OtherModelAlias' });

MyModel.findOne({ include: ['OtherModelAlias'] });

MyModel.findOne({ include: OtherModel });

MyModel.count({ include: OtherModel });

MyModel.count({ include: [MyModel], where: { '$num$': [10, 120] } });

MyModel.build({ int: 10 }, { include: OtherModel });

MyModel.bulkCreate([{ int: 10 }], { include: OtherModel });

MyModel.update({}, { where: { foo: 'bar' }, paranoid: false});

const sequelize = new Sequelize('mysql://user:user@localhost:3306/mydb');

const model: typeof MyModel = MyModel.init({
  virtual: {
{'fraction_non_alphanumeric': 0.16337332392378265, 'fraction_numerical': 0.011291460832745237, 'mean_word_length': 4.431034482758621, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4291313', 'n_tokens_mistral': 943, 'n_tokens_neox': 907, 'n_words': 218}