Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Questdb
提交
79f9a9d9
Q
Questdb
项目概览
jobily
/
Questdb
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
Questdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
79f9a9d9
编写于
6月 19, 2020
作者:
M
Méril
提交者:
GitHub
6月 19, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(console): add missing keywords/functions to QuestDBMode (code editor) (#415)
上级
0943fd76
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
152 addition
and
10 deletion
+152
-10
ui/src/scenes/Editor/Ace/questdbMode.ts
ui/src/scenes/Editor/Ace/questdbMode.ts
+152
-10
未找到文件。
ui/src/scenes/Editor/Ace/questdbMode.ts
浏览文件 @
79f9a9d9
...
...
@@ -29,18 +29,160 @@ const { Mode: SqlMode } = ace.require("ace/mode/sql") as { Mode: unknown }
const
oop
=
ace
.
require
(
"
ace/lib/oop
"
)
as
{
inherits
:
(
a
:
any
,
b
:
any
)
=>
void
}
const
QuestDBHighlightRules
=
function
(
this
:
HighlightRules
)
{
const
keywords
=
"
select|insert|update|delete|from|where|and|or|by|order|limit|as|case|when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant|over|sample|partition|latest|NaN|with|rename|truncate|asof|copy|alter|into|values|index|add|column|then|distinct|show|tables|columns|group
"
const
builtinConstants
=
"
true|false
"
const
builtinFunctions
=
"
avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl
"
const
dataTypes
=
"
int|date|string|symbol|float|double|binary|timestamp|long|long256
"
const
keywords
=
[
"
add
"
,
"
alter
"
,
"
and
"
,
"
as
"
,
"
asc
"
,
"
asof
"
,
"
by
"
,
"
cache
"
,
"
capacity
"
,
"
case
"
,
"
column
"
,
"
columns
"
,
"
copy
"
,
"
create
"
,
"
cross
"
,
"
database
"
,
"
default
"
,
"
delete
"
,
"
desc
"
,
"
distinct
"
,
"
drop
"
,
"
else
"
,
"
end
"
,
"
foreign
"
,
"
from
"
,
"
grant
"
,
"
group
"
,
"
if
"
,
"
index
"
,
"
inner
"
,
"
insert
"
,
"
into
"
,
"
join
"
,
"
key
"
,
"
latest
"
,
"
left
"
,
"
limit
"
,
"
nan
"
,
"
natural
"
,
"
nocache
"
,
"
not
"
,
"
null
"
,
"
on
"
,
"
or
"
,
"
order
"
,
"
outer
"
,
"
over
"
,
"
partition
"
,
"
primary
"
,
"
references
"
,
"
rename
"
,
"
right
"
,
"
sample
"
,
"
select
"
,
"
show
"
,
"
splice
"
,
"
table
"
,
"
tables
"
,
"
then
"
,
"
truncate
"
,
"
type
"
,
"
union
"
,
"
update
"
,
"
values
"
,
"
when
"
,
"
where
"
,
"
with
"
,
]
const
builtinConstants
=
[
"
false
"
,
"
true
"
]
const
builtinFunctions
=
[
"
abs
"
,
"
all_tables
"
,
"
avg
"
,
"
coalesce
"
,
"
concat
"
,
"
count
"
,
"
dateadd
"
,
"
datediff
"
,
"
day
"
,
"
day_of_week
"
,
"
day_of_week_sunday_first
"
,
"
days_in_month
"
,
"
first
"
,
"
format
"
,
"
hour
"
,
"
ifnull
"
,
"
is_leap_year
"
,
"
isnull
"
,
"
ksum
"
,
"
last
"
,
"
lcase
"
,
"
len
"
,
"
length
"
,
"
long_sequence
"
,
"
max
"
,
"
micros
"
,
"
mid
"
,
"
millis
"
,
"
min
"
,
"
minute
"
,
"
month
"
,
"
now
"
,
"
nsum
"
,
"
nvl
"
,
"
rank
"
,
"
rnd_bin
"
,
"
rnd_boolean
"
,
"
rnd_byte
"
,
"
rnd_char
"
,
"
rnd_date
"
,
"
rnd_double
"
,
"
rnd_float
"
,
"
rnd_int
"
,
"
rnd_long
"
,
"
rnd_long256
"
,
"
rnd_short
"
,
"
rnd_str
"
,
"
rnd_symbol
"
,
"
rnd_timestamp
"
,
"
round
"
,
"
round_down
"
,
"
round_half_even
"
,
"
round_up
"
,
"
second
"
,
"
sum
"
,
"
sysdate
"
,
"
systimestamp
"
,
"
tables_columns
"
,
"
timestamp_sequence
"
,
"
to_date
"
,
"
to_str
"
,
"
to_timestamp
"
,
"
ucase
"
,
"
year
"
,
]
const
dataTypes
=
[
"
binary
"
,
"
date
"
,
"
double
"
,
"
float
"
,
"
int
"
,
"
long
"
,
"
long256
"
,
"
short
"
,
"
string
"
,
"
symbol
"
,
"
timestamp
"
,
]
const
keywordMapper
=
this
.
createKeywordMapper
(
{
keyword
:
[
keywords
,
builtinFunctions
,
builtinConstants
,
dataTypes
]
.
join
(
"
|
"
,
),
keyword
:
[
keywords
,
builtinFunctions
,
builtinConstants
,
dataTypes
]
.
map
((
k
)
=>
k
.
join
(
"
|
"
))
.
join
(
"
|
"
),
},
"
identifier
"
,
true
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录