Integrated frog-runner
This commit is contained in:
BIN
frog-runner.jar
Normal file
BIN
frog-runner.jar
Normal file
Binary file not shown.
@@ -3,7 +3,7 @@
|
|||||||
"displayName": "frog",
|
"displayName": "frog",
|
||||||
"description": "The Oracle SQL workbench for VSCode",
|
"description": "The Oracle SQL workbench for VSCode",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"publisher": "Thorsten",
|
"publisher": "todie",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.17.0"
|
"vscode": "^1.17.0"
|
||||||
},
|
},
|
||||||
|
@@ -37,11 +37,25 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
var myOutputChannel = vscode.window.createOutputChannel('SQL Query Results');
|
var myOutputChannel = vscode.window.createOutputChannel('SQL Query Results');
|
||||||
|
|
||||||
if (!dbSession) {
|
if (!dbSession) {
|
||||||
dbSession = spawn("dbc", ['-q', 'scint']);
|
let extPath = vscode.extensions.getExtension("todie.frog").extensionPath;
|
||||||
|
dbSession = spawn("java", ['-jar', extPath + '/frog-runner.jar', '172.19.23.18', '1521', 'aax2sm', 'aax2sm', 'aax2sm']);
|
||||||
|
|
||||||
|
let outputBuffer = "";
|
||||||
|
|
||||||
dbSession.stdout.on('data', (data) => {
|
dbSession.stdout.on('data', (data) => {
|
||||||
myOutputChannel.show();
|
outputBuffer += data.toString();
|
||||||
myOutputChannel.append(data.toString());
|
try {
|
||||||
|
let json = JSON.parse(outputBuffer);
|
||||||
|
|
||||||
|
for (let row of json["rows"]) {
|
||||||
|
myOutputChannel.append("--- ROW ---\n");
|
||||||
|
for (let column of row["columns"]) {
|
||||||
|
myOutputChannel.append(column['name'] + " " + column['value'] + "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
outputBuffer = "";
|
||||||
|
} catch (e) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
dbSession.stderr.on('data', (data) => {
|
dbSession.stderr.on('data', (data) => {
|
||||||
@@ -56,8 +70,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
myOutputChannel.append("Executing: '" + text + "'\n");
|
myOutputChannel.append("Executing: '" + text + "'\n");
|
||||||
dbSession.stdin.write(text + "\n");
|
dbSession.stdin.write(text + "\n--- END ---\n");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
context.subscriptions.push(disposable);
|
context.subscriptions.push(disposable);
|
||||||
|
Reference in New Issue
Block a user