diff --git a/.github/workflows/build-and-push-latest-image.yml b/.github/workflows/build-and-push-latest-image.yml index 1f48a53..a20d937 100644 --- a/.github/workflows/build-and-push-latest-image.yml +++ b/.github/workflows/build-and-push-latest-image.yml @@ -50,3 +50,39 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + - name: Docker meta for website + id: meta-website + uses: docker/metadata-action@v4 + with: + images: | + sqlchat/sqlchat + flavor: | + latest=false + tags: | + type=raw,value=website-latest + + - name: Build and Push Website Image + id: docker_build_website + uses: docker/build-push-action@v3 + with: + context: ./ + file: ./Dockerfile.sqlchat-ai + platforms: linux/amd64 + push: true + tags: ${{ steps.meta-website.outputs.tags }} + labels: ${{ steps.meta-website.outputs.labels }} + + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@v1 + with: + credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }} + + - name: Get GKE credentials + uses: google-github-actions/get-gke-credentials@v1 + with: + cluster_name: ${{ secrets.GKE_CLUSTER_NAME }} + location: ${{ secrets.GKE_CLUSTER_LOCATION }} + + - name: Restart deployment + run: kubectl rollout restart deployment/sqlchat --namespace website diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 0000000..e8e8b28 --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,28 @@ +name: PR Checks + +on: + pull_request: + branches: [main] + +jobs: + lint-and-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install pnpm + run: npm install -g pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run lint + run: pnpm lint + + - name: Run build + run: pnpm build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c162736..ed91042 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM node:18-alpine AS base # Install dependencies only when needed FROM base AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. -RUN apk add --no-cache libc6-compat +RUN apk add --no-cache libc6-compat openssl openssl-dev WORKDIR /app COPY package.json pnpm-lock.yaml* ./ @@ -23,6 +23,9 @@ WORKDIR /app ENV NODE_ENV production +# Install OpenSSL for Prisma in production +RUN apk add --no-cache openssl + RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs diff --git a/README.es-ES.md b/README.es-ES.md index 6e9d9b0..ddf14e4 100644 --- a/README.es-ES.md +++ b/README.es-ES.md @@ -33,6 +33,7 @@ SQL Chat esta construido en [Next.js](https://nextjs.org/), admite las siguiente - PostgreSQL - MSSQL - TiDB Cloud +- OceanBase ## Privacidad de la Data diff --git a/README.md b/README.md index 34be030..b3c66b5 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ SQL Chat is built by [Next.js](https://nextjs.org/), it supports the following d - PostgreSQL - MSSQL - TiDB Cloud +- OceanBase ## [sqlchat.ai](https://sqlchat.ai) diff --git a/README.zh-CN.md b/README.zh-CN.md index ac531e4..2a83e10 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -30,6 +30,7 @@ SQL Chat 是由 [Next.js](https://nextjs.org/) 构建的,它支持以下数据 - PostgreSQL - MSSQL - TiDB Cloud +- OceanBase ## [sqlchat.ai](https://sqlchat.ai) diff --git a/docs/docker-connection-setting.webp b/docs/docker-connection-setting.webp index 5b6bca4..eeb88d0 100644 Binary files a/docs/docker-connection-setting.webp and b/docs/docker-connection-setting.webp differ diff --git a/public/db-oceanbase.png b/public/db-oceanbase.png new file mode 100644 index 0000000..be49a76 Binary files /dev/null and b/public/db-oceanbase.png differ diff --git a/src/components/CreateConnectionModal.tsx b/src/components/CreateConnectionModal.tsx index ca86643..e0844ab 100644 --- a/src/components/CreateConnectionModal.tsx +++ b/src/components/CreateConnectionModal.tsx @@ -59,6 +59,11 @@ const engines = [ name: "TiDB Serverless", defaultPort: "4000", }, + { + type: Engine.OceanBase, + name: "OceanBase", + defaultPort: "2881", + }, // { // type: Engine.Snowflake, // name: "Snowflake", diff --git a/src/components/EngineIcon.tsx b/src/components/EngineIcon.tsx index 197643a..e1587f4 100644 --- a/src/components/EngineIcon.tsx +++ b/src/components/EngineIcon.tsx @@ -17,6 +17,8 @@ const EngineIcon = (props: Props) => { return sqlserver; } else if (engine === Engine.TiDB) { return tidb; + } else if (engine === Engine.OceanBase) { + return oceanbase; } else { return ; } diff --git a/src/lib/connectors/index.ts b/src/lib/connectors/index.ts index a80708b..c883598 100644 --- a/src/lib/connectors/index.ts +++ b/src/lib/connectors/index.ts @@ -18,6 +18,8 @@ export const newConnector = (connection: Connection): Connector => { return postgres(connection); case Engine.MSSQL: return mssql(connection); + case Engine.OceanBase: + return mysql(connection); default: throw new Error("Unsupported engine type."); } diff --git a/src/types/connection.ts b/src/types/connection.ts index 22e38ed..b7bb64c 100644 --- a/src/types/connection.ts +++ b/src/types/connection.ts @@ -7,6 +7,7 @@ export enum Engine { TiDB = "TiDB", Snowflake = "SNOWFLAKE", Hive = "HIVE", + OceanBase = "OCEANBASE", } export interface SSLOptions {