Reference Source

References

summary
public

C Model

A Model represents a table in the database.

public

The interface that Sequelize uses to talk to all databases

public

This is the main class, the entry point to sequelize.

public

The transaction object is used to identify a running transaction.

public

F ARRAY(type: <DataTypes>): *

An array of type.

public

F BIGINT(length: string | number): *

A 64 bit integer

public

F BLOB(length: string): *

Binary storage

public

F BOOLEAN(): *

A boolean / tinyint column, depending on dialect

public

F CHAR(length: number, binary: boolean): *

CHAR A fixed length string

public

F CIDR(): *

The cidr type holds an IPv4 or IPv6 network specification.

public

F CITEXT(): *

An unlimited length case-insensitive text column.

public

F DATE(length: string | number): *

Date column with timezone, default is UTC

public

F DATEONLY(): *

A date only column (no timestamp)

public

F DECIMAL(precision: string | number, scale: string | number): *

Decimal type, variable precision, take length as specified by user

public

F DOUBLE(length: string | number, decimals: string | number): *

Floating point number (8-byte precision).

public

F ENUM(value: Array | Object): *

An enumeration, Postgres Only

public

F FLOAT(length: string | number, decimals: string | number): *

Floating point number (4-byte precision).

public

F GEOGRAPHY(type: string, srid: string): *

A geography datatype represents two dimensional spacial objects in an elliptic coord system.

public

F GEOMETRY(type: string, srid: string): *

A column storing Geometry information.

public

F HSTORE(): *

A key / value store column.

public

F INET(): *

The INET type holds an IPv4 or IPv6 host address, and optionally its subnet.

public

F INTEGER(length: string | number): *

A 32 bit integer

public

F JSONB(): *

A binary storage JSON column.

public

F JSONTYPE(): *

A JSON string column.

public

F MACADDR(): *

The MACADDR type stores MAC addresses.

public

F MEDIUMINT(length: string | number): *

A 24 bit integer

public

F NOW(): *

A default value of the current timestamp

public

F NUMBER(options: Object)

Base number type which is used to build other types

public

F RANGE(subtype: <DataTypes>): *

Range types are data types representing a range of values of some element type (called the range's subtype). Only available in Postgres. See the Postgres documentation for more details

public

F REAL(length: string | number, decimals: string | number): *

Floating point number (4-byte precision).

public

F SMALLINT(length: string | number): *

A 16 bit integer

public

F STRING(length: number, binary: boolean): *

STRING A variable length string

public

F TEXT(length: string): *

Unlimited length TEXT column

public

F TIME(): *

A time column

public

F TINYINT(length: string | number): *

A 8 bit integer

public

F UUID(): *

A column storing a unique universal identifier.

public

F UUIDV1(): *

A default unique universal identifier generated following the UUID v1 standard

public

F UUIDV4(): *

A default unique universal identifier generated following the UUID v4 standard

public

F VIRTUAL(ReturnType: <DataTypes>, fields: Array): *

A virtual value that is not stored in the DB.

public

V DataTypes: *

A convenience class holding commonly used data types.

public

V Deferrable: *

A collection of properties related to deferrable constraints.

public

V Op: {"eq": *, "ne": *, "gte": *, "gt": *, "lte": *, "lt": *, "not": *, "is": *, "in": *, "notIn": *, "like": *, "notLike": *, "iLike": *, "notILike": *, "startsWith": *, "endsWith": *, "substring": *, "regexp": *, "notRegexp": *, "iRegexp": *, "notIRegexp": *, "between": *, "notBetween": *, "overlap": *, "contains": *, "contained": *, "adjacent": *, "strictLeft": *, "strictRight": *, "noExtendRight": *, "noExtendLeft": *, "and": *, "or": *, "any": *, "all": *, "values": *, "col": *, "placeholder": *, "join": *}

Operator symbols to be used when querying data

public

V QueryTypes: *

An enum of query types used by sequelize.query

public

V TableHints: *

An enum of table hints to be used in mssql for querying with table hints

associations

summary
public

Creating associations in sequelize is done by calling one of the belongsTo / hasOne / hasMany / belongsToMany functions on a model (the source), and providing another model as the first argument to the function (the target).

public

Many-to-many association with a join table.

public

One-to-one association

public

One-to-many association

public

C HasOne

One-to-one association

errors

summary
public

Thrown when an association is improperly constructed (see message for details)

public

Sequelize provides a host of custom error classes, to allow you to do easier debugging.

public

C BulkRecordError(error: Error, record: Object)

Thrown when bulk operation fails, it represent per record level error.

public

A base class for all connection related errors.

public

A base class for all database related errors.

public

Thrown when an include statement is improperly constructed (see message for details)

public

Thrown when a record was not found, Usually used with rejectOnEmpty mode (see message for details)

public

Thrown when a some problem occurred with Instance methods (see message for details)

public

Thrown when attempting to update a stale model instance

public

Thrown when a query is passed invalid options (see message for details)

public

Scope Error.

public

C ValidationError(message: string, errors: Array)

Validation Error.

public

Validation Error Item Instances of this class are included in the ValidationError.errors property.

errors/connection

summary
public

Thrown when a connection to a database is refused due to insufficient privileges

public

Thrown when connection is not acquired due to timeout

public

Thrown when a connection to a database is refused

public

Thrown when a connection to a database times out

public

Thrown when a connection to a database has a hostname that was not found

public

Thrown when a connection to a database has a hostname that was not reachable

public

Thrown when a connection to a database has invalid values for any of the connection parameters

errors/database

summary
public

Thrown when an exclusion constraint is violated in the database

public

Thrown when a foreign key constraint is violated in the database

public

Thrown when a database query times out because of a deadlock

public

Thrown when constraint name is not found in the database

errors/validation

summary
public

Thrown when a unique constraint is violated in the database