console.log("table selection script loaded!");
if (typeof Deno === "undefined") {
const tables = document.querySelectorAll(".tables-list-item");
const editor = document.getElementById("editordiv");
tables.forEach(table => {
table.addEventListener("click", async () => {
const tableName = table.id;
let statement;
if (localStorage.getItem(`saved-${tableName}`) !== null) {
statement = localStorage.getItem(`saved-${tableName}`);
} else {
statement = `SELECT * FROM ${tableName}`;
}
editor.code = statement;
});
});
}
export const tableSelectScript = undefined;