Current basic usage example:
constdriver=require('databricks-sql-node');const{ TCLIService, TCLIService_types }=driver.thrift;constclient=newdriver.DBSQLClient(TCLIService,TCLIService_types);client.connect({host: '********.databricks.com',path: '/sql/1.0/endpoints/****************',token: 'dapi********************************',}).then(asyncclient=>{constsession=awaitclient.openSession();constresponse=awaitsession.getInfo(TCLIService_types.TGetInfoType.CLI_DBMS_VER);console.log(response.getValue());awaitsession.close();}).catch(error=>{console.log(error);});Let's simplify it to be:
constdriver=require('databricks-sql-node');constclient=newdriver.DBSQLClient();awaitclient.connect({host: '********.databricks.com',path: '/sql/1.0/endpoints/****************',token: 'dapi********************************',});constsession=awaitclient.openSession();constresponse=awaitsession.executeStatement("SELECT 1");// TODO: probably need to change the followingconsole.log(response.getValue());awaitsession.close();
Current basic usage example:
Let's simplify it to be: