Skip to content

Commit 0a40605

Browse files
committed
web demo
1 parent 01c9f24 commit 0a40605

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

docs/index.html

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,44 @@
11
<html>
22
<head>
33
<title>sqldef</title>
4+
<style>
5+
body {
6+
font-family: sans-serif;
7+
}
8+
.demo {
9+
display: flex;
10+
gap: 10px;
11+
}
12+
textarea {
13+
height: 50vh;
14+
flex: 1;
15+
}
16+
</style>
417
</head>
518
<body>
619
<p>This is meant to be a very simple demo. Please see <a href="https://sqldef.github.io">our site</a> for docs & more complete demo.</p>
20+
21+
<div class="demo">
22+
<textarea readonly>
23+
CREATE TABLE user (
24+
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
25+
name VARCHAR(128) DEFAULT 'konsumer'
26+
) Engine=InnoDB DEFAULT CHARSET=utf8mb4;
27+
</textarea>
28+
<textarea readonly>
29+
CREATE TABLE user (
30+
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
31+
name VARCHAR(128) DEFAULT 'konsumer',
32+
created_at DATETIME NOT NULL
33+
) Engine=InnoDB DEFAULT CHARSET=utf8mb4;
34+
</textarea>
35+
<textarea readonly></textarea>
36+
</div>
37+
738
<script type="module">
839
import sqldef from '/sqldef/index.js'
9-
// put demo code here
40+
const [tin, tchange, tout] = document.querySelectorAll('textarea')
41+
tout.value = await sqldef('mysql', tin.value, tchange.value)
1042
</script>
1143
</body>
1244
</html>

0 commit comments

Comments
 (0)