File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 1
1
< html >
2
2
< head >
3
3
< 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 >
4
17
</ head >
5
18
< body >
6
19
< 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
+
7
38
< script type ="module ">
8
39
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 )
10
42
</ script >
11
43
</ body >
12
44
</ html >
You can’t perform that action at this time.
0 commit comments