forked from databricks/databricks-sql-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsession_params.js
More file actions
33 lines (28 loc) · 760 Bytes
/
Copy pathsession_params.js
File metadata and controls
33 lines (28 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const { DBSQLClient } = require('..');
const client = new DBSQLClient();
const host = process.env.DATABRICKS_HOST;
const path = process.env.DATABRICKS_HTTP_PATH;
const token = process.env.DATABRICKS_TOKEN;
client
.connect({ host, path, token })
.then(async (client) => {
const session = await client.openSession({
queryTags: {
team: 'engineering',
test: 'session-params',
driver: 'node',
},
configuration: {
ansi_mode: 'false',
},
});
const op = await session.executeStatement('SELECT 1');
const rows = await op.fetchAll();
console.log(rows);
await op.close();
await session.close();
await client.close();
})
.catch((error) => {
console.log(error);
});