diff --git a/dbgpt/app/static/_next/static/chunks/pages/_app-748b2808f934e1ed.js b/dbgpt/app/static/_next/static/chunks/pages/_app-748b2808f934e1ed.js index ca19246f9..ae8c4274a 100644 --- a/dbgpt/app/static/_next/static/chunks/pages/_app-748b2808f934e1ed.js +++ b/dbgpt/app/static/_next/static/chunks/pages/_app-748b2808f934e1ed.js @@ -158,7 +158,7 @@ if (colorScheme) { ${s}.setAttribute('${l}', colorScheme); } - } catch (e) {} })();`}},"mui-color-scheme-init")})((0,f.Z)({attribute:r,colorSchemeStorageKey:l,defaultMode:s,defaultLightColorScheme:m,defaultDarkColorScheme:g,modeStorageKey:o},e))}}({themeId:eP.Z,theme:e_.Z,attribute:"data-joy-color-scheme",modeStorageKey:"joy-mode",colorSchemeStorageKey:"joy-color-scheme",defaultColorScheme:{light:"light",dark:"dark"},resolveTheme:e=>{let t=e.colorInversion;return e.colorInversion=(0,eh.Z)({soft:(0,ej.pP)(e),solid:(0,ej.Lo)(e)},"function"==typeof t?t(e):t,{clone:!1}),e}});var eM=n(38629),eF=n(59077),eN=n(9818);let eT=(0,eF.Z)({colorSchemes:{light:{palette:{mode:"dark",primary:{...eN.Z.grey,solidBg:"#e6f4ff",solidColor:"#1677ff",solidHoverBg:"#e6f4ff"},neutral:{plainColor:"#4d4d4d",plainHoverColor:"#131318",plainHoverBg:"#EBEBEF",plainActiveBg:"#D8D8DF",plainDisabledColor:"#B9B9C6"},background:{body:"#F7F7F7",surface:"#fff"},text:{primary:"#505050"}}},dark:{palette:{mode:"light",primary:{...eN.Z.grey,softBg:"#353539",softHoverBg:"#35353978",softDisabledBg:"#353539",solidBg:"#51525beb",solidHoverBg:"#51525beb"},neutral:{plainColor:"#D8D8DF",plainHoverColor:"#F7F7F8",plainHoverBg:"#353539",plainActiveBg:"#434356",plainDisabledColor:"#434356",outlinedBorder:"#353539",outlinedHoverBorder:"#454651"},text:{primary:"#FDFDFC"},background:{body:"#151622",surface:"#51525beb"}}}},fontFamily:{body:"Josefin Sans, sans-serif",display:"Josefin Sans, sans-serif"},zIndex:{modal:1001}}),eI=(e,t)=>({...eu.default.darkAlgorithm(e,t),colorBgBase:"#232734",colorBorder:"#828282",colorBgContainer:"#232734"});function eL(e){let{children:t}=e,{mode:n}=(0,a.useContext)(l.p),{i18n:r}=(0,J.$G)(),{setMode:o}=eA();return(0,a.useEffect)(()=>{o(n)},[n]),(0,a.useEffect)(()=>{if(n){var e,t,r,o,i,a;null===(e=document.body)||void 0===e||null===(t=e.classList)||void 0===t||t.add(n),"light"===n?null===(r=document.body)||void 0===r||null===(o=r.classList)||void 0===o||o.remove("dark"):null===(i=document.body)||void 0===i||null===(a=i.classList)||void 0===a||a.remove("light")}},[n]),(0,a.useEffect)(()=>{r.changeLanguage&&r.changeLanguage(window.localStorage.getItem(c.Yl)||"en")},[r]),(0,i.jsxs)("div",{children:[(0,i.jsx)(el,{}),t]})}function eB(e){let{children:t}=e,{isMenuExpand:n,mode:r}=(0,a.useContext)(l.p),{i18n:o}=(0,J.$G)();return(0,i.jsx)(ef.ZP,{locale:"en"===o.language?ep.Z:ed.Z,theme:{token:{colorPrimary:"#0069FE",borderRadius:4},algorithm:"dark"===r?eI:void 0},children:(0,i.jsxs)("div",{className:"flex w-screen h-screen overflow-hidden",children:[(0,i.jsx)("div",{className:ec()("transition-[width]",n?"w-60":"w-20","hidden","md:block"),children:(0,i.jsx)(et,{})}),(0,i.jsx)("div",{className:"flex flex-col flex-1 relative overflow-hidden",children:t})]})})}var ez=function(e){let{Component:t,pageProps:n}=e;return(0,i.jsx)(l.R,{children:(0,i.jsx)(eM.Z,{theme:eT,children:(0,i.jsx)(eZ,{theme:eT,defaultMode:"light",children:(0,i.jsx)(eL,{children:(0,i.jsx)(eB,{children:(0,i.jsx)(t,{...n})})})})})})}},19284:function(e,t,n){"use strict";n.d(t,{Hf:function(){return r},S$:function(){return i},l3:function(){return o}});let r={proxyllm:{label:"Proxy LLM",icon:"/models/chatgpt.png"},"flan-t5-base":{label:"flan-t5-base",icon:"/models/google.png"},"vicuna-13b":{label:"vicuna-13b",icon:"/models/vicuna.jpeg"},"vicuna-7b":{label:"vicuna-7b",icon:"/models/vicuna.jpeg"},"vicuna-13b-v1.5":{label:"vicuna-13b-v1.5",icon:"/models/vicuna.jpeg"},"vicuna-7b-v1.5":{label:"vicuna-7b-v1.5",icon:"/models/vicuna.jpeg"},"codegen2-1b":{label:"codegen2-1B",icon:"/models/vicuna.jpeg"},"codet5p-2b":{label:"codet5p-2b",icon:"/models/vicuna.jpeg"},"chatglm-6b-int4":{label:"chatglm-6b-int4",icon:"/models/chatglm.png"},"chatglm-6b":{label:"chatglm-6b",icon:"/models/chatglm.png"},"chatglm2-6b":{label:"chatglm2-6b",icon:"/models/chatglm.png"},"chatglm2-6b-int4":{label:"chatglm2-6b-int4",icon:"/models/chatglm.png"},"guanaco-33b-merged":{label:"guanaco-33b-merged",icon:"/models/huggingface.svg"},"falcon-40b":{label:"falcon-40b",icon:"/models/falcon.jpeg"},"gorilla-7b":{label:"gorilla-7b",icon:"/models/gorilla.png"},"gptj-6b":{label:"ggml-gpt4all-j-v1.3-groovy.bin",icon:""},chatgpt_proxyllm:{label:"chatgpt_proxyllm",icon:"/models/chatgpt.png"},bard_proxyllm:{label:"bard_proxyllm",icon:"/models/bard.gif"},claude_proxyllm:{label:"claude_proxyllm",icon:"/models/claude.png"},wenxin_proxyllm:{label:"wenxin_proxyllm",icon:""},tongyi_proxyllm:{label:"tongyi_proxyllm",icon:"/models/qwen2.png"},zhipu_proxyllm:{label:"zhipu_proxyllm",icon:"/models/zhipu.png"},"llama-2-7b":{label:"Llama-2-7b-chat-hf",icon:"/models/llama.jpg"},"llama-2-13b":{label:"Llama-2-13b-chat-hf",icon:"/models/llama.jpg"},"llama-2-70b":{label:"Llama-2-70b-chat-hf",icon:"/models/llama.jpg"},"baichuan-13b":{label:"Baichuan-13B-Chat",icon:"/models/baichuan.png"},"baichuan-7b":{label:"baichuan-7b",icon:"/models/baichuan.png"},"baichuan2-7b":{label:"Baichuan2-7B-Chat",icon:"/models/baichuan.png"},"baichuan2-13b":{label:"Baichuan2-13B-Chat",icon:"/models/baichuan.png"},"wizardlm-13b":{label:"WizardLM-13B-V1.2",icon:"/models/wizardlm.png"},"llama-cpp":{label:"ggml-model-q4_0.bin",icon:"/models/huggingface.svg"},"internlm-7b":{label:"internlm-chat-7b-v1_1",icon:"/models/internlm.png"},"internlm-7b-8k":{label:"internlm-chat-7b-8k",icon:"/models/internlm.png"},"solar-10.7b-instruct-v1.0":{label:"solar-10.7b-instruct-v1.0",icon:"/models/solar_logo.png"}},o={Chroma:"/models/chroma-logo.png"},i={mysql:{label:"MySQL",icon:"/icons/mysql.png",desc:"Fast, reliable, scalable open-source relational database management system."},mssql:{label:"MSSQL",icon:"/icons/mssql.png",desc:"Powerful, scalable, secure relational database system by Microsoft."},duckdb:{label:"DuckDB",icon:"/icons/duckdb.png",desc:"In-memory analytical database with efficient query processing."},sqlite:{label:"Sqlite",icon:"/icons/sqlite.png",desc:"Lightweight embedded relational database with simplicity and portability."},clickhouse:{label:"ClickHouse",icon:"/icons/clickhouse.png",desc:"Columnar database for high-performance analytics and real-time queries."},oracle:{label:"Oracle",icon:"/icons/oracle.png",desc:"Robust, scalable, secure relational database widely used in enterprises."},access:{label:"Access",icon:"/icons/access.png",desc:"Easy-to-use relational database for small-scale applications by Microsoft."},mongodb:{label:"MongoDB",icon:"/icons/mongodb.png",desc:"Flexible, scalable NoSQL document database for web and mobile apps."},doris:{label:"ApacheDoris",icon:"/icons/doris.png",desc:"A new-generation open-source real-time data warehouse."},starrocks:{label:"StarRocks",icon:"/icons/starrocks.png",desc:"An Open-Source, High-Performance Analytical Database."},db2:{label:"DB2",icon:"/icons/db2.png",desc:"Scalable, secure relational database system developed by IBM."},hbase:{label:"HBase",icon:"/icons/hbase.png",desc:"Distributed, scalable NoSQL database for large structured/semi-structured data."},redis:{label:"Redis",icon:"/icons/redis.png",desc:"Fast, versatile in-memory data structure store as cache, DB, or broker."},cassandra:{label:"Cassandra",icon:"/icons/cassandra.png",desc:"Scalable, fault-tolerant distributed NoSQL database for large data."},couchbase:{label:"Couchbase",icon:"/icons/couchbase.png",desc:"High-performance NoSQL document database with distributed architecture."},postgresql:{label:"PostgreSQL",icon:"/icons/postgresql.png",desc:"Powerful open-source relational database with extensibility and SQL standards."},spark:{label:"Spark",icon:"/icons/spark.png",desc:"Unified engine for large-scale data analytics."},space:{label:"Space",icon:"/icons/knowledge.png",desc:"knowledge analytics."}}},98399:function(e,t,n){"use strict";function r(){var e;let t=null!==(e=localStorage.getItem(l))&&void 0!==e?e:"";try{let e=JSON.parse(t);return e}catch(e){return null}}n.d(t,{zN:function(){return s},Hf:function(){return o.Hf},rU:function(){return l},Yl:function(){return a},he:function(){return i},S$:function(){return o.S$},a_:function(){return r}});var o=n(19284);let i="__db_gpt_theme_key",a="__db_gpt_lng_key",l="__db_gpt_im_key",s="__db_gpt_static_flow_nodes_key"},21876:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],l=i[1],c=new o((a+l)*3/4-l),u=0,f=l>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=0,l=r-o;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return i.join("")}(e,a,a+16383>l?l:a+16383));return 1===o?i.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===o&&i.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=i.length;a0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},72:function(e,t,n){"use strict";/*! + } catch (e) {} })();`}},"mui-color-scheme-init")})((0,f.Z)({attribute:r,colorSchemeStorageKey:l,defaultMode:s,defaultLightColorScheme:m,defaultDarkColorScheme:g,modeStorageKey:o},e))}}({themeId:eP.Z,theme:e_.Z,attribute:"data-joy-color-scheme",modeStorageKey:"joy-mode",colorSchemeStorageKey:"joy-color-scheme",defaultColorScheme:{light:"light",dark:"dark"},resolveTheme:e=>{let t=e.colorInversion;return e.colorInversion=(0,eh.Z)({soft:(0,ej.pP)(e),solid:(0,ej.Lo)(e)},"function"==typeof t?t(e):t,{clone:!1}),e}});var eM=n(38629),eF=n(59077),eN=n(9818);let eT=(0,eF.Z)({colorSchemes:{light:{palette:{mode:"dark",primary:{...eN.Z.grey,solidBg:"#e6f4ff",solidColor:"#1677ff",solidHoverBg:"#e6f4ff"},neutral:{plainColor:"#4d4d4d",plainHoverColor:"#131318",plainHoverBg:"#EBEBEF",plainActiveBg:"#D8D8DF",plainDisabledColor:"#B9B9C6"},background:{body:"#F7F7F7",surface:"#fff"},text:{primary:"#505050"}}},dark:{palette:{mode:"light",primary:{...eN.Z.grey,softBg:"#353539",softHoverBg:"#35353978",softDisabledBg:"#353539",solidBg:"#51525beb",solidHoverBg:"#51525beb"},neutral:{plainColor:"#D8D8DF",plainHoverColor:"#F7F7F8",plainHoverBg:"#353539",plainActiveBg:"#434356",plainDisabledColor:"#434356",outlinedBorder:"#353539",outlinedHoverBorder:"#454651"},text:{primary:"#FDFDFC"},background:{body:"#151622",surface:"#51525beb"}}}},fontFamily:{body:"Josefin Sans, sans-serif",display:"Josefin Sans, sans-serif"},zIndex:{modal:1001}}),eI=(e,t)=>({...eu.default.darkAlgorithm(e,t),colorBgBase:"#232734",colorBorder:"#828282",colorBgContainer:"#232734"});function eL(e){let{children:t}=e,{mode:n}=(0,a.useContext)(l.p),{i18n:r}=(0,J.$G)(),{setMode:o}=eA();return(0,a.useEffect)(()=>{o(n)},[n]),(0,a.useEffect)(()=>{if(n){var e,t,r,o,i,a;null===(e=document.body)||void 0===e||null===(t=e.classList)||void 0===t||t.add(n),"light"===n?null===(r=document.body)||void 0===r||null===(o=r.classList)||void 0===o||o.remove("dark"):null===(i=document.body)||void 0===i||null===(a=i.classList)||void 0===a||a.remove("light")}},[n]),(0,a.useEffect)(()=>{r.changeLanguage&&r.changeLanguage(window.localStorage.getItem(c.Yl)||"en")},[r]),(0,i.jsxs)("div",{children:[(0,i.jsx)(el,{}),t]})}function eB(e){let{children:t}=e,{isMenuExpand:n,mode:r}=(0,a.useContext)(l.p),{i18n:o}=(0,J.$G)();return(0,i.jsx)(ef.ZP,{locale:"en"===o.language?ep.Z:ed.Z,theme:{token:{colorPrimary:"#0069FE",borderRadius:4},algorithm:"dark"===r?eI:void 0},children:(0,i.jsxs)("div",{className:"flex w-screen h-screen overflow-hidden",children:[(0,i.jsx)("div",{className:ec()("transition-[width]",n?"w-60":"w-20","hidden","md:block"),children:(0,i.jsx)(et,{})}),(0,i.jsx)("div",{className:"flex flex-col flex-1 relative overflow-hidden",children:t})]})})}var ez=function(e){let{Component:t,pageProps:n}=e;return(0,i.jsx)(l.R,{children:(0,i.jsx)(eM.Z,{theme:eT,children:(0,i.jsx)(eZ,{theme:eT,defaultMode:"light",children:(0,i.jsx)(eL,{children:(0,i.jsx)(eB,{children:(0,i.jsx)(t,{...n})})})})})})}},19284:function(e,t,n){"use strict";n.d(t,{Hf:function(){return r},S$:function(){return i},l3:function(){return o}});let r={proxyllm:{label:"Proxy LLM",icon:"/models/chatgpt.png"},"flan-t5-base":{label:"flan-t5-base",icon:"/models/google.png"},"vicuna-13b":{label:"vicuna-13b",icon:"/models/vicuna.jpeg"},"vicuna-7b":{label:"vicuna-7b",icon:"/models/vicuna.jpeg"},"vicuna-13b-v1.5":{label:"vicuna-13b-v1.5",icon:"/models/vicuna.jpeg"},"vicuna-7b-v1.5":{label:"vicuna-7b-v1.5",icon:"/models/vicuna.jpeg"},"codegen2-1b":{label:"codegen2-1B",icon:"/models/vicuna.jpeg"},"codet5p-2b":{label:"codet5p-2b",icon:"/models/vicuna.jpeg"},"chatglm-6b-int4":{label:"chatglm-6b-int4",icon:"/models/chatglm.png"},"chatglm-6b":{label:"chatglm-6b",icon:"/models/chatglm.png"},"chatglm2-6b":{label:"chatglm2-6b",icon:"/models/chatglm.png"},"chatglm2-6b-int4":{label:"chatglm2-6b-int4",icon:"/models/chatglm.png"},"guanaco-33b-merged":{label:"guanaco-33b-merged",icon:"/models/huggingface.svg"},"falcon-40b":{label:"falcon-40b",icon:"/models/falcon.jpeg"},"gorilla-7b":{label:"gorilla-7b",icon:"/models/gorilla.png"},"gptj-6b":{label:"ggml-gpt4all-j-v1.3-groovy.bin",icon:""},chatgpt_proxyllm:{label:"chatgpt_proxyllm",icon:"/models/chatgpt.png"},bard_proxyllm:{label:"bard_proxyllm",icon:"/models/bard.gif"},claude_proxyllm:{label:"claude_proxyllm",icon:"/models/claude.png"},wenxin_proxyllm:{label:"wenxin_proxyllm",icon:""},tongyi_proxyllm:{label:"tongyi_proxyllm",icon:"/models/qwen2.png"},zhipu_proxyllm:{label:"zhipu_proxyllm",icon:"/models/zhipu.png"},"llama-2-7b":{label:"Llama-2-7b-chat-hf",icon:"/models/llama.jpg"},"llama-2-13b":{label:"Llama-2-13b-chat-hf",icon:"/models/llama.jpg"},"llama-2-70b":{label:"Llama-2-70b-chat-hf",icon:"/models/llama.jpg"},"baichuan-13b":{label:"Baichuan-13B-Chat",icon:"/models/baichuan.png"},"baichuan-7b":{label:"baichuan-7b",icon:"/models/baichuan.png"},"baichuan2-7b":{label:"Baichuan2-7B-Chat",icon:"/models/baichuan.png"},"baichuan2-13b":{label:"Baichuan2-13B-Chat",icon:"/models/baichuan.png"},"wizardlm-13b":{label:"WizardLM-13B-V1.2",icon:"/models/wizardlm.png"},"llama-cpp":{label:"ggml-model-q4_0.bin",icon:"/models/huggingface.svg"},"internlm-7b":{label:"internlm-chat-7b-v1_1",icon:"/models/internlm.png"},"internlm-7b-8k":{label:"internlm-chat-7b-8k",icon:"/models/internlm.png"},"solar-10.7b-instruct-v1.0":{label:"solar-10.7b-instruct-v1.0",icon:"/models/solar_logo.png"}},o={Chroma:"/models/chroma-logo.png"},i={mysql:{label:"MySQL",icon:"/icons/mysql.png",desc:"Fast, reliable, scalable open-source relational database management system."},mssql:{label:"MSSQL",icon:"/icons/mssql.png",desc:"Powerful, scalable, secure relational database system by Microsoft."},duckdb:{label:"DuckDB",icon:"/icons/duckdb.png",desc:"In-memory analytical database with efficient query processing."},sqlite:{label:"Sqlite",icon:"/icons/sqlite.png",desc:"Lightweight embedded relational database with simplicity and portability."},clickhouse:{label:"ClickHouse",icon:"/icons/clickhouse.png",desc:"Columnar database for high-performance analytics and real-time queries."},oracle:{label:"Oracle",icon:"/icons/oracle.png",desc:"Robust, scalable, secure relational database widely used in enterprises."},access:{label:"Access",icon:"/icons/access.png",desc:"Easy-to-use relational database for small-scale applications by Microsoft."},mongodb:{label:"MongoDB",icon:"/icons/mongodb.png",desc:"Flexible, scalable NoSQL document database for web and mobile apps."},doris:{label:"ApacheDoris",icon:"/icons/doris.png",desc:"A new-generation open-source real-time data warehouse."},starrocks:{label:"StarRocks",icon:"/icons/starrocks.png",desc:"An Open-Source, High-Performance Analytical Database."},db2:{label:"DB2",icon:"/icons/db2.png",desc:"Scalable, secure relational database system developed by IBM."},hbase:{label:"HBase",icon:"/icons/hbase.png",desc:"Distributed, scalable NoSQL database for large structured/semi-structured data."},redis:{label:"Redis",icon:"/icons/redis.png",desc:"Fast, versatile in-memory data structure store as cache, DB, or broker."},cassandra:{label:"Cassandra",icon:"/icons/cassandra.png",desc:"Scalable, fault-tolerant distributed NoSQL database for large data."},couchbase:{label:"Couchbase",icon:"/icons/couchbase.png",desc:"High-performance NoSQL document database with distributed architecture."},postgresql:{label:"PostgreSQL",icon:"/icons/postgresql.png",desc:"Powerful open-source relational database with extensibility and SQL standards."},spark:{label:"Spark",icon:"/icons/spark.png",desc:"Unified engine for large-scale data analytics."},space:{label:"Space",icon:"/icons/knowledge.png",desc:"knowledge analytics."},hive:{label:"Hive",icon:"/icons/hive.png",desc:"A distributed fault-tolerant data warehouse system."}}},98399:function(e,t,n){"use strict";function r(){var e;let t=null!==(e=localStorage.getItem(l))&&void 0!==e?e:"";try{let e=JSON.parse(t);return e}catch(e){return null}}n.d(t,{zN:function(){return s},Hf:function(){return o.Hf},rU:function(){return l},Yl:function(){return a},he:function(){return i},S$:function(){return o.S$},a_:function(){return r}});var o=n(19284);let i="__db_gpt_theme_key",a="__db_gpt_lng_key",l="__db_gpt_im_key",s="__db_gpt_static_flow_nodes_key"},21876:function(e){!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r},t.toByteArray=function(e){var t,n,i=s(e),a=i[0],l=i[1],c=new o((a+l)*3/4-l),u=0,f=l>0?a-4:a;for(n=0;n>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,i=[],a=0,l=r-o;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return i.join("")}(e,a,a+16383>l?l:a+16383));return 1===o?i.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===o&&i.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),i.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=i.length;a0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},72:function(e,t,n){"use strict";/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh diff --git a/dbgpt/app/static/_next/static/chunks/pages/database-107b1b057ad44146.js b/dbgpt/app/static/_next/static/chunks/pages/database-107b1b057ad44146.js index 3515d92bf..8d9621437 100644 --- a/dbgpt/app/static/_next/static/chunks/pages/database-107b1b057ad44146.js +++ b/dbgpt/app/static/_next/static/chunks/pages/database-107b1b057ad44146.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5498],{55286:function(e,s,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/database",function(){return l(99473)}])},26892:function(e,s,l){"use strict";var t=l(85893),a=l(67294),r=l(66309),n=l(83062),i=l(94184),d=l.n(i),c=l(25675),o=l.n(c);s.Z=(0,a.memo)(function(e){let{icon:s,iconBorder:l=!0,title:i,desc:c,tags:m,children:u,disabled:x,operations:b,className:p,...h}=e,f=(0,a.useMemo)(()=>s?"string"==typeof s?(0,t.jsx)(o(),{className:d()("w-11 h-11 rounded-full mr-4 object-contain bg-white",{"border border-gray-200":l}),width:44,height:44,src:s,alt:i}):s:null,[s]),j=(0,a.useMemo)(()=>m&&m.length?(0,t.jsx)("div",{className:"flex items-center mt-1 flex-wrap",children:m.map((e,s)=>{var l;return"string"==typeof e?(0,t.jsx)(r.Z,{className:"text-xs",bordered:!1,color:"default",children:e},s):(0,t.jsx)(r.Z,{className:"text-xs",bordered:null!==(l=e.border)&&void 0!==l&&l,color:e.color,children:e.text},s)})}):null,[m]);return(0,t.jsxs)("div",{className:d()("group/card relative flex flex-col w-72 rounded justify-between text-black bg-white shadow-[0_8px_16px_-10px_rgba(100,100,100,.08)] hover:shadow-[0_14px_20px_-10px_rgba(100,100,100,.15)] dark:bg-[#232734] dark:text-white dark:hover:border-white transition-[transfrom_shadow] duration-300 hover:-translate-y-1 min-h-fit",{"grayscale cursor-no-drop":x,"cursor-pointer":!x&&!!h.onClick},p),...h,children:[(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[f,(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold",children:i}),j]})]}),c&&(0,t.jsx)(n.Z,{title:c,children:(0,t.jsx)("p",{className:"mt-2 text-sm text-gray-500 font-normal line-clamp-2",children:c})})]}),(0,t.jsxs)("div",{children:[u,b&&!!b.length&&(0,t.jsx)("div",{className:"flex flex-wrap items-center justify-center border-t border-solid border-gray-100 dark:border-theme-dark",children:b.map((e,s)=>(0,t.jsx)(n.Z,{title:e.label,children:(0,t.jsxs)("div",{className:"relative flex flex-1 items-center justify-center h-11 text-gray-400 hover:text-blue-500 transition-colors duration-300 cursor-pointer",onClick:s=>{var l;s.stopPropagation(),null===(l=e.onClick)||void 0===l||l.call(e)},children:[e.children,sk(r,Z),[r,Z]);(0,a.useEffect)(()=>{l&&N.setFieldValue("db_type",l)},[l]),(0,a.useEffect)(()=>{c&&N.setFieldsValue({...c})},[c]),(0,a.useEffect)(()=>{s||N.resetFields()},[s]);let w=async e=>{let{db_host:s,db_path:l,db_port:t,...a}=e;if(!c&&o.some(e=>e===a.db_name)){i.ZP.error("The database already exists!");return}let r={db_host:g?void 0:s,db_port:g?void 0:t,file_path:g?l:void 0,...a};v(!0);try{let[e]=await (0,f.Vx)((0,f.KS)(r));if(e)return;let[s]=await (0,f.Vx)((c?f.mR:f.b_)(r));if(s){i.ZP.error(s.message);return}i.ZP.success("success"),null==u||u()}catch(e){i.ZP.error(e.message)}finally{v(!1)}},C=(0,a.useMemo)(()=>!!c||!!l,[c,l]);return(0,t.jsx)(n.default,{open:s,width:400,title:_(c?"Edit":"create_database"),maskClosable:!1,footer:null,onCancel:m,children:(0,t.jsxs)(x.Z,{form:N,className:"pt-2",labelCol:{span:6},labelAlign:"left",onFinish:w,children:[(0,t.jsx)(x.Z.Item,{name:"db_type",label:"DB Type",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(b.default,{"aria-readonly":C,disabled:C,options:r})}),(0,t.jsx)(x.Z.Item,{name:"db_name",label:"DB Name",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(p.default,{readOnly:!!c,disabled:!!c})}),!0===g&&(0,t.jsx)(x.Z.Item,{name:"db_path",label:"Path",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(p.default,{})}),!1===g&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Z.Item,{name:"db_user",label:"Username",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(p.default,{})}),(0,t.jsx)(x.Z.Item,{name:"db_pwd",label:"Password",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(p.default,{type:"password"})}),(0,t.jsx)(x.Z.Item,{name:"db_host",label:"Host",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(p.default,{})}),(0,t.jsx)(x.Z.Item,{name:"db_port",label:"Port",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(h.Z,{min:1,step:1,max:65535})})]}),(0,t.jsx)(x.Z.Item,{name:"comment",label:"Remark",className:"mb-3",children:(0,t.jsx)(p.default,{})}),(0,t.jsxs)(x.Z.Item,{className:"flex flex-row-reverse pt-1 mb-0",children:[(0,t.jsx)(d.ZP,{htmlType:"submit",type:"primary",size:"middle",className:"mr-1",loading:y,children:"Save"}),(0,t.jsx)(d.ZP,{size:"middle",onClick:m,children:"Cancel"})]})]})})},v=l(24969),_=l(36531),N=l(27704),Z=l(45247),g=l(98399),w=l(26892);function k(e,s){var l;return null===(l=e.find(e=>e.value===s))||void 0===l?void 0:l.isFileDb}var C=function(){var e;let{t:s}=(0,j.$G)(),[l,x]=(0,a.useState)([]),[b,p]=(0,a.useState)([]),[h,k]=(0,a.useState)(!1),[C,P]=(0,a.useState)({open:!1}),[E,S]=(0,a.useState)({open:!1}),F=async()=>{let[,e]=await (0,f.Vx)((0,f.Jm)());p(null!=e?e:[])},T=async()=>{k(!0);let[,e]=await (0,f.Vx)((0,f.Bw)());x(null!=e?e:[]),k(!1)},I=(0,a.useMemo)(()=>{let e=b.map(e=>{let{db_type:s,is_file_db:l}=e;return{...g.S$[s],value:s,isFileDb:l}}),s=Object.keys(g.S$).filter(s=>!e.some(e=>e.value===s)).map(e=>({...g.S$[e],value:g.S$[e].label,disabled:!0}));return[...e,...s]},[b]),D=e=>{P({open:!0,info:e})},V=e=>{n.default.confirm({title:"Tips",content:"Do you Want to delete the ".concat(e.db_name,"?"),onOk:()=>new Promise(async(s,l)=>{try{let[t]=await (0,f.Vx)((0,f.J5)(e.db_name));if(t){i.ZP.error(t.message),l();return}i.ZP.success("success"),T(),s()}catch(e){l()}})})},q=(0,a.useMemo)(()=>{let e=I.reduce((e,s)=>(e[s.value]=l.filter(e=>e.db_type===s.value),e),{});return e},[l,I]);(0,r.Z)(async()=>{await T(),await F()},[]);let M=e=>{let s=l.filter(s=>s.db_type===e.value);S({open:!0,dbList:s,name:e.label,type:e.value})};return(0,t.jsxs)("div",{className:"relative p-4 md:p-6 min-h-full overflow-y-auto",children:[(0,t.jsx)(Z.Z,{visible:h}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(d.ZP,{type:"primary",className:"flex items-center",icon:(0,t.jsx)(v.Z,{}),onClick:()=>{P({open:!0})},children:s("create")})}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 md:gap-4",children:I.map(s=>(0,t.jsx)(c.Z,{count:q[s.value].length,className:"min-h-fit",children:(0,t.jsx)(w.Z,{className:"h-full",title:s.label,desc:null!==(e=s.desc)&&void 0!==e?e:"",disabled:s.disabled,icon:s.icon,onClick:()=>{s.disabled||M(s)}})},s.value))}),(0,t.jsx)(y,{open:C.open,dbTypeList:I,choiceDBType:C.dbType,editValue:C.info,dbNames:l.map(e=>e.db_name),onSuccess:()=>{P({open:!1}),T()},onClose:()=>{P({open:!1})}}),(0,t.jsx)(o.Z,{title:E.name,placement:"right",onClose:()=>{S({open:!1})},open:E.open,children:E.type&&q[E.type]&&q[E.type].length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.ZP,{type:"primary",className:"mb-4 flex items-center",icon:(0,t.jsx)(v.Z,{}),onClick:()=>{P({open:!0,dbType:E.type})},children:"Create"}),q[E.type].map(e=>(0,t.jsxs)(m.Z,{title:e.db_name,extra:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.Z,{className:"mr-2",style:{color:"#1b7eff"},onClick:()=>{D(e)}}),(0,t.jsx)(N.Z,{style:{color:"#ff1b2e"},onClick:()=>{V(e)}})]}),className:"mb-4",children:[e.db_path?(0,t.jsxs)("p",{children:["path: ",e.db_path]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{children:["host: ",e.db_host]}),(0,t.jsxs)("p",{children:["username: ",e.db_user]}),(0,t.jsxs)("p",{children:["port: ",e.db_port]})]}),(0,t.jsxs)("p",{children:["remark: ",e.comment]})]},e.db_name))]}):(0,t.jsx)(u.Z,{image:u.Z.PRESENTED_IMAGE_DEFAULT,children:(0,t.jsx)(d.ZP,{type:"primary",className:"flex items-center mx-auto",icon:(0,t.jsx)(v.Z,{}),onClick:()=>{P({open:!0,dbType:E.type})},children:"Create Now"})})})]})}}},function(e){e.O(0,[2185,5503,9479,1009,4442,5813,411,8928,7902,9774,2888,179],function(){return e(e.s=55286)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5498],{55286:function(e,s,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/database",function(){return l(99473)}])},26892:function(e,s,l){"use strict";var t=l(85893),a=l(67294),r=l(66309),n=l(83062),i=l(94184),d=l.n(i),c=l(25675),o=l.n(c);s.Z=(0,a.memo)(function(e){let{icon:s,iconBorder:l=!0,title:i,desc:c,tags:m,children:u,disabled:x,operations:b,className:p,...h}=e,f=(0,a.useMemo)(()=>s?"string"==typeof s?(0,t.jsx)(o(),{className:d()("w-11 h-11 rounded-full mr-4 object-contain bg-white",{"border border-gray-200":l}),width:44,height:44,src:s,alt:i}):s:null,[s]),j=(0,a.useMemo)(()=>m&&m.length?(0,t.jsx)("div",{className:"flex items-center mt-1 flex-wrap",children:m.map((e,s)=>{var l;return"string"==typeof e?(0,t.jsx)(r.Z,{className:"text-xs",bordered:!1,color:"default",children:e},s):(0,t.jsx)(r.Z,{className:"text-xs",bordered:null!==(l=e.border)&&void 0!==l&&l,color:e.color,children:e.text},s)})}):null,[m]);return(0,t.jsxs)("div",{className:d()("group/card relative flex flex-col w-72 rounded justify-between text-black bg-white shadow-[0_8px_16px_-10px_rgba(100,100,100,.08)] hover:shadow-[0_14px_20px_-10px_rgba(100,100,100,.15)] dark:bg-[#232734] dark:text-white dark:hover:border-white transition-[transfrom_shadow] duration-300 hover:-translate-y-1 min-h-fit",{"grayscale cursor-no-drop":x,"cursor-pointer":!x&&!!h.onClick},p),...h,children:[(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[f,(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold",children:i}),j]})]}),c&&(0,t.jsx)(n.Z,{title:c,children:(0,t.jsx)("p",{className:"mt-2 text-sm text-gray-500 font-normal line-clamp-2",children:c})})]}),(0,t.jsxs)("div",{children:[u,b&&!!b.length&&(0,t.jsx)("div",{className:"flex flex-wrap items-center justify-center border-t border-solid border-gray-100 dark:border-theme-dark",children:b.map((e,s)=>(0,t.jsx)(n.Z,{title:e.label,children:(0,t.jsxs)("div",{className:"relative flex flex-1 items-center justify-center h-11 text-gray-400 hover:text-blue-500 transition-colors duration-300 cursor-pointer",onClick:s=>{var l;s.stopPropagation(),null===(l=e.onClick)||void 0===l||l.call(e)},children:[e.children,sk(r,Z),[r,Z]);(0,a.useEffect)(()=>{l&&N.setFieldValue("db_type",l)},[l]),(0,a.useEffect)(()=>{c&&N.setFieldsValue({...c})},[c]),(0,a.useEffect)(()=>{s||N.resetFields()},[s]);let w=async e=>{let{db_host:s,db_path:l,db_port:t,...a}=e;if(!c&&o.some(e=>e===a.db_name)){i.ZP.error("The database already exists!");return}let r={db_host:g?void 0:s,db_port:g?void 0:t,file_path:g?l:void 0,...a};v(!0);try{let[e]=await(0,f.Vx)((0,f.KS)(r));if(e)return;let[s]=await(0,f.Vx)((c?f.mR:f.b_)(r));if(s){i.ZP.error(s.message);return}i.ZP.success("success"),null==u||u()}catch(e){i.ZP.error(e.message)}finally{v(!1)}},C=(0,a.useMemo)(()=>!!c||!!l,[c,l]);const isRequired=['hive'].every(item=>item!==Z);return(0,t.jsx)(n.default,{open:s,width:400,title:_(c?"Edit":"create_database"),maskClosable:!1,footer:null,onCancel:m,children:(0,t.jsxs)(x.Z,{form:N,className:"pt-2",labelCol:{span:6},labelAlign:"left",onFinish:w,children:[(0,t.jsx)(x.Z.Item,{name:"db_type",label:"DB Type",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(b.default,{"aria-readonly":C,disabled:C,options:r})}),(0,t.jsx)(x.Z.Item,{name:"db_name",label:"DB Name",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(p.default,{readOnly:!!c,disabled:!!c})}),!0===g&&(0,t.jsx)(x.Z.Item,{name:"db_path",label:"Path",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(p.default,{})}),!1===g&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x.Z.Item,{name:"db_user",label:"Username",className:"mb-3",rules:isRequired?[{required:!0}]:[],children:(0,t.jsx)(p.default,{})}),(0,t.jsx)(x.Z.Item,{name:"db_pwd",label:"Password",className:"mb-3",rules:isRequired?[{required:!0}]:[],children:(0,t.jsx)(p.default,{type:"password"})}),(0,t.jsx)(x.Z.Item,{name:"db_host",label:"Host",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(p.default,{})}),(0,t.jsx)(x.Z.Item,{name:"db_port",label:"Port",className:"mb-3",rules:[{required:!0}],children:(0,t.jsx)(h.Z,{min:1,step:1,max:65535})})]}),(0,t.jsx)(x.Z.Item,{name:"comment",label:"Remark",className:"mb-3",children:(0,t.jsx)(p.default,{})}),(0,t.jsxs)(x.Z.Item,{className:"flex flex-row-reverse pt-1 mb-0",children:[(0,t.jsx)(d.ZP,{htmlType:"submit",type:"primary",size:"middle",className:"mr-1",loading:y,children:"Save"}),(0,t.jsx)(d.ZP,{size:"middle",onClick:m,children:"Cancel"})]})]})})},v=l(24969),_=l(36531),N=l(27704),Z=l(45247),g=l(98399),w=l(26892);function k(e,s){var l;return null===(l=e.find(e=>e.value===s))||void 0===l?void 0:l.isFileDb}var C=function(){var e;let{t:s}=(0,j.$G)(),[l,x]=(0,a.useState)([]),[b,p]=(0,a.useState)([]),[h,k]=(0,a.useState)(!1),[C,P]=(0,a.useState)({open:!1}),[E,S]=(0,a.useState)({open:!1}),F=async()=>{let[,e]=await(0,f.Vx)((0,f.Jm)());p(null!=e?e:[])},T=async()=>{k(!0);let[,e]=await(0,f.Vx)((0,f.Bw)());x(null!=e?e:[]),k(!1)},I=(0,a.useMemo)(()=>{let e=b.map(e=>{let{db_type:s,is_file_db:l}=e;return{...g.S$[s],value:s,isFileDb:l}}),s=Object.keys(g.S$).filter(s=>!e.some(e=>e.value===s)).map(e=>({...g.S$[e],value:g.S$[e].label,disabled:!0}));return[...e,...s]},[b]),D=e=>{P({open:!0,info:e})},V=e=>{n.default.confirm({title:"Tips",content:"Do you Want to delete the ".concat(e.db_name,"?"),onOk:()=>new Promise(async(s,l)=>{try{let[t]=await(0,f.Vx)((0,f.J5)(e.db_name));if(t){i.ZP.error(t.message),l();return}i.ZP.success("success"),T(),s()}catch(e){l()}})})},q=(0,a.useMemo)(()=>{let e=I.reduce((e,s)=>(e[s.value]=l.filter(e=>e.db_type===s.value),e),{});return e},[l,I]);(0,r.Z)(async()=>{await T(),await F()},[]);let M=e=>{let s=l.filter(s=>s.db_type===e.value);S({open:!0,dbList:s,name:e.label,type:e.value})};return(0,t.jsxs)("div",{className:"relative p-4 md:p-6 min-h-full overflow-y-auto",children:[(0,t.jsx)(Z.Z,{visible:h}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(d.ZP,{type:"primary",className:"flex items-center",icon:(0,t.jsx)(v.Z,{}),onClick:()=>{P({open:!0})},children:s("create")})}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 md:gap-4",children:I.map(s=>(0,t.jsx)(c.Z,{count:q[s.value].length,className:"min-h-fit",children:(0,t.jsx)(w.Z,{className:"h-full",title:s.label,desc:null!==(e=s.desc)&&void 0!==e?e:"",disabled:s.disabled,icon:s.icon,onClick:()=>{s.disabled||M(s)}})},s.value))}),(0,t.jsx)(y,{open:C.open,dbTypeList:I,choiceDBType:C.dbType,editValue:C.info,dbNames:l.map(e=>e.db_name),onSuccess:()=>{P({open:!1}),T()},onClose:()=>{P({open:!1})}}),(0,t.jsx)(o.Z,{title:E.name,placement:"right",onClose:()=>{S({open:!1})},open:E.open,children:E.type&&q[E.type]&&q[E.type].length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.ZP,{type:"primary",className:"mb-4 flex items-center",icon:(0,t.jsx)(v.Z,{}),onClick:()=>{P({open:!0,dbType:E.type})},children:"Create"}),q[E.type].map(e=>(0,t.jsxs)(m.Z,{title:e.db_name,extra:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(_.Z,{className:"mr-2",style:{color:"#1b7eff"},onClick:()=>{D(e)}}),(0,t.jsx)(N.Z,{style:{color:"#ff1b2e"},onClick:()=>{V(e)}})]}),className:"mb-4",children:[e.db_path?(0,t.jsxs)("p",{children:["path: ",e.db_path]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{children:["host: ",e.db_host]}),(0,t.jsxs)("p",{children:["username: ",e.db_user]}),(0,t.jsxs)("p",{children:["port: ",e.db_port]})]}),(0,t.jsxs)("p",{children:["remark: ",e.comment]})]},e.db_name))]}):(0,t.jsx)(u.Z,{image:u.Z.PRESENTED_IMAGE_DEFAULT,children:(0,t.jsx)(d.ZP,{type:"primary",className:"flex items-center mx-auto",icon:(0,t.jsx)(v.Z,{}),onClick:()=>{P({open:!0,dbType:E.type})},children:"Create Now"})})})]})}}},function(e){e.O(0,[2185,5503,9479,1009,4442,5813,411,8928,7902,9774,2888,179],function(){return e(e.s=55286)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/dbgpt/app/static/database/index.html b/dbgpt/app/static/database/index.html index 117d67283..8e8f1f95d 100644 --- a/dbgpt/app/static/database/index.html +++ b/dbgpt/app/static/database/index.html @@ -1 +1,922 @@ -
MySQL

MySQL

Fast, reliable, scalable open-source relational database management system.

MSSQL

MSSQL

Powerful, scalable, secure relational database system by Microsoft.

DuckDB

DuckDB

In-memory analytical database with efficient query processing.

Sqlite

Sqlite

Lightweight embedded relational database with simplicity and portability.

ClickHouse

ClickHouse

Columnar database for high-performance analytics and real-time queries.

Oracle

Oracle

Robust, scalable, secure relational database widely used in enterprises.

Access

Access

Easy-to-use relational database for small-scale applications by Microsoft.

MongoDB

MongoDB

Flexible, scalable NoSQL document database for web and mobile apps.

ApacheDoris

ApacheDoris

A new-generation open-source real-time data warehouse.

StarRocks

StarRocks

An Open-Source, High-Performance Analytical Database.

DB2

DB2

Scalable, secure relational database system developed by IBM.

HBase

HBase

Distributed, scalable NoSQL database for large structured/semi-structured data.

Redis

Redis

Fast, versatile in-memory data structure store as cache, DB, or broker.

Cassandra

Cassandra

Scalable, fault-tolerant distributed NoSQL database for large data.

Couchbase

Couchbase

High-performance NoSQL document database with distributed architecture.

PostgreSQL

PostgreSQL

Powerful open-source relational database with extensibility and SQL standards.

Spark

Spark

Unified engine for large-scale data analytics.

Space

Space

knowledge analytics.

\ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ +
+
+
+ +
+
+ +
+
+
+ MySQL +
+

+ MySQL +

+
+
+

+ Fast, reliable, scalable open-source relational database management system. +

+
+
+
+
+
+ +
+
+
+ MSSQL +
+

+ MSSQL +

+
+
+

+ Powerful, scalable, secure relational database system by Microsoft. +

+
+
+
+
+
+ +
+
+
+ DuckDB +
+

+ DuckDB +

+
+
+

+ In-memory analytical database with efficient query processing. +

+
+
+
+
+
+ +
+
+
+ Sqlite +
+

+ Sqlite +

+
+
+

+ Lightweight embedded relational database with simplicity and portability. +

+
+
+
+
+
+ +
+
+
+ ClickHouse +
+

+ ClickHouse +

+
+
+

+ Columnar database for high-performance analytics and real-time queries. +

+
+
+
+
+
+ +
+
+
+ Oracle +
+

+ Oracle +

+
+
+

+ Robust, scalable, secure relational database widely used in enterprises. +

+
+
+
+
+
+ +
+
+
+ Access +
+

+ Access +

+
+
+

+ Easy-to-use relational database for small-scale applications by Microsoft. +

+
+
+
+
+
+ +
+
+
+ MongoDB +
+

+ MongoDB +

+
+
+

+ Flexible, scalable NoSQL document database for web and mobile apps. +

+
+
+
+
+
+ +
+
+
+ ApacheDoris +
+

+ ApacheDoris +

+
+
+

+ A new-generation open-source real-time data warehouse. +

+
+
+
+
+
+ +
+
+
+ StarRocks +
+

+ StarRocks +

+
+
+

+ An Open-Source, High-Performance Analytical Database. +

+
+
+
+
+
+ +
+
+
+ DB2 +
+

+ DB2 +

+
+
+

+ Scalable, secure relational database system developed by IBM. +

+
+
+
+
+
+ +
+
+
+ HBase +
+

+ HBase +

+
+
+

+ Distributed, scalable NoSQL database for large structured/semi-structured + data. +

+
+
+
+
+
+ +
+
+
+ Redis +
+

+ Redis +

+
+
+

+ Fast, versatile in-memory data structure store as cache, DB, or broker. +

+
+
+
+
+
+ +
+
+
+ Cassandra +
+

+ Cassandra +

+
+
+

+ Scalable, fault-tolerant distributed NoSQL database for large data. +

+
+
+
+
+
+ +
+
+
+ Couchbase +
+

+ Couchbase +

+
+
+

+ High-performance NoSQL document database with distributed architecture. +

+
+
+
+
+
+ +
+
+
+ PostgreSQL +
+

+ PostgreSQL +

+
+
+

+ Powerful open-source relational database with extensibility and SQL standards. +

+
+
+
+
+
+ +
+
+
+ Spark +
+

+ Spark +

+
+
+

+ Unified engine for large-scale data analytics. +

+
+
+
+
+
+ +
+
+
+ Space +
+

+ Space +

+
+
+

+ knowledge analytics. +

+
+
+
+
+
+ +
+
+
+ Hive +
+

+ Hive +

+
+
+

+ A distributed fault-tolerant data warehouse system. +

+
+
+
+
+
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/dbgpt/app/static/icons/hive.png b/dbgpt/app/static/icons/hive.png new file mode 100644 index 000000000..faf05f138 Binary files /dev/null and b/dbgpt/app/static/icons/hive.png differ diff --git a/dbgpt/datasource/manages/connection_manager.py b/dbgpt/datasource/manages/connection_manager.py index 01c4c5ec6..74d2a1c55 100644 --- a/dbgpt/datasource/manages/connection_manager.py +++ b/dbgpt/datasource/manages/connection_manager.py @@ -9,6 +9,7 @@ from dbgpt.datasource.rdbms.conn_clickhouse import ClickhouseConnect from dbgpt.datasource.rdbms.conn_doris import DorisConnect from dbgpt.datasource.rdbms.conn_duckdb import DuckDbConnect +from dbgpt.datasource.rdbms.conn_hive import HiveConnect from dbgpt.datasource.rdbms.conn_mssql import MSSQLConnect from dbgpt.datasource.rdbms.conn_mysql import MySQLConnect from dbgpt.datasource.rdbms.conn_postgresql import PostgreSQLDatabase diff --git a/dbgpt/datasource/rdbms/conn_hive.py b/dbgpt/datasource/rdbms/conn_hive.py new file mode 100644 index 000000000..423f50bf8 --- /dev/null +++ b/dbgpt/datasource/rdbms/conn_hive.py @@ -0,0 +1,58 @@ +from typing import Any, Optional +from urllib.parse import quote +from urllib.parse import quote_plus as urlquote + +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +from dbgpt.datasource.rdbms.base import RDBMSDatabase + + +class HiveConnect(RDBMSDatabase): + """db type""" + + db_type: str = "hive" + """db driver""" + driver: str = "hive" + """db dialect""" + dialect: str = "hive" + + @classmethod + def from_uri_db( + cls, + host: str, + port: int, + user: str, + pwd: str, + db_name: str, + engine_args: Optional[dict] = None, + **kwargs: Any, + ) -> RDBMSDatabase: + """Construct a SQLAlchemy engine from uri database. + Args: + host (str): database host. + port (int): database port. + user (str): database user. + pwd (str): database password. + db_name (str): database name. + engine_args (Optional[dict]):other engine_args. + """ + db_url: str = f"{cls.driver}://{host}:{str(port)}/{db_name}" + if user and pwd: + db_url: str = f"{cls.driver}://{quote(user)}:{urlquote(pwd)}@{host}:{str(port)}/{db_name}" + return cls.from_uri(db_url, engine_args, **kwargs) + + def table_simple_info(self): + return [] + + def get_users(self): + return [] + + def get_grants(self): + return [] + + def get_collation(self): + """Get collation.""" + return "UTF-8" + + def get_charset(self): + return "UTF-8" diff --git a/dbgpt/storage/schema.py b/dbgpt/storage/schema.py index d5874ba8e..9ae8a67e4 100644 --- a/dbgpt/storage/schema.py +++ b/dbgpt/storage/schema.py @@ -20,6 +20,7 @@ class DBType(Enum): StarRocks = DbInfo("starrocks") Spark = DbInfo("spark", True) Doris = DbInfo("doris") + Hive = DbInfo("hive") def value(self): return self._value_.name diff --git a/setup.py b/setup.py index 4dee38809..3acdb9252 100644 --- a/setup.py +++ b/setup.py @@ -568,6 +568,9 @@ def all_datasource_requires(): "mysqlclient==2.1.0", "pydoris>=1.0.2,<2.0.0", "clickhouse-connect", + "pyhive", + "thrift", + "thrift_sasl", ] diff --git a/web/public/icons/hive.png b/web/public/icons/hive.png new file mode 100644 index 000000000..faf05f138 Binary files /dev/null and b/web/public/icons/hive.png differ diff --git a/web/utils/constants.ts b/web/utils/constants.ts index 327a3cd01..b5aa70ed9 100644 --- a/web/utils/constants.ts +++ b/web/utils/constants.ts @@ -64,5 +64,6 @@ export const dbMapper: Record