DEV Community

Query Filter
Query Filter

Posted on

format3

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>SQL Formatter</title></head>
<body>
  <textarea id="input" style="width:100%;height:200px;"></textarea>
  <button id="go">Format</button>
  <textarea id="output" style="width:100%;height:200px;"></textarea>
  <script src="sql‑formatter‑standalone.min.js"></script>
  <script>
    document.getElementById('go').onclick = function(){
      const sql = document.getElementById('input').value;
      const formatted = sqlFormatter.format(sql, {language:'sql', keywordCase:'upper'});
      document.getElementById('output').value = formatted;
    };
  </script>
</body></html>


Enter fullscreen mode Exit fullscreen mode

Top comments (0)