Skip to content

Commit 7b4639c

Browse files
add getAllJobs API and export SQLJob class
Signed-off-by: Sanjula Ganepola <[email protected]>
1 parent d484c80 commit 7b4639c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/connection/manager.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ export class SQLJobManager {
7878
return this.jobs[this.selectedJob];
7979
}
8080

81+
getAllJobs(): JobInfo[] {
82+
return this.jobs;
83+
}
84+
8185
getJob(name: string): JobInfo | undefined {
8286
return this.jobs.find(info => info.name === name);
8387
}
@@ -114,7 +118,7 @@ export class SQLJobManager {
114118
const selected = this.jobs[this.selectedJob]
115119
if (ServerComponent.isInstalled() && selected) {
116120
return selected.job.query<T>(query, opts);
117-
121+
118122
} else if (!ServerComponent.isInstalled()) {
119123
let updateResult = await ServerComponent.checkForUpdate();
120124
if (UpdateStatus.JUST_UPDATED === updateResult) {

src/extension.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ import { initialise } from "./testing";
1414
import { JobManagerView } from "./views/jobManager/jobManagerView";
1515
import { ServerComponent } from "./connection/serverComponent";
1616
import { SQLJobManager } from "./connection/manager";
17+
import { JDBCOptions } from "./connection/types";
18+
import { SQLJob } from "./connection/sqlJob";
1719

1820
export interface Db2i {
19-
sqlJobManager: SQLJobManager
21+
sqlJobManager: SQLJobManager,
22+
sqlJob: (options?: JDBCOptions) => SQLJob
2023
}
2124

2225
// this method is called when your extension is activated
@@ -61,7 +64,7 @@ export function activate(context: vscode.ExtensionContext): Db2i {
6164
initialise(context);
6265
}
6366

64-
return { sqlJobManager: JobManager };
67+
return { sqlJobManager: JobManager, sqlJob: (options?: JDBCOptions) => new SQLJob(options) };
6568
}
6669

6770
// this method is called when your extension is deactivated

0 commit comments

Comments
 (0)