Mercurial
comparison .cms/lib/codemirror/mode/sql/index.html @ 0:78edf6b517a0 draft
24.10
author | Coffee CMS <info@coffee-cms.ru> |
---|---|
date | Fri, 11 Oct 2024 22:40:23 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:78edf6b517a0 |
---|---|
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="../../addon/edit/matchbrackets.js"></script> | |
10 <script src="sql.js"></script> | |
11 <link rel="stylesheet" href="../../addon/hint/show-hint.css" /> | |
12 <script src="../../addon/hint/show-hint.js"></script> | |
13 <script src="../../addon/hint/sql-hint.js"></script> | |
14 <style> | |
15 .CodeMirror { | |
16 border-top: 1px solid black; | |
17 border-bottom: 1px solid black; | |
18 } | |
19 </style> | |
20 <div id=nav> | |
21 <a href="https://codemirror.net/5"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png" alt=""></a> | |
22 | |
23 <ul> | |
24 <li><a href="../../index.html">Home</a> | |
25 <li><a href="../../doc/manual.html">Manual</a> | |
26 <li><a href="https://github.com/codemirror/codemirror5">Code</a> | |
27 </ul> | |
28 <ul> | |
29 <li><a href="../index.html">Language modes</a> | |
30 <li><a class=active href="#">SQL Mode for CodeMirror</a> | |
31 </ul> | |
32 </div> | |
33 | |
34 <article> | |
35 <h2>SQL Mode for CodeMirror</h2> | |
36 <form> | |
37 <textarea id="code" name="code">-- SQL Mode for CodeMirror | |
38 SELECT SQL_NO_CACHE DISTINCT | |
39 @var1 AS `val1`, @'val2', @global.'sql_mode', | |
40 1.1 AS `float_val`, .14 AS `another_float`, 0.09e3 AS `int_with_esp`, | |
41 0xFA5 AS `hex`, x'fa5' AS `hex2`, 0b101 AS `bin`, b'101' AS `bin2`, | |
42 DATE '1994-01-01' AS `sql_date`, { T "1994-01-01" } AS `odbc_date`, | |
43 'my string', _utf8'your string', N'her string', | |
44 TRUE, FALSE, UNKNOWN | |
45 FROM DUAL | |
46 -- space needed after '--' | |
47 # 1 line comment | |
48 /* multiline | |
49 comment! */ | |
50 LIMIT 1 OFFSET 0; | |
51 </textarea> | |
52 </form> | |
53 <p><strong>MIME types defined:</strong> | |
54 <code><a href="?mime=text/x-sql">text/x-sql</a></code>, | |
55 <code><a href="?mime=text/x-mysql">text/x-mysql</a></code>, | |
56 <code><a href="?mime=text/x-mariadb">text/x-mariadb</a></code>, | |
57 <code><a href="?mime=text/x-cassandra">text/x-cassandra</a></code>, | |
58 <code><a href="?mime=text/x-plsql">text/x-plsql</a></code>, | |
59 <code><a href="?mime=text/x-mssql">text/x-mssql</a></code>, | |
60 <code><a href="?mime=text/x-hive">text/x-hive</a></code>, | |
61 <code><a href="?mime=text/x-pgsql">text/x-pgsql</a></code>, | |
62 <code><a href="?mime=text/x-gql">text/x-gql</a></code>, | |
63 <code><a href="?mime=text/x-gpsql">text/x-gpsql</a></code>. | |
64 <code><a href="?mime=text/x-esper">text/x-esper</a></code>. | |
65 <code><a href="?mime=text/x-sqlite">text/x-sqlite</a></code>. | |
66 <code><a href="?mime=text/x-sparksql">text/x-sparksql</a></code>. | |
67 <code><a href="?mime=text/x-trino">text/x-trino</a></code>. | |
68 </p> | |
69 <script> | |
70 window.onload = function() { | |
71 var mime = 'text/x-mariadb'; | |
72 // get mime type | |
73 if (window.location.href.indexOf('mime=') > -1) { | |
74 mime = window.location.href.substr(window.location.href.indexOf('mime=') + 5); | |
75 } | |
76 window.editor = CodeMirror.fromTextArea(document.getElementById('code'), { | |
77 mode: mime, | |
78 indentWithTabs: true, | |
79 smartIndent: true, | |
80 lineNumbers: true, | |
81 matchBrackets : true, | |
82 autofocus: true, | |
83 extraKeys: {"Ctrl-Space": "autocomplete"}, | |
84 hintOptions: {tables: { | |
85 users: ["name", "score", "birthDate"], | |
86 countries: ["name", "population", "size"] | |
87 }} | |
88 }); | |
89 }; | |
90 </script> | |
91 | |
92 </article> |