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
TS/JS, like other programming languages, introduces a syntax for guaranteed resource release (using). Ex.:
usingpool=awaitoracledb.createPool({...});usingconnection=awaitpool.getConnection();usingresult=awaitconnection.execute('SELECT b FROM no_lobs WHERE id = :id',{id: 2});usinglob=result.rows[0][0];lob.pipe(response);
which is equivalent to:
constpool=awaitoracledb.createPool({...});try{constconnection=awaitpool.getConnection();try{constresult=awaitconnection.execute('SELECT b FROM no_lobs WHERE id = :id',{id: 2});try{constlob=result.rows[0][0];try{lob.pipe(response);}finally{lob.destroy();}}finally{awaitresult.close();}}finally{awaitconnection.close();}}finally{awaitpool.close();}
I think it is worth expanding the library to support this solution.
TS/JS, like other programming languages, introduces a syntax for guaranteed resource release (
using
). Ex.:which is equivalent to:
I think it is worth expanding the library to support this solution.
The implementation involves adding aliased symbolic methods to close / destroy. See:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management
https://tc39.es/proposal-explicit-resource-management/
The text was updated successfully, but these errors were encountered: