Skip to main content
Version: v7 - alpha

Sequelize for DB2 for IBM i

danger

Our implementation of DB2 for IBM i is not integration tested against an actual database. As such, we cannot guarantee that it will work as expected, nor its stability.

We rely on the community to help us improve this dialect.

Version Compatibility

See Releases to see which versions of DB2 for IBM i are supported.

To use Sequelize with DB2 for IBM i, you need to install the @sequelize/db2-ibmi dialect package:

npm i @sequelize/db2-ibmi

Then use the IbmiDialect class as the dialect option in the Sequelize constructor:

import { Sequelize } from '@sequelize/core';
import { IbmiDialect } from '@sequelize/db2-ibmi';

const sequelize = new Sequelize({
dialect: IbmiDialect,
odbcConnectionString: 'DSN=MYDSN;UID=myuser;PWD=mypassword',
connectionTimeout: 60,
});

Connection Options

Connection Options are used to configure a connection to the database.

The simplest way to use them is at the root of the configuration object. These options can also be used in the replication option to customize the connection for each replica, and can be modified by the beforeConnect hook on a connection-by-connection basis.

The following options are accepted by the DB2 for IBM i dialect:

OptionDescription
connectionTimeoutThe number of seconds to wait for a request on the connection to complete before returning to the application
loginTimeoutThe number of seconds to wait for a login request to complete before returning to the application
odbcConnectionStringThe connection string to connect to the database. If provided, the options below are not necessary.
dataSourceNameThe ODBC "DSN" part of the connection string.
usernameThe ODBC "UID" part of the connection string.
systemThe ODBC "SYSTEM" part of the connection string.
passwordThe ODBC "PWD" part of the connection string.