Show comments and privileges

This commit is contained in:
Daniel Bulant 2020-04-14 10:54:28 +02:00
parent 3135102d3c
commit 962ebf5b98
2 changed files with 10 additions and 1 deletions

View file

@ -52,7 +52,7 @@ app.get("/tables", (req, res) => {
var obj = {};
for(var r of result) {
try {
obj[r] = await query(pool, "DESCRIBE " + r);
obj[r] = await query(pool, "SHOW FULL COLUMNS FROM " + r);
} catch(e){
console.error(e);
}

View file

@ -21,6 +21,11 @@
}
(async () => {
if(window.location.hostname !== "localhost") {
console.log("Fetching info supported only from localhost!");
return;
}
var res = await fetch("/tables");
var tables = await res.json();
app.innerText = "";
@ -41,6 +46,8 @@
<th>Key?</th>
<th>Default</th>
<th>Extra?</th>
<th>Privileges</th>
<th>Comment</th>
</tr>
`);
@ -54,6 +61,8 @@
<td>${field.Key}</td>
<td>${field.Default}</td>
<td>${field.Extra}</td>
<td>${field.Privileges}</td>
<td>${field.Comment}</td>
</tr>
`))
}