This is a temporary class used to progressively migrate the Model class to TypeScript by slowly moving its functions here. Always use Model instead.

Hierarchy (view full)

Constructors

Properties

addHook: LegacyAddAnyHookFunction<ModelHooks<Model<any, any>, any>> = ...
afterAssociate: LegacyAddHookFunction<((data, options) => AsyncHookReturn)> = ...

Type declaration

afterBulkCreate: LegacyAddHookFunction<((instances, options) => AsyncHookReturn)> = ...

Type declaration

afterBulkDestroy: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

afterBulkRestore: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

afterBulkUpdate: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

afterCreate: LegacyAddHookFunction<((attributes, options) => AsyncHookReturn)> = ...

Type declaration

afterDestroy: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

afterFind: LegacyAddHookFunction<((instancesOrInstance, options) => AsyncHookReturn)> = ...

Type declaration

afterRestore: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

afterSave: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

afterSync: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

afterUpdate: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

afterUpsert: LegacyAddHookFunction<((attributes, options) => AsyncHookReturn)> = ...

Type declaration

afterValidate: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

beforeAssociate: LegacyAddHookFunction<((data, options) => AsyncHookReturn)> = ...

Type declaration

beforeBulkCreate: LegacyAddHookFunction<((instances, options) => AsyncHookReturn)> = ...

Type declaration

beforeBulkDestroy: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

beforeBulkRestore: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

beforeBulkUpdate: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

beforeCount: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

beforeCreate: LegacyAddHookFunction<((attributes, options) => AsyncHookReturn)> = ...

Type declaration

beforeDestroy: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

beforeFind: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

beforeFindAfterExpandIncludeAll: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

    • (options): AsyncHookReturn
    • A hook that is run before a find (select) query, after any { include: {all: ...} } options are expanded

      Parameters

      Returns AsyncHookReturn

      Deprecated

      use beforeFind instead

beforeFindAfterOptions: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

beforeRestore: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

beforeSave: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

beforeSync: LegacyAddHookFunction<((options) => AsyncHookReturn)> = ...

Type declaration

beforeUpdate: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

beforeUpsert: LegacyAddHookFunction<((attributes, options) => AsyncHookReturn)> = ...

Type declaration

beforeValidate: LegacyAddHookFunction<((instance, options) => AsyncHookReturn)> = ...

Type declaration

hasHook: (<HookName>(this, hookName) => boolean) = ...

Type declaration

hasHooks: (<HookName>(this, hookName) => boolean) = ...

Type declaration

removeHook: (<HookName>(this, hookName, listenerNameOrListener) => void) = ...

Type declaration

runHooks: LegacyRunHookFunction<ModelHooks<Model<any, any>, any>, void> = ...
validationFailed: LegacyAddHookFunction<((instance, options, error) => AsyncHookReturn)> = ...

Type declaration

Accessors

  • get fieldAttributeMap(): {
        [columnName: string]: string;
    }
  • Private

    A mapping of column name to attribute name

    Returns {
        [columnName: string]: string;
    }

    • [columnName: string]: string
  • get primaryKeyField(): null | string
  • The column name of the primary key.

    Returns null | string

    Deprecated

    don't use this. It doesn't work with composite PKs. It may be removed in the future to reduce duplication. Use the. Use Model.primaryKeys instead.

Methods