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.:
await using pool=awaitoracledb.createPool({...});await using connection=awaitpool.getConnection();const{ rows =[]}=awaitconnection.execute('SELECT b FROM no_lobs WHERE id = :id',{id: 2});await using lob=rows[0][0];lob.pipe(response);
which is equivalent to:
constpool=awaitoracledb.createPool({...});try{constconnection=awaitpool.getConnection();try{const{ rows }=awaitconnection.execute('SELECT b FROM no_lobs WHERE id = :id',{id: 2});constlob=rows[0][0];try{lob.pipe(response);}finally{lob.destroy();}}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: