profile
viewpoint

Ask questionsAccess to transaction using Sequelize

Versions

  • sequelize: 5.8.6
  • sequelize-typescript: 0.6.11
  • typescript3.4.5

Hello I'm trying to access the transaction function from Sequelize but I get the following exception:

TSError: ⨯ Unable to compile TypeScript: test/model/Form.spec.ts(10,19): error TS2339: Property 'transaction' does not exist on type 'Sequelize'.

Screenshot 2019-05-28 at 17 58 35

The following shows my set up.


import {Sequelize} from "sequelize-typescript";

const sequelize = new Sequelize({
    name: db,
    username: 'root',
    password: '',
});
sequelize.addModels([ModelA, ModelB);


Is there any additional dependencies I need to install?

Any help would be appreciated.

RobinBuschmann/sequelize-typescript

Answer questions RobinBuschmann

@aminmc thanks for asking. sequelize@5 only works with sequelize-typescript@next. Hope this helps!

useful!
source:https://uonfu.com/
Github User Rank List