|
| 1 | +--- |
| 2 | +title: DB2 for IBM i |
| 3 | +sidebar_position: 1 |
| 4 | +--- |
| 5 | + |
| 6 | +# Sequelize for DB2 for IBM i |
| 7 | + |
| 8 | +:::danger |
| 9 | + |
| 10 | +Our implementation of DB2 for IBM i is not integration tested against an actual database. |
| 11 | +As such, we cannot guarantee that it will work as expected, nor its stability. |
| 12 | + |
| 13 | +We rely on the community to help us improve this dialect. |
| 14 | + |
| 15 | +::: |
| 16 | + |
| 17 | +:::info Version Compatibility |
| 18 | + |
| 19 | +See [Releases](/releases#db2-for-ibm-i-support-table) to see which versions of DB2 for IBM i are supported. |
| 20 | + |
| 21 | +::: |
| 22 | + |
| 23 | +To use Sequelize with DB2 for IBM i, you need to install the `@sequelize/db2-ibmi` dialect package: |
| 24 | + |
| 25 | +```bash npm2yarn |
| 26 | +npm i @sequelize/db2-ibmi |
| 27 | +``` |
| 28 | + |
| 29 | +Then use the `IbmiDialect` class as the dialect option in the Sequelize constructor: |
| 30 | + |
| 31 | +```ts |
| 32 | +import { Sequelize } from '@sequelize/core'; |
| 33 | +import { IbmiDialect } from '@sequelize/db2-ibmi'; |
| 34 | + |
| 35 | +const sequelize = new Sequelize({ |
| 36 | + dialect: IbmiDialect, |
| 37 | + odbcConnectionString: 'DSN=MYDSN;UID=myuser;PWD=mypassword', |
| 38 | + connectionTimeout: 60, |
| 39 | +}); |
| 40 | +``` |
| 41 | + |
| 42 | +## Connection Options |
| 43 | + |
| 44 | +import ConnectionOptions from './_connection-options.md'; |
| 45 | + |
| 46 | +<ConnectionOptions /> |
| 47 | + |
| 48 | +The following options are accepted by the DB2 for IBM i dialect: |
| 49 | + |
| 50 | +| Option | Description | |
| 51 | +|------------------------|---------------------------------------------------------------------------------------------------------------| |
| 52 | +| `connectionTimeout` | The number of seconds to wait for a request on the connection to complete before returning to the application | |
| 53 | +| `loginTimeout` | The number of seconds to wait for a login request to complete before returning to the application | |
| 54 | +| `odbcConnectionString` | The connection string to connect to the database. If provided, the options below are not necessary. | |
| 55 | +| `dataSourceName` | The ODBC "DSN" part of the connection string. | |
| 56 | +| `username` | The ODBC "UID" part of the connection string. | |
| 57 | +| `system` | The ODBC "SYSTEM" part of the connection string. | |
| 58 | +| `password` | The ODBC "PWD" part of the connection string. | |
0 commit comments