Skip to content

Commit d524f89

Browse files
authored
Merge pull request #273 from codefori/feature/mapepire
Replace internal API with `mapepire-js`
2 parents 661328d + f15e211 commit d524f89

21 files changed

+231
-815
lines changed

package-lock.json

Lines changed: 78 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"webpack-cli": "^4.5.0"
6262
},
6363
"dependencies": {
64+
"@ibm/mapepire-js": "^0.3.0",
6465
"chart.js": "^4.4.2",
6566
"csv": "^6.1.3",
6667
"json-to-markdown-table": "^1.0.0",

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ExtensionContext, commands, window } from "vscode";
22
import { ConnectionStorage } from "./Storage";
33
import { getInstance } from "./base";
44
import { SQLJobManager } from "./connection/manager";
5-
import { ServerComponent, UpdateStatus } from "./connection/serverComponent";
5+
import { ServerComponent } from "./connection/serverComponent";
66
import { JobManagerView } from "./views/jobManager/jobManagerView";
77
import Configuration from "./configuration";
88
import { ConfigManager } from "./views/jobManager/ConfigManager";

src/connection/SCVersion.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11

2-
export const SERVER_VERSION_TAG = `v1.4.9`;
3-
export const SERVER_VERSION_FILE = `codeforiserver-1.4.9.jar`;
2+
export const VERSION = `2.1.4`;
3+
export const SERVER_VERSION_TAG = `v${VERSION}`;
4+
export const SERVER_VERSION_FILE = `mapepire-server-${VERSION}.jar`;

src/connection/manager.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11

22
import { getInstance } from "../base";
3-
import { Query } from "./query";
43
import { ServerComponent, UpdateStatus } from "./serverComponent";
5-
import { JobStatus, SQLJob } from "./sqlJob";
6-
import { QueryOptions } from "./types";
4+
import { OldSQLJob } from "./sqlJob";
75
import { askAboutNewJob, onConnectOrServerInstall, osDetail } from "../config";
86
import { SelfValue } from "../views/jobManager/selfCodes/nodes";
97
import Configuration from "../configuration";
8+
import { QueryOptions } from "@ibm/mapepire-js/dist/src/types";
9+
import { Query } from "@ibm/mapepire-js/dist/src/query";
1010

1111
export interface JobInfo {
1212
name: string;
13-
job: SQLJob;
13+
job: OldSQLJob;
1414
}
1515

1616
const NO_SELECTED_JOB = -1;
@@ -23,20 +23,19 @@ export class SQLJobManager {
2323

2424
constructor() { }
2525

26-
async newJob(predefinedJob?: SQLJob, name?: string) {
26+
async newJob(predefinedJob?: OldSQLJob, name?: string) {
2727
if (ServerComponent.isInstalled()) {
2828

2929
const instance = getInstance();
3030
const config = instance.getConfig();
3131

32-
const newJob = predefinedJob || (new SQLJob({
32+
const newJob = predefinedJob || (new OldSQLJob({
3333
libraries: [config.currentLibrary, ...config.libraryList],
3434
naming: `system`,
3535
"full open": false,
3636
"transaction isolation": "none",
3737
"query optimize goal": "1",
38-
"block size": "512",
39-
selfcodes: SQLJobManager.getSelfDefault()
38+
"block size": "512"
4039
}));
4140

4241
try {
@@ -72,7 +71,7 @@ export class SQLJobManager {
7271
}
7372

7473
getRunningJobs() {
75-
return this.jobs.filter(info => [JobStatus.Ready, JobStatus.Busy].includes(info.job.getStatus()));
74+
return this.jobs.filter(info => ["ready", "busy"].includes(info.job.getStatus()));
7675
}
7776

7877
async endAll() {
@@ -130,7 +129,7 @@ export class SQLJobManager {
130129
const rowsToFetch = 2147483647;
131130

132131
const statement = await this.getPagingStatement<T>(query, opts);
133-
const results = await statement.run(rowsToFetch);
132+
const results = await statement.execute(rowsToFetch);
134133
statement.close();
135134
return results.data;
136135
}

0 commit comments

Comments
 (0)