sequelize-typescript icon indicating copy to clipboard operation
sequelize-typescript copied to clipboard

SQL transactions don't work on SQLite in-memory instance.

Open Ivans1310 opened this issue 2 years ago • 0 comments

Issue

Versions

  • sequelize: "^6.28.0"
  • sequelize-typescript: "^2.1.5"
  • typescript: "^4.7.4"

Issue type

  • [x] bug report
  • [ ] feature request

Actual behavior

I am getting SQLITE_ERROR: no such table: [table-name] when I perform a SQL transaction

This only happens when I run it with SQLite in-memory instance, because it works with the local database.

Expected behavior

Be able to perform sql transactions in SQLite in-memory instance

Related code

This bug happens with I try to perform a transaction like this:

const result = await this.sequelize.transaction(async (t) => {
      const newLink = await this.linkRepository.build<Link>({
        ...link,
        id,
        userId,
      });
      return await newLink.save({transaction: t});
    })

return result

Ivans1310 avatar Feb 07 '23 18:02 Ivans1310