Skip to content

Commit 2c51c37

Browse files
committed
Merge branch 'main' of https://github.com/dataease/SQLBot
2 parents 00df463 + 6310a24 commit 2c51c37

File tree

8 files changed

+26
-10
lines changed

8 files changed

+26
-10
lines changed

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ COPY g2-ssr/charts/* /app/charts/
4545

4646
RUN npm install
4747

48+
FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6
49+
ENV PG_PATH=/var/lib/postgresql/data
50+
ENV PG_SH=/usr/local/bin
51+
RUN mkdir -p ${PG_PATH}
52+
COPY --from=registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 ${PG_PATH} ${PG_PATH}
53+
COPY --from=registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 ${PG_SH} ${PG_SH}
54+
4855
# Runtime stage
4956
FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest
5057

backend/apps/db/db.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def check_connection(trans: Trans, ds: CoreDatasource, is_raise: bool = False):
156156

157157

158158
def get_version(ds: CoreDatasource | AssistantOutDsSchema):
159+
version = ''
159160
conf = None
160161
if isinstance(ds, CoreDatasource):
161162
conf = DatasourceConf(
@@ -176,26 +177,27 @@ def get_version(ds: CoreDatasource | AssistantOutDsSchema):
176177
with get_session(ds) as session:
177178
with session.execute(text(sql)) as result:
178179
res = result.fetchall()
179-
return res[0][0]
180+
version = res[0][0]
180181
else:
181182
if ds.type == 'dm':
182183
with dmPython.connect(user=conf.username, password=conf.password, server=conf.host,
183184
port=conf.port) as conn, conn.cursor() as cursor:
184185
cursor.execute(sql, timeout=10)
185186
res = cursor.fetchall()
186-
return res[0][0]
187+
version = res[0][0]
187188
elif ds.type == 'doris':
188189
with pymysql.connect(user=conf.username, passwd=conf.password, host=conf.host,
189190
port=conf.port, db=conf.database, connect_timeout=10,
190191
read_timeout=10) as conn, conn.cursor() as cursor:
191192
cursor.execute(sql)
192193
res = cursor.fetchall()
193-
return res[0][0]
194+
version = res[0][0]
194195
elif ds.type == 'redshift':
195-
return ''
196+
version = ''
196197
except Exception as e:
197198
print(e)
198-
return ''
199+
version = ''
200+
return version.decode() if isinstance(version, bytes) else version
199201

200202

201203
def get_schema(ds: CoreDatasource):

frontend/src/entity/supplier.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ export const supplierList: Array<{
122122
model_options: [
123123
{
124124
name: '4.0Ultra',
125-
args: [{ key: 'max_tokens', val: 32768, type: 'number', range: '[1, 32768]' }],
125+
args: [
126+
{ key: 'temperature', val: 0.5, type: 'number', range: '[0, 1]' },
127+
{ key: 'max_tokens', val: 8192, type: 'number', range: '[1, 8192]' },
128+
],
129+
api_domain: 'https://spark-api-open.xf-yun.com/v1/',
126130
},
127131
/* {
128132
name: 'generalv3.5',
@@ -163,7 +167,7 @@ export const supplierList: Array<{
163167
model_config: {
164168
0: {
165169
api_domain: 'https://generativelanguage.googleapis.com/v1beta/openai/',
166-
common_args: [{ key: 'temperature', val: 1.0, type: 'number', range: '[0, 2]' }],
170+
common_args: [{ key: 'temperature', val: 0.7, type: 'number', range: '(0, 1]' }],
167171
model_options: [
168172
{ name: 'gemini-2.5-pro' },
169173
{ name: 'gemini-2.5-flash' },

frontend/src/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
"database": "Database",
221221
"connect_mode": "Connect Mode",
222222
"service_name": "Service Name",
223-
"extra_jdbc": "Extra JDBC String",
223+
"extra_jdbc": "Extra Config",
224224
"schema": "Schema",
225225
"get_schema": "Get Schema",
226226
"file": "File",

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
"database": "数据库",
221221
"connect_mode": "连接方式",
222222
"service_name": "服务名",
223-
"extra_jdbc": "额外的 JDBC 连接字符串",
223+
"extra_jdbc": "额外的数据库连接配置",
224224
"schema": "模式",
225225
"get_schema": "获取模式",
226226
"file": "文件",

installer/install.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SQLBOT_MCP_PORT=8001
99
## 是否使用外部数据库
1010
SQLBOT_EXTERNAL_DB=false
1111
## 数据库地址
12-
SQLBOT_DB_HOST=sqlbot-db
12+
SQLBOT_DB_HOST=localhost
1313
## 数据库端口 (仅使用外部数据库时才生效)
1414
SQLBOT_DB_PORT=5432
1515
## SQLBot 数据库库名

installer/sqlbot/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ services:
88
ports:
99
- ${SQLBOT_WEB_PORT}:8000
1010
- ${SQLBOT_MCP_PORT}:8001
11+
- 5432:5432
1112
env_file:
1213
- conf/sqlbot.conf
1314
volumes:
1415
- ./data/sqlbot/excel:/opt/sqlbot/data/excel
1516
- ./data/sqlbot/images:/opt/sqlbot/images
1617
- ./data/sqlbot/logs:/opt/sqlbot/logs
18+
- ./data/postgresql:/var/lib/postgresql/data
1719
depends_on:
1820
sqlbot-db:
1921
condition: service_healthy

start.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SSR_PATH=/opt/sqlbot/g2-ssr
22
APP_PATH=/opt/sqlbot/app
3+
docker-entrypoint.sh postgres
34
nohup node $SSR_PATH/app.js &
45

56
nohup uvicorn main:mcp_app --host 0.0.0.0 --port 8001 &

0 commit comments

Comments
 (0)