0.0.26 • Published 11 months ago

@rcronin/sequelize-ibmi-mapepire v0.0.26

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@rcronin/sequelize-ibmi-mapepire

IBM i (via Mapepire) Sequelize V7 Dialect

GitHub Actions Workflow Status GitHub Issues or Pull Requests NPM Version NPM Downloads

Getting Started

IBM i Prerequisites

Mapepire Server

Documentation

yum install mapepire-server

Package Installation

npm i @rcronin/sequelize-ibmi-mapepire

Upon installation, the package will automatically install @ibm/mapepire-js

Usage

import { DataTypes, InferAttributes, InferCreationAttributes, Model, Sequelize } from '@sequelize/core';
import { Attribute, PrimaryKey, Table } from '@sequelize/core/decorators-legacy';
import { IBMiDialect } from '@rcronin/sequelize-ibmi-mapepire';
import 'dotenv/config'

@Table({
  freezeTableName: true,
  timestamps: false,
  tableName: 'DEPARTMENT', // whatever the actual IBM i table is called
  schema: 'SAMPLE' // whatever the actual IBM i schema is called
})
export class DepartmentModel extends Model<InferAttributes<DepartmentModel>, InferCreationAttributes<DepartmentModel>> {
  @Attribute({
    type: DataTypes.STRING,
    columnName: 'DEPTNO'
  })
  @PrimaryKey()
  declare number: string;

  @Attribute({
    type: DataTypes.STRING,
    columnName: 'DEPTNAME'
  })
  declare name: string;

  @Attribute({
    type: DataTypes.STRING,
    columnName: 'MGRNO'
  })
  declare managerNumber: string;

  @Attribute({
    type: DataTypes.STRING,
    columnName: 'ADMRDEPT'
  })
  declare parent: string;

  @Attribute({
    type: DataTypes.STRING,
    columnName: 'LOCATION'
  })
  declare location: string;
}

const sequelize = new Sequelize({
    dialect: IBMiDialect,
    host: process.env.HOST as string,
    user: process.env.USERNAME as string,
    password: process.env.PASSWORD as string,
    rejectUnauthorized: false, // false but need to validate certificate
    models: [DepartmentModel]
  });
0.0.26

11 months ago

0.0.25

11 months ago

0.0.24

11 months ago

0.0.23

11 months ago

0.0.22

11 months ago

0.0.21

11 months ago

0.0.20

11 months ago

0.0.19

11 months ago

0.0.18

11 months ago

0.0.17

11 months ago

0.0.16

11 months ago

0.0.15

11 months ago

0.0.14

11 months ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago