Integrated frog-runner
This commit is contained in:
		@@ -37,11 +37,25 @@ export function activate(context: vscode.ExtensionContext) {
 | 
			
		||||
        var myOutputChannel = vscode.window.createOutputChannel('SQL Query Results');
 | 
			
		||||
 | 
			
		||||
        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) => {
 | 
			
		||||
                myOutputChannel.show();
 | 
			
		||||
                myOutputChannel.append(data.toString());
 | 
			
		||||
                outputBuffer += 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) => {
 | 
			
		||||
@@ -56,8 +70,7 @@ export function activate(context: vscode.ExtensionContext) {
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        myOutputChannel.append("Executing: '" + text + "'\n");
 | 
			
		||||
        dbSession.stdin.write(text + "\n");
 | 
			
		||||
        
 | 
			
		||||
        dbSession.stdin.write(text + "\n--- END ---\n");
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    context.subscriptions.push(disposable);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user