mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-28 02:24:49 +08:00
chore: change tidbserverless engine type to TiDB
engine type should not be specific to product line
This commit is contained in:
@ -55,7 +55,7 @@ const engines = [
|
|||||||
defaultPort: "1433",
|
defaultPort: "1433",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: Engine.TiDBServerless,
|
type: Engine.TiDB,
|
||||||
name: "TiDB Serverless",
|
name: "TiDB Serverless",
|
||||||
defaultPort: "4000",
|
defaultPort: "4000",
|
||||||
},
|
},
|
||||||
@ -310,7 +310,7 @@ const CreateConnectionModal = (props: Props) => {
|
|||||||
onChange={(value) => setPartialConnection({ password: value })}
|
onChange={(value) => setPartialConnection({ password: value })}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{connection.engineType === Engine.TiDBServerless ? (
|
{connection.engineType === Engine.TiDB ? (
|
||||||
<div className="w-full flex flex-col">
|
<div className="w-full flex flex-col">
|
||||||
<label className="block text-sm font-medium text-gray-700 mb-1">{t("connection.tidb-serverless-ssl-hint")}</label>
|
<label className="block text-sm font-medium text-gray-700 mb-1">{t("connection.tidb-serverless-ssl-hint")}</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,7 +15,7 @@ const EngineIcon = (props: Props) => {
|
|||||||
return <img src="/db-postgres.png" className={className} alt="postgres" />;
|
return <img src="/db-postgres.png" className={className} alt="postgres" />;
|
||||||
} else if (engine === Engine.MSSQL) {
|
} else if (engine === Engine.MSSQL) {
|
||||||
return <img src="/db-sqlserver.png" className={className} alt="sqlserver" />;
|
return <img src="/db-sqlserver.png" className={className} alt="sqlserver" />;
|
||||||
} else if (engine === Engine.TiDBServerless) {
|
} else if (engine === Engine.TiDB) {
|
||||||
return <img src="/db-tidb.png" className={className} alt="tidb" />;
|
return <img src="/db-tidb.png" className={className} alt="tidb" />;
|
||||||
} else {
|
} else {
|
||||||
return <Icon.DiDatabase className={className} />;
|
return <Icon.DiDatabase className={className} />;
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"password": "Password",
|
"password": "Password",
|
||||||
"empty-select": "clear selection",
|
"empty-select": "clear selection",
|
||||||
"select-all": "select all",
|
"select-all": "select all",
|
||||||
"tidb-serverless-ssl-hint": "SSL is required and configured"
|
"tidb-serverless-ssl-hint": "SSL is enabled by default"
|
||||||
},
|
},
|
||||||
"prompt": {
|
"prompt": {
|
||||||
"self": "Prompt",
|
"self": "Prompt",
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
"empty-select": "limpiar selección",
|
"empty-select": "limpiar selección",
|
||||||
"select-all": "seleccionar todo",
|
"select-all": "seleccionar todo",
|
||||||
"total-token": "Tokens",
|
"total-token": "Tokens",
|
||||||
"tidb-serverless-ssl-hint": "SSL es requerido y configurado",
|
"tidb-serverless-ssl-hint": "SSL está habilitado de forma predeterminada",
|
||||||
"select-table": "Selecciona tu tabla",
|
"select-table": "Selecciona tu tabla",
|
||||||
"select-schema": "Selecciona tu Esquema",
|
"select-schema": "Selecciona tu Esquema",
|
||||||
"all-tables": "Todas las Tablas"
|
"all-tables": "Todas las Tablas"
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
"database-name": "数据库",
|
"database-name": "数据库",
|
||||||
"username": "用户名",
|
"username": "用户名",
|
||||||
"password": "密码",
|
"password": "密码",
|
||||||
"tidb-serverless-ssl-hint": "必需SSL且已配置"
|
"tidb-serverless-ssl-hint": "SSL 默认已开启"
|
||||||
},
|
},
|
||||||
"prompt": {
|
"prompt": {
|
||||||
"view": "提示词",
|
"view": "提示词",
|
||||||
|
@ -13,7 +13,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let connection = req.body.connection as Connection;
|
let connection = req.body.connection as Connection;
|
||||||
if (connection.engineType === Engine.TiDBServerless) {
|
if (connection.engineType === Engine.TiDB) {
|
||||||
connection = changeTiDBConnectionToMySQL(connection);
|
connection = changeTiDBConnectionToMySQL(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let connection = req.body.connection as Connection;
|
let connection = req.body.connection as Connection;
|
||||||
if (connection.engineType === Engine.TiDBServerless) {
|
if (connection.engineType === Engine.TiDB) {
|
||||||
connection = changeTiDBConnectionToMySQL(connection);
|
connection = changeTiDBConnectionToMySQL(connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let connection = req.body.connection as Connection;
|
let connection = req.body.connection as Connection;
|
||||||
if (connection.engineType === Engine.TiDBServerless) {
|
if (connection.engineType === Engine.TiDB) {
|
||||||
connection = changeTiDBConnectionToMySQL(connection);
|
connection = changeTiDBConnectionToMySQL(connection);
|
||||||
}
|
}
|
||||||
const db = req.body.db as string;
|
const db = req.body.db as string;
|
||||||
|
@ -13,7 +13,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let connection = req.body.connection as Connection;
|
let connection = req.body.connection as Connection;
|
||||||
if (connection.engineType === Engine.TiDBServerless) {
|
if (connection.engineType === Engine.TiDB) {
|
||||||
connection = changeTiDBConnectionToMySQL(connection);
|
connection = changeTiDBConnectionToMySQL(connection);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -4,7 +4,7 @@ export enum Engine {
|
|||||||
MySQL = "MYSQL",
|
MySQL = "MYSQL",
|
||||||
PostgreSQL = "POSTGRESQL",
|
PostgreSQL = "POSTGRESQL",
|
||||||
MSSQL = "MSSQL",
|
MSSQL = "MSSQL",
|
||||||
TiDBServerless = "TiDBServerless",
|
TiDB = "TiDB",
|
||||||
Snowflake = "SNOWFLAKE",
|
Snowflake = "SNOWFLAKE",
|
||||||
Hive = "HIVE",
|
Hive = "HIVE",
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import { Connection } from "@/types";
|
|||||||
import { Engine } from "@/types/connection";
|
import { Engine } from "@/types/connection";
|
||||||
|
|
||||||
export const changeTiDBConnectionToMySQL = (connection: Connection) => {
|
export const changeTiDBConnectionToMySQL = (connection: Connection) => {
|
||||||
if (connection.engineType === Engine.TiDBServerless) {
|
if (connection.engineType === Engine.TiDB) {
|
||||||
return {
|
return {
|
||||||
...connection,
|
...connection,
|
||||||
engineType: Engine.MySQL,
|
engineType: Engine.MySQL,
|
||||||
|
Reference in New Issue
Block a user