@@ -2,33 +2,48 @@ import AbstractDriver from '@sqltools/base-driver';
22import queries from './queries' ;
33import { IConnectionDriver , MConnectionExplorer , NSDatabase , ContextValue , Arg0 } from '@sqltools/types' ;
44import { v4 as generateId } from 'uuid' ;
5- import IRISdb , { IRISConfiguration } from './irisdb' ;
5+ import IRISdb , { IRISDirect } from './irisdb' ;
66import keywordsCompletion from './keywords' ;
7+ // import { workspace } from "vscode";
78
89type DriverOptions = any ;
910
1011export default class IRISDriver extends AbstractDriver < IRISdb , DriverOptions > implements IConnectionDriver {
1112
1213 queries = queries ;
13-
14+
1415 public async open ( ) {
1516 if ( this . connection ) {
1617 return this . connection ;
1718 }
1819
19- let config : IRISConfiguration ;
20+ const { namespace } = this . credentials ;
21+ let config : IRISDirect ;
2022 if ( this . credentials . serverName ) {
23+ // const serverName = this.credentials.serverName;
24+ // const server = workspace.getConfiguration(`intersystems.servers.${serverName}.webServer`);
25+ // let { scheme, host, port, pathPrefix, username, password } = server;
26+ // config = {
27+ // https: scheme === "https",
28+ // host,
29+ // port,
30+ // pathPrefix,
31+ // namespace,
32+ // username,
33+ // password
34+ // };
35+ } else {
36+ let { https, server : host , port, pathPrefix, username, password } = this . credentials ;
2137 config = {
22- serverName : this . credentials . serverName
38+ https,
39+ host,
40+ port,
41+ pathPrefix,
42+ namespace,
43+ username,
44+ password
2345 } ;
2446 }
25- else {
26- config = {
27- host : this . credentials . server ,
28- port : this . credentials . port ,
29- namespace : this . credentials . namespace
30- }
31- }
3247
3348 const irisdb = new IRISdb ( config ) ;
3449 return irisdb . open ( )
@@ -54,7 +69,7 @@ export default class IRISDriver extends AbstractDriver<IRISdb, DriverOptions> im
5469 resultsAgg . push ( {
5570 cols : Object . keys ( queryResult [ 0 ] ) ,
5671 connId : this . getId ( ) ,
57- messages : [ { date : new Date ( ) , message : `Query ok with ${ queryResult . length } results` } ] ,
72+ messages : [ { date : new Date ( ) , message : `Query ok with ${ queryResult . length } results` } ] ,
5873 results : queryResult ,
5974 query : queries . toString ( ) ,
6075 requestId : opt . requestId ,
0 commit comments