Sequelize for DB2 for IBM i
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.
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
- Yarn
- pnpm
npm i @sequelize/db2-ibmi
yarn add @sequelize/db2-ibmi
pnpm add @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:
Option | Description |
---|---|
connectionTimeout | The number of seconds to wait for a request on the connection to complete before returning to the application |
loginTimeout | The number of seconds to wait for a login request to complete before returning to the application |
odbcConnectionString | The connection string to connect to the database. If provided, the options below are not necessary. |
dataSourceName | The ODBC "DSN" part of the connection string. |
username | The ODBC "UID" part of the connection string. |
system | The ODBC "SYSTEM" part of the connection string. |
password | The ODBC "PWD" part of the connection string. |