Typeorm singleton with serverless-offline
See original GitHub issueIssue type:
[ x] question [ ] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ x] mysql
/ mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x ] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
Crossposting https://github.com/dherault/serverless-offline/issues/468 hoping someone might have some insight. Using TypeOrm with the Serverless.com framework and serverless-offline to develop my lambda functions locally. On the actual deploy code, the singleton works fine but serverless-offline causes issues with this.
Since I’m using Typeorm, serverless, serverless-typescript and serverless-offline this is just trying to make all these packages work together, hoping someone has run into this before and knows the secret.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:23 (4 by maintainers)
So I am having similiar problems. I am using this db manager class to handle connections:
Every first DB call after
serverless offline start
succeeds but when I do another call I get:I think I am pretty close to solving this without any dirty hacks but how could I proceed from here?
Just for future generations:
skipCacheInvalidation
doesn’t exist anymore in new sls offline. Instead use--allowCache
.