@cloud-cli/d0 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/console.html +15 -3
- package/package.json +1 -1
package/console.html
CHANGED
|
@@ -65,6 +65,15 @@
|
|
|
65
65
|
>
|
|
66
66
|
Run
|
|
67
67
|
</button>
|
|
68
|
+
|
|
69
|
+
<button
|
|
70
|
+
type="button"
|
|
71
|
+
on-click="onUpdateGraph()"
|
|
72
|
+
bind-disabled="!name"
|
|
73
|
+
class="bg-gray-400 text-black px-4 py-2 rounded focus:bg-white hover:bg-white"
|
|
74
|
+
>
|
|
75
|
+
Graph
|
|
76
|
+
</button>
|
|
68
77
|
</div>
|
|
69
78
|
</form>
|
|
70
79
|
</div>
|
|
@@ -116,12 +125,15 @@
|
|
|
116
125
|
}
|
|
117
126
|
}
|
|
118
127
|
|
|
119
|
-
|
|
128
|
+
async function onUpdateGraph() {
|
|
129
|
+
if (!name.value) return;
|
|
120
130
|
const schema = await runQuery('select * from sqlite_schema;');
|
|
121
131
|
setDiagram(schemaToMermaid(schema));
|
|
122
|
-
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
onInit(onUpdateGraph);
|
|
123
135
|
|
|
124
|
-
return { name, diagram, query, responses, setName, setQuery, error, onRun, onKeyUp };
|
|
136
|
+
return { name, diagram, query, responses, setName, setQuery, error, onRun, onKeyUp, onUpdateGraph };
|
|
125
137
|
}
|
|
126
138
|
|
|
127
139
|
function schemaToMermaid(schema) {
|