sqleditor-ag真人国际官网
ⅰ oracle鏁版嵁搴撴庝箞鎵撳紑sql紿楀彛錛堣緭鍏ユ煡澶勮鍙ワ級
1銆佸畨瑁呭苟鎵撳紑toad鍙瑙嗗寲宸ュ叿銆
ⅱ 如何採用element-plus,基於codemirror6實現sql在線編輯器
js在線sql編輯器,下載後導入ide工具中,在瀏覽器訪問sql-editor-master/index.html ,效果如下(含括弧高亮顯示、顯示折疊欄):
codemirror官網https://codemirror.net/, 官網js/css資源文件,也可自行去官網下載,但是官網比較慢,需引入的核心頁面代碼:
核心js代碼:
//根據dom元素的id構造出一個編輯器
var editor=codemirror.fromtextarea(document.getelementbyid("code"),{
mode:"text/c-mysql", //實現java代碼高亮
linenumbers:true,
matchbrackets: true, //括弧高亮匹配
theme:"default",
keymap: "default",
extrakeys:{"tab":"autocomplete"},
hint: codemirror.hint.sql,
linewrapping: true, //是否換行
foldgutter: true, //是否折疊
gutters: ["codemirror-linenumbers", "codemirror-foldgutter"], //添加行號欄,折疊欄
hintoptions: {
tables: tablewords
}
});
輸入關鍵詞提示等信息的配置:allwords.json
動態設置表欄位等信息:
let tablewords = {"al": []};
let tablename = "tn_user";
tablewords[tablename].push("userid");
editor.setoption("hintoptions", {"tables": tablewords});
tablewords json格式如下:
"tablewords": {
"cp_sku": [
"skuid",
"cpbh",
"tcbh"
],
"user_info": [
"user_id",
"user_token",
"user_name",
"user_type",
"password"
]
}
ⅲ 鍦∣racle浣跨敤sql璇鍙ヤ腑濡備綍鎻掑叆鏃ユ湡鏍煎紡鐨勬暟鎹
1銆佽緭鍏ユ湇鍔″櫒鍦板潃銆佹暟鎹搴撶櫥褰曠敤鎴峰悕銆佺櫥褰曞瘑鐮侊紝瀹屾垚鏁版嵁搴撶櫥褰曟搷浣溿