databricks-sql-nodejs icon indicating copy to clipboard operation
databricks-sql-nodejs copied to clipboard

Create DBSQLOperation from IDBSQLSession

Open lukesonnet opened this issue 11 months ago • 1 comments

Hello!

When using executeStatement from a IDBSQLSession, the type hinting returns an IOperation which is missing several of the helpful methods in DBSQLOperation (e.g. getId()). See: https://github.com/databricks/databricks-sql-nodejs/blob/771fb3b2b34a90a5b8cb8f15c3c379692bc7e955/lib/DBSQLSession.ts#L192.

Is there a way to properly return a DBSQLOperation from an IDBSQLSession so that I can safely use its methods?

lukesonnet avatar Feb 13 '25 16:02 lukesonnet

Hi @lukesonnet! IOperation provides all the methods needed to access query result. Other methods of DBSQLOperation are not intended to be accessed by user. Re. getId: which version of the library you use? There is a property IOperation.id which contains operation ID

kravets-levko avatar Feb 13 '25 22:02 kravets-levko