Back to Sequelize

DB2 for IBM i

docs/databases/ibmi.mdx

latest2.3 KB
Original Source

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.

:::

:::info 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:

bash
npm i @sequelize/db2-ibmi

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

ts
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

import ConnectionOptions from './_connection-options.md';

<ConnectionOptions />

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.