Skip to content

Commit

Permalink
Merge pull request #273 from codefori/feature/mapepire
Browse files Browse the repository at this point in the history
Replace internal API with `mapepire-js`
  • Loading branch information
worksofliam authored Sep 4, 2024
2 parents 661328d + f15e211 commit d524f89
Show file tree
Hide file tree
Showing 21 changed files with 231 additions and 815 deletions.
152 changes: 78 additions & 74 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"webpack-cli": "^4.5.0"
},
"dependencies": {
"@ibm/mapepire-js": "^0.3.0",
"chart.js": "^4.4.2",
"csv": "^6.1.3",
"json-to-markdown-table": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ExtensionContext, commands, window } from "vscode";
import { ConnectionStorage } from "./Storage";
import { getInstance } from "./base";
import { SQLJobManager } from "./connection/manager";
import { ServerComponent, UpdateStatus } from "./connection/serverComponent";
import { ServerComponent } from "./connection/serverComponent";
import { JobManagerView } from "./views/jobManager/jobManagerView";
import Configuration from "./configuration";
import { ConfigManager } from "./views/jobManager/ConfigManager";
Expand Down
5 changes: 3 additions & 2 deletions src/connection/SCVersion.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

export const SERVER_VERSION_TAG = `v1.4.9`;
export const SERVER_VERSION_FILE = `codeforiserver-1.4.9.jar`;
export const VERSION = `2.1.4`;
export const SERVER_VERSION_TAG = `v${VERSION}`;
export const SERVER_VERSION_FILE = `mapepire-server-${VERSION}.jar`;
19 changes: 9 additions & 10 deletions src/connection/manager.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

import { getInstance } from "../base";
import { Query } from "./query";
import { ServerComponent, UpdateStatus } from "./serverComponent";
import { JobStatus, SQLJob } from "./sqlJob";
import { QueryOptions } from "./types";
import { OldSQLJob } from "./sqlJob";
import { askAboutNewJob, onConnectOrServerInstall, osDetail } from "../config";
import { SelfValue } from "../views/jobManager/selfCodes/nodes";
import Configuration from "../configuration";
import { QueryOptions } from "@ibm/mapepire-js/dist/src/types";
import { Query } from "@ibm/mapepire-js/dist/src/query";

export interface JobInfo {
name: string;
job: SQLJob;
job: OldSQLJob;
}

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

constructor() { }

async newJob(predefinedJob?: SQLJob, name?: string) {
async newJob(predefinedJob?: OldSQLJob, name?: string) {
if (ServerComponent.isInstalled()) {

const instance = getInstance();
const config = instance.getConfig();

const newJob = predefinedJob || (new SQLJob({
const newJob = predefinedJob || (new OldSQLJob({
libraries: [config.currentLibrary, ...config.libraryList],
naming: `system`,
"full open": false,
"transaction isolation": "none",
"query optimize goal": "1",
"block size": "512",
selfcodes: SQLJobManager.getSelfDefault()
"block size": "512"
}));

try {
Expand Down Expand Up @@ -72,7 +71,7 @@ export class SQLJobManager {
}

getRunningJobs() {
return this.jobs.filter(info => [JobStatus.Ready, JobStatus.Busy].includes(info.job.getStatus()));
return this.jobs.filter(info => ["ready", "busy"].includes(info.job.getStatus()));
}

async endAll() {
Expand Down Expand Up @@ -130,7 +129,7 @@ export class SQLJobManager {
const rowsToFetch = 2147483647;

const statement = await this.getPagingStatement<T>(query, opts);
const results = await statement.run(rowsToFetch);
const results = await statement.execute(rowsToFetch);
statement.close();
return results.data;
}
Expand Down
Loading

0 comments on commit d524f89

Please sign in to comment.