Skip to content

Commit 18b1cb3

Browse files
committed
format
1 parent fc8a933 commit 18b1cb3

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

index.html

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<meta property="og:title" content="sqldef">
1111
<meta property="og:description" content="Idempotent schema management for MySQL, PostgreSQL, SQLite, and SQL Server">
1212
<meta property="og:image" content="https://sqldef.github.io/sqldef512.png">
13-
13+
1414
<link rel="icon" type="image/png" sizes="128x128" href="sqldef128.png">
1515
<link rel="icon" type="image/png" sizes="256x256" href="sqldef256.png">
1616
<link rel="icon" type="image/png" sizes="512x512" href="sqldef512.png">
@@ -156,13 +156,13 @@ <h4 class="schema-header">Desired schema</h4>
156156
</div>
157157

158158
<script>
159-
const dbType = document.getElementById('dbType')
160-
const inputA = document.getElementById('inputA')
161-
const inputB = document.getElementById('inputB')
162-
const outputUp = document.getElementById('outputUp')
163-
const errorUp = document.getElementById('errorUp')
164-
const outputDown = document.getElementById('outputDown')
165-
const errorDown = document.getElementById('errorDown')
159+
const dbType = document.getElementById('dbType');
160+
const inputA = document.getElementById('inputA');
161+
const inputB = document.getElementById('inputB');
162+
const outputUp = document.getElementById('outputUp');
163+
const errorUp = document.getElementById('errorUp');
164+
const outputDown = document.getElementById('outputDown');
165+
const errorDown = document.getElementById('errorDown');
166166

167167
const schemaExamples = {
168168
mysql: {
@@ -208,49 +208,49 @@ <h4 class="schema-header">Desired schema</h4>
208208
name NVARCHAR(128) DEFAULT 'konsumer',
209209
created_at DATETIME NOT NULL
210210
);`
211-
}
212-
}
211+
},
212+
};
213213

214214
async function runDiff() {
215-
// Run up diff (current -> desired)
216-
outputUp.style.display = 'none'
217-
errorUp.style.display = 'none'
218-
try {
219-
const result = await window.sqldef(dbType.value, inputB.value, inputA.value)
220-
outputUp.innerHTML = result
221-
outputUp.style.display = 'block'
222-
} catch (e) {
223-
errorUp.style.display = 'block'
224-
errorUp.innerHTML = e.message
225-
}
215+
// Run up diff (current -> desired)
216+
outputUp.style.display = 'none';
217+
errorUp.style.display = 'none';
218+
try {
219+
const result = await window.sqldef(dbType.value, inputB.value, inputA.value);
220+
outputUp.innerHTML = result;
221+
outputUp.style.display = 'block';
222+
} catch (e) {
223+
errorUp.style.display = 'block';
224+
errorUp.innerHTML = e.message;
225+
}
226226

227227
// Run down diff (desired -> current)
228-
outputDown.style.display = 'none'
229-
errorDown.style.display = 'none'
228+
outputDown.style.display = 'none';
229+
errorDown.style.display = 'none';
230230
try {
231-
const result = await window.sqldef(dbType.value, inputA.value, inputB.value)
232-
outputDown.innerHTML = result
233-
outputDown.style.display = 'block'
231+
const result = await window.sqldef(dbType.value, inputA.value, inputB.value);
232+
outputDown.innerHTML = result;
233+
outputDown.style.display = 'block';
234234
} catch (e) {
235-
errorDown.style.display = 'block'
236-
errorDown.innerHTML = e.message
235+
errorDown.style.display = 'block';
236+
errorDown.innerHTML = e.message;
237237
}
238238
}
239239

240240
dbType.addEventListener('change', () => {
241-
const examples = schemaExamples[dbType.value]
242-
if (examples) {
243-
inputA.value = examples.current
244-
inputB.value = examples.desired
245-
}
246-
runDiff()
247-
})
241+
const examples = schemaExamples[dbType.value];
242+
if (examples) {
243+
inputA.value = examples.current;
244+
inputB.value = examples.desired;
245+
}
246+
runDiff();
247+
})
248248

249-
inputA.addEventListener('input', runDiff)
250-
inputB.addEventListener('input', runDiff)
249+
inputA.addEventListener('input', runDiff);
250+
inputB.addEventListener('input', runDiff);
251251

252252
// Run diff on initial load
253-
runDiff()
253+
runDiff();
254254
</script>
255255

256256
<footer>

0 commit comments

Comments
 (0)