Skip to content

Jonathan-Joransen/Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Demo

I had an issue with connections not getting terminated correctly. This code is not only fun becuase I like being able to use interesting patterns, but it was extremely practical to use the pattern in this situation.

useConnection = async ( callback: (conn: PoolConnection) => Promise<any> ): Promise<any> => { let currConn = await this.conn.getConnection(); let result: any; try { result = await callback(currConn); } finally { currConn.release(); } return result; };

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published