sequelize / sequelize-typescript

Decorators and some other features for sequelize
MIT License
2.78k stars 280 forks source link

Access to transaction using Sequelize #626

Closed aminmc closed 5 years ago

aminmc commented 5 years ago

Versions

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 commented 5 years ago

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

aminmc commented 5 years ago

Thank you for your quick reply! Will use the appropriate versions. Thanks