minimal sql console API and UI

This commit is contained in:
Gani Georgiev
2026-05-20 16:22:51 +03:00
parent db853850ab
commit b022e138d4
21 changed files with 984 additions and 21 deletions
+23
View File
@@ -844,6 +844,29 @@ const utils = {
utils.download(url, name);
},
/**
* Downloads a CSV file created from the provide array data.
*
* @param {Array} arr The JS array to serialize as CSV
* @param {string} name The result file name.
*/
downloadCSV(arr, name) {
name = name.endsWith(".csv") ? name : name + ".csv";
// seriaze data
let content = arr.map((row) => {
return row.map((v) => "\"" + ("" + v).replaceAll("\"", "\"\"") + "\"").join(",");
}).join("\n");
const blob = new Blob([content], {
type: "text/csv;charset=utf-8;",
});
const url = window.URL.createObjectURL(blob);
utils.download(url, name);
},
/**
* Returns a normalized API URL address that is used in the API example docs.
*