# Sequelize.define() method · @imqueue/pg-sequelize

Source: https://imqueue.org/api/pg-sequelize/latest/pg-sequelize.sequelize.define/
Published: 2026-08-01
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-sequelize 4.2.0 — generated reference, not hand-written

Defines a model from an attribute map rather than from a decorated class.

**Signature:**

```typescript
define<TInstance, _TAttributes>(modelName: string, attributes: ModelAttributes, options?: ModelOptions): any;
```

## Parameters


| Parameter | Type | Description |
| --- | --- | --- |
| modelName | string | Name to register the model under. |
| attributes | ModelAttributes | Column definitions, as sequelize's own `define` takes them. |
| options | ModelOptions | _(Optional)_ Model options. `modelName` and `sequelize` are filled in. |


**Returns:**

any

The generated model class.

## Remarks

Sequelize's own `define()` builds on its `Model`; this one builds on `BaseModel`, so a model defined this way gets the view handling, the widened `returning` and the serialization of this package. Decorated classes registered through `addModels()` are the usual route, and the one `database()` takes.

