Azpect3120 9820ecac64 FEAT: Some work on the tree
Found some bugs with the connection creation modal. Need to work on the
parsing and such with regex.
2024-08-09 13:50:07 -07:00

26 lines
814 B
JavaScript

/*
* This file contains the functions that are used to toggle the visibility of the fields
* in the tree view of the tables.
*
* This file also contains the functions that are used to generate quick queries for the
* tables.
*/
function ToggleFields(id) {
const fields = document.getElementById(`fields-${id}`);
const button_svg = document.getElementById(`icon-${id}`);
if (fields.classList.contains("hidden")) {
fields.classList.remove("hidden");
button_svg.setAttribute("transform", "rotate(0)");
} else {
fields.classList.add("hidden");
button_svg.setAttribute("transform", "rotate(-90)");
}
}
function LoadTableQuery(table) {
const sql = document.getElementById("sql")
sql.value = `SELECT * FROM ${table};`;
sql.dispatchEvent(new Event('input', { bubbles: true }));
}