feat: add OceanBase support (#180)

* Add Oceanbase support

* Modify screenshot

* Modify the README document
This commit is contained in:
Liam
2025-06-17 11:19:08 +08:00
committed by GitHub
parent efb2333d33
commit 610980d70c
9 changed files with 13 additions and 0 deletions

View File

@ -33,6 +33,7 @@ SQL Chat esta construido en [Next.js](https://nextjs.org/), admite las siguiente
- PostgreSQL - PostgreSQL
- MSSQL - MSSQL
- TiDB Cloud - TiDB Cloud
- OceanBase
## Privacidad de la Data ## Privacidad de la Data

View File

@ -33,6 +33,7 @@ SQL Chat is built by [Next.js](https://nextjs.org/), it supports the following d
- PostgreSQL - PostgreSQL
- MSSQL - MSSQL
- TiDB Cloud - TiDB Cloud
- OceanBase
## [sqlchat.ai](https://sqlchat.ai) ## [sqlchat.ai](https://sqlchat.ai)

View File

@ -30,6 +30,7 @@ SQL Chat 是由 [Next.js](https://nextjs.org/) 构建的,它支持以下数据
- PostgreSQL - PostgreSQL
- MSSQL - MSSQL
- TiDB Cloud - TiDB Cloud
- OceanBase
## [sqlchat.ai](https://sqlchat.ai) ## [sqlchat.ai](https://sqlchat.ai)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 133 KiB

BIN
public/db-oceanbase.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -59,6 +59,11 @@ const engines = [
name: "TiDB Serverless", name: "TiDB Serverless",
defaultPort: "4000", defaultPort: "4000",
}, },
{
type: Engine.OceanBase,
name: "OceanBase",
defaultPort: "2881",
},
// { // {
// type: Engine.Snowflake, // type: Engine.Snowflake,
// name: "Snowflake", // name: "Snowflake",

View File

@ -17,6 +17,8 @@ const EngineIcon = (props: Props) => {
return <img src="/db-sqlserver.png" className={className} alt="sqlserver" />; return <img src="/db-sqlserver.png" className={className} alt="sqlserver" />;
} else if (engine === Engine.TiDB) { } 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 if (engine === Engine.OceanBase) {
return <img src="/db-oceanbase.png" className={className} alt="oceanbase" />;
} else { } else {
return <Icon.DiDatabase className={className} />; return <Icon.DiDatabase className={className} />;
} }

View File

@ -18,6 +18,8 @@ export const newConnector = (connection: Connection): Connector => {
return postgres(connection); return postgres(connection);
case Engine.MSSQL: case Engine.MSSQL:
return mssql(connection); return mssql(connection);
case Engine.OceanBase:
return mysql(connection);
default: default:
throw new Error("Unsupported engine type."); throw new Error("Unsupported engine type.");
} }

View File

@ -7,6 +7,7 @@ export enum Engine {
TiDB = "TiDB", TiDB = "TiDB",
Snowflake = "SNOWFLAKE", Snowflake = "SNOWFLAKE",
Hive = "HIVE", Hive = "HIVE",
OceanBase = "OCEANBASE"
} }
export interface SSLOptions { export interface SSLOptions {