github.com/jancarloviray/community@v0.41.1-0.20170124221257-33a66c87cf2f/app/public/codemirror/mode/sql/index.html (about) 1 <!doctype html> 2 3 <title>CodeMirror: SQL Mode for CodeMirror</title> 4 <meta charset="utf-8"/> 5 <link rel=stylesheet href="../../doc/docs.css"> 6 7 <link rel="stylesheet" href="../../lib/codemirror.css" /> 8 <script src="../../lib/codemirror.js"></script> 9 <script src="sql.js"></script> 10 <link rel="stylesheet" href="../../addon/hint/show-hint.css" /> 11 <script src="../../addon/hint/show-hint.js"></script> 12 <script src="../../addon/hint/sql-hint.js"></script> 13 <style> 14 .CodeMirror { 15 border-top: 1px solid black; 16 border-bottom: 1px solid black; 17 } 18 </style> 19 <div id=nav> 20 <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a> 21 22 <ul> 23 <li><a href="../../index.html">Home</a> 24 <li><a href="../../doc/manual.html">Manual</a> 25 <li><a href="https://github.com/codemirror/codemirror">Code</a> 26 </ul> 27 <ul> 28 <li><a href="../index.html">Language modes</a> 29 <li><a class=active href="#">SQL Mode for CodeMirror</a> 30 </ul> 31 </div> 32 33 <article> 34 <h2>SQL Mode for CodeMirror</h2> 35 <form> 36 <textarea id="code" name="code">-- SQL Mode for CodeMirror 37 SELECT SQL_NO_CACHE DISTINCT 38 @var1 AS `val1`, @'val2', @global.'sql_mode', 39 1.1 AS `float_val`, .14 AS `another_float`, 0.09e3 AS `int_with_esp`, 40 0xFA5 AS `hex`, x'fa5' AS `hex2`, 0b101 AS `bin`, b'101' AS `bin2`, 41 DATE '1994-01-01' AS `sql_date`, { T "1994-01-01" } AS `odbc_date`, 42 'my string', _utf8'your string', N'her string', 43 TRUE, FALSE, UNKNOWN 44 FROM DUAL 45 -- space needed after '--' 46 # 1 line comment 47 /* multiline 48 comment! */ 49 LIMIT 1 OFFSET 0; 50 </textarea> 51 </form> 52 <p><strong>MIME types defined:</strong> 53 <code><a href="?mime=text/x-sql">text/x-sql</a></code>, 54 <code><a href="?mime=text/x-mysql">text/x-mysql</a></code>, 55 <code><a href="?mime=text/x-mariadb">text/x-mariadb</a></code>, 56 <code><a href="?mime=text/x-cassandra">text/x-cassandra</a></code>, 57 <code><a href="?mime=text/x-plsql">text/x-plsql</a></code>, 58 <code><a href="?mime=text/x-mssql">text/x-mssql</a></code>, 59 <code><a href="?mime=text/x-hive">text/x-hive</a></code>. 60 </p> 61 <script> 62 window.onload = function() { 63 var mime = 'text/x-mariadb'; 64 // get mime type 65 if (window.location.href.indexOf('mime=') > -1) { 66 mime = window.location.href.substr(window.location.href.indexOf('mime=') + 5); 67 } 68 window.editor = CodeMirror.fromTextArea(document.getElementById('code'), { 69 mode: mime, 70 indentWithTabs: true, 71 smartIndent: true, 72 lineNumbers: true, 73 matchBrackets : true, 74 autofocus: true, 75 extraKeys: {"Ctrl-Space": "autocomplete"}, 76 hintOptions: {tables: { 77 users: {name: null, score: null, birthDate: null}, 78 countries: {name: null, population: null, size: null} 79 }} 80 }); 81 }; 82 </script> 83 84 </article>