Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main 1.10.2 to dev #530

Merged
merged 4 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

All notable changes to the **kdb VS Code extension** are documented in this file.

# v1.10.0

### Enhancements

- Introducing UDAs(Custom APIs) to Datasource
- Run UDAs with Requirement params or with no required params
- VsCode is Query Environment variable aware from Insights 1.13
# v1.10.2

### Fixes

- Resolved issue with export csv method

# v1.10.1

### Fixes
Expand Down
15 changes: 12 additions & 3 deletions src/utils/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import path from "path";
import { Uri, window, workspace } from "vscode";
import { ext } from "../extensionVariables";
import { QueryResultType } from "../models/queryResult";
import { kdbOutputLog } from "./core";

interface tblHeader {
label: string;
Expand Down Expand Up @@ -124,9 +125,17 @@ export function convertResultToVector(result: any): any[] {
export async function exportToCsv(workspaceUri: Uri): Promise<void> {
const timestamp = Date.now();
const fileName = `results-${timestamp}.csv`;
const filePath = Uri.parse(path.join(workspaceUri.fsPath, fileName));
await workspace.fs.writeFile(filePath, Buffer.from(ext.resultPanelCSV));
window.showTextDocument(filePath, { preview: false });
const filePath = Uri.file(path.join(workspaceUri.fsPath, fileName));

try {
await workspace.fs.writeFile(filePath, Buffer.from(ext.resultPanelCSV));
kdbOutputLog("file located at: " + filePath.fsPath, "INFO");
window.showTextDocument(filePath, { preview: false });
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
kdbOutputLog(`Error writing file: ${errorMessage}`, "ERROR");
window.showErrorMessage(`Failed to write file: ${errorMessage}`);
}
}

export function convertArrayOfArraysToObjects(arr: any): any[] {
Expand Down