You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Knex version: 3.1.0
Database + version: Postgres 13
OS: Linux
Feature discussion / request
Explain what is your use case
I want to use async functions as afterCreate. Used to be possible, but had to call done, now there is a deprecation warning each time a connection is created ((node:44774) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake)
Explain what kind of feature would support this
Allow the callback to be an async function
Give some API proposal, how the feature should work
Check if the afterCreate function takes 1 argument or 2, if 1 then skip promisify, if 2 then promisify. Something like
Environment
Knex version: 3.1.0
Database + version: Postgres 13
OS: Linux
Feature discussion / request
Explain what is your use case
I want to use async functions as afterCreate. Used to be possible, but had to call done, now there is a deprecation warning each time a connection is created (
(node:44774) [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake
)Explain what kind of feature would support this
Allow the callback to be an async function
Give some API proposal, how the feature should work
Check if the afterCreate function takes 1 argument or 2, if 1 then skip promisify, if 2 then promisify. Something like
Also maybe should do a typing change for afterCreate, currently it's only Function, we could have it as
I'll create a pull request
The text was updated successfully, but these errors were encountered: