More features.
This commit is contained in:
BIN
frog-runner.jar
BIN
frog-runner.jar
Binary file not shown.
@@ -34,6 +34,8 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
|
|
||||||
let text = editor.document.getText(selection);
|
let text = editor.document.getText(selection);
|
||||||
|
|
||||||
|
console.log(text);
|
||||||
|
|
||||||
var myOutputChannel = vscode.window.createOutputChannel('SQL Query Results');
|
var myOutputChannel = vscode.window.createOutputChannel('SQL Query Results');
|
||||||
|
|
||||||
if (!dbSession) {
|
if (!dbSession) {
|
||||||
@@ -44,16 +46,24 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
|
|
||||||
dbSession.stdout.on('data', (data) => {
|
dbSession.stdout.on('data', (data) => {
|
||||||
outputBuffer += data.toString();
|
outputBuffer += data.toString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let json = JSON.parse(outputBuffer);
|
let json = JSON.parse(outputBuffer);
|
||||||
|
|
||||||
for (let row of json["rows"]) {
|
let cd = json['columnDefinitions']
|
||||||
myOutputChannel.append("--- ROW ---\n");
|
|
||||||
for (let column of row["columns"]) {
|
if (!json['rows']) {
|
||||||
myOutputChannel.append(column['name'] + " " + column['value'] + "\n");
|
myOutputChannel.append(JSON.stringify(json, null ,2));
|
||||||
|
} else {
|
||||||
|
for (let row of json["rows"]) {
|
||||||
|
myOutputChannel.append("--- ROW ---\n");
|
||||||
|
for (let [index, value] of row["columns"].entries()) {
|
||||||
|
myOutputChannel.append(cd[index]['name'] + " " + value['value'] + "\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myOutputChannel.append("-- DATUM HIER -------------------------------\n");
|
||||||
outputBuffer = "";
|
outputBuffer = "";
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
});
|
});
|
||||||
@@ -69,7 +79,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
myOutputChannel.append("Executing: '" + text + "'\n");
|
myOutputChannel.append("-- DATUM HIER -------------------------------\nExecuting: '" + text + "'\n");
|
||||||
dbSession.stdin.write(text + "\n--- END ---\n");
|
dbSession.stdin.write(text + "\n--- END ---\n");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user