Closed bschwartz10 closed 2 years ago
I just submitted a PR here to fix this issue. There are two things happening here as a result of tree-shaking (due to the serverless
dependency as mentioned above)
1) The deep equal of Symbol('table') === Symbol('table')
is failing in the reflect-metadata
code when calling the function getTableMetadata
2) tableColumns.get(tableClass)
returns an undefined object
By taking both tableyMetadataKey
and tableColumns
and putting them directly on the Class prototype, all instances of the class will be able to use/reference these objects in order to lookup the appropriate table and column names in a query
@bgilman-nyk Thanks for the PR! I used it to create a beta version: 4.6.0-beta.0 I'll try this on a few of my own projects to validate and will release the final 4.6.0 next week.
This works, and is available in v4.6.0.
@bschwartz10 Can this be closed?
@wwwouter Good to close ✅
Issue type:
[ ] Question [x] Bug report [ ] Feature request [ ] Documentation issue
Database system/driver:
[ ] Postgres [x] MSSQL [ ] MySQL [ ] MariaDB [ ] SQLite3 [ ] Oracle [ ] Amazon Redshift
typed-knex version:
[ ]
latest
[ ]@next
[x].4.5.1
(or put your version here)Error Message
Steps To Reproduce The server consistently crashes after hitting a few different endpoints. My team did some digging and found the issue that we are seeing is coming from the package
reflect-metadata
If you execute the statement
Reflect.getMetadataKeys(User)
it returns with the list of metadata tags that are on the class. (So in this instance the result is[Symbol(table)]
)But, if you then run the function
Reflect.getMetadata(Symbol(table), tableClass)
, the response is undefined.But of course, this is not consistent with every successful call as the response should look like:
{ tableName: 'users' }
Package.json