GithubHelp home page GithubHelp logo

sqlchat / sqlchat Goto Github PK

View Code? Open in Web Editor NEW
4.5K 30.0 401.0 1.89 MB

Chat-based SQL Client and Editor for the next decade

Home Page: https://sqlchat.ai

License: Other

TypeScript 98.77% CSS 0.49% JavaScript 0.26% Dockerfile 0.48%
chatgpt mysql openai postgres sql sqlclient sqleditor clickhouse cockroachdb oracle

sqlchat's Introduction

SQL Chat banner

SQL Chat

vercel
RepoCloud

English | 中文 | Español

What

SQL Chat is a chat-based SQL client, which uses natural language to communicate with the database to implement operations such as query, modification, addition, and deletion of the database.

Screenshot

Screenshot

Screenshot

Why

As we enter the Developer Tools 2.0 era, there is a massive opportunity to rebuild the existing tools using the chat-based interface. SQL Client is no exception. Instead of navigating across many UI controls, a chat-based interface is much more intuitive. Of course, only if that works, and our goal is to deliver that experience.

How

SQL Chat is built by Next.js, it supports the following databases and will add more over time:

  • MySQL
  • PostgreSQL
  • MSSQL
  • TiDB Cloud

IP Whitelisting

If you use sqlchat.ai to connect to your database, you need to add 0.0.0.0 (allow all connections) to the database whitelist IP. Because sqlchat.AI is hosted on Vercel which uses dynamic IP. If this is a concern, please consider the self-host option below.

Data Privacy

See SQL Chat Privacy Policy.

Self-host

Docker

If you just want to run for your own use, supply the following options:

  • NEXTAUTH_SECRET
  • OPENAI_API_KEY
docker run --name sqlchat --platform linux/amd64 --env NEXTAUTH_SECRET="$(openssl rand -hex 5)" --env OPENAI_API_KEY=<<YOUR OPENAI KEY>> -p 3000:3000 --hostname localhost sqlchat/sqlchat
  • Pass an arbitrary string to NEXTAUTH_SECRET otherwise next-auth will complain.
  • If you chat to the database on the same host, you need to use host.docker.internal as the host in the database connection setting.

Startup options

TL;DR

  • If you just want to use for yourself, then run without database. Check .env.nodb.
  • If you want to offer a similar service as sqlchat.ai, then run with database, check .env.usedb. The database is used to store account, usage info.

OpenAI related

  • OPENAI_API_KEY: OpenAI API key. You can get one from here.

  • OPENAI_API_ENDPOINT: OpenAI API endpoint. Defaults to https://api.openai.com. Use Ollama to set up self-host AI model and set the endpoint to it.

  • NEXT_PUBLIC_ALLOW_SELF_OPENAI_KEY: Set to true to allow users to bring their own OpenAI API key.

Database related

  • NEXT_PUBLIC_USE_DATABASE: Set to true to start SQL Chat with database. This will enable following features:
    1. Account system.
    2. Per-user quota enforcement.
    3. Payment.
    4. Usage data collection.
  • DATABASE_URL: Applicable if NEXT_PUBLIC_USE_DATABASE is true. Postgres connection string to store data. e.g. postgresql://postgres:YOUR_PASSWORD@localhost:5432/sqlchat?schema=sqlchat.

Local Development

  1. Install dependencies

    pnpm i
  2. Generate prisma client

    pnpm prisma generate
  3. Make a copy of the example environment variables file:

    cp .env.usedb .env
  4. Add your API key and OpenAI API Endpoint(optional) to the newly created .env file.

Setup database

You can skip this section with NEXT_PUBLIC_USE_DATABASE=false if you don't build features requiring database

  1. Start a Postgres instance. For mac, you can use StackbBricks, DBngin or Postgres.app.

  2. Create a database:

    CREATE DATABASE sqlchat;

    In .env file, assign the connection string to environment variable DATABASE_URL and DATABASE_DIRECT_URL. This article explains why we need two URLs.

  3. Set up database schema

    pnpm prisma migrate dev
  4. (Optional) Seed data

    pnpm prisma db seed

Star History

Star History Chart

Community

Hang out on Discord

Follow us on Twitter

sqlchat

Sponsors

License

This project is under the BSL License. See the LICENSE file for the full license text.

Common Error Message

Please sign up to get free quota

See this issue.

You exceeded your current quota, please check your plan and billing details

openai quota

Your OpenAI Key has run out of quota. Please check your OpenAI account.

Failed to request message, please check your network

network error

Please make sure you have a stable network connection which can access the OpenAI API endpoint.

ping api.openai.com

If you cannot access the OpenAI API endpoint, you can try to set the OPENAI_API_ENDPOINT in UI or environment variable.

sqlchat's People

Contributors

akrista avatar alitrack avatar boojack avatar correctroadh avatar cosark avatar ddzyan avatar emostar avatar evanlong0803 avatar jaberwiki avatar lushenle avatar techdjinn avatar tianzhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sqlchat's Issues

docker build fail

Describe the bug

docker

docker build -f Dockerfile .

fail

controlplane $ docker build -f Dockerfile .
Sending build context to Docker daemon  757.2kB
Step 1/23 : FROM node:18-alpine AS base
 ---> 6f44d13dd258
Step 2/23 : FROM base AS deps
 ---> 6f44d13dd258
Step 3/23 : RUN apk add --no-cache libc6-compat
 ---> Using cache
 ---> affc55441cd0
Step 4/23 : WORKDIR /app
 ---> Using cache
 ---> 9f88824587e2
Step 5/23 : COPY package.json pnpm-lock.yaml* ./
 ---> Using cache
 ---> 54a3b16a8297
Step 6/23 : RUN yarn global add pnpm && pnpm i --frozen-lockfile
 ---> Using cache
 ---> 6b79292d428e
Step 7/23 : FROM base AS builder
 ---> 6f44d13dd258
Step 8/23 : WORKDIR /app
 ---> Using cache
 ---> a34ba94dcf05
Step 9/23 : COPY --from=deps /app/node_modules ./node_modules
 ---> Using cache
 ---> c5746f7295e1
Step 10/23 : COPY . .
 ---> Using cache
 ---> 2c0423a4e011
Step 11/23 : RUN yarn run docker-build
 ---> Running in cd9ce44845e1
yarn run v1.22.19
$ prisma generate && prisma migrate deploy && next build
Prisma schema loaded from prisma/schema.prisma

✔ Generated Prisma Client (4.13.0 | library) to ./node_modules/.pnpm/@[email protected][email protected]/node_modules/@prisma/client in 101ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client

import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

Prisma schema loaded from prisma/schema.prisma
Datasource "db": PostgreSQL database

Error: Prisma schema validation - (get-config wasm)
Error code: P1012
error: Environment variable not found: USAGE_DATABASE_URL.
  -->  schema.prisma:10
   | 
 9 |   provider = "postgresql"
10 |   url      = env("USAGE_DATABASE_URL")
   | 

Validation Error Count: 1
[Context: getConfig]

Prisma CLI Version : 4.13.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command '/bin/sh -c yarn run docker-build' returned a non-zero code: 1

To reproduce

docker build -f Dockerfile .

Additional context

No response

discuss: How to support Schema for PostgreSQL

🤔 Support Schema for PostgreSQL.
solution 1.

  • add a schema variable(only for postgres) to connection state
  • add an optional function to get or fetch schema
  • add an optional params(schema name) to getTables in Postgres.👀

How to reasonably abstract and polymorphism is a difficult problem.👀

Solution 2.
Refactor connectors. make it like bytebase.🤔 I think the latter solution is very powerful. It may support more features in the future. But it is too big.

I am reading the code of bytebase. Its architecture is very nice🤔 I like it.
It may didn't suit SQL Chat. the arch of bytebase is very powerful but not simple👀 what does SQL Chat need? simple or featureful?

好像有点问题

Describe the bug

排序不太对

To reproduce

image

Additional context

No response

Support to select ChatGLM-6b as chat model

Is your feature request related to a problem?

这是一个非常棒的项目,请问能否添加对chatglm-6B的支持

Describe the solution you'd like

chatglm-6B官方有API服务的功能,能否支持chatglm-6B呢?

Additional context

No response

change assistant didn't working

Describe the bug

change assistant didn't working, the assistant is old unless to update view manually

CleanShot 2023-04-20 at 19 55 37@2x

To reproduce

change assistant

Additional context

I already fix it, just need an issue to ref in PR.👀 the fix PR will come!

failed to access the OpenAI API: invalid_request_error

[root@rdsdev sqlchat]# pnpm dev

sqlchat@ dev /home/app/sqlchat
next dev

warn - Port 3000 is in use, trying 3001 instead.
ready - started server on 0.0.0.0:3001, url: http://localhost:3001
info - Loaded env from /home/app/sqlchat/.env
event - compiled client and server successfully in 6.7s (184 modules)
wait - compiling /_error (client and server)...
event - compiled client and server successfully in 1863 ms (185 modules)
warn - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
wait - compiling / (client and server)...
event - compiled client and server successfully in 3s (2906 modules)
wait - compiling /api/chat (client and server)...
event - compiled successfully in 514 ms (66 modules)

error - pages/api/chat.ts (11:23) @ fetch
error - fetch failed
9 | const handler = async (req: NextRequest) => {
10 | const reqBody = await req.json();

11 | const rawRes = await fetch(https://api.openai.com/v1/chat/completions, {
| ^
12 | headers: {
13 | "Content-Type": "application/json",
14 | Authorization: Bearer ${openAIApiKey},

Copy to clipboard not working

Describe the bug

我用docker部署的,或者是我用nginx代理https://www.sqlchat.ai/的,都不能使用复制功能。

To reproduce

浏览器报错信息如下:
Uncaught TypeError: Cannot read properties of undefined (reading 'writeText')
at f (699.f0bb0a7d606b128c.js:1:7508)
at 58.f549a9ce3638af24.js:1:4539
at Object.eU (framework-281bd828f4ecdac7.js:9:14914)
at eH (framework-281bd828f4ecdac7.js:9:15068)
at framework-281bd828f4ecdac7.js:9:33376
at re (framework-281bd828f4ecdac7.js:9:33475)
at rn (framework-281bd828f4ecdac7.js:9:33889)
at framework-281bd828f4ecdac7.js:9:39347
at oP (framework-281bd828f4ecdac7.js:9:96347)
at eF (framework-281bd828f4ecdac7.js:9:14048)
追踪到语句:navigator.clipboard.writeText(s.content),
执行navigator.clipboard返回undefined

Additional context

No response

Support azure openai API

Is your feature request related to a problem?

azure 的openai的模型,跟原生的openai的模型参数基本一致的,我尝试修改了下 src/utils/model.ts,发现不好使,可能还是少了api_type和api_version两个参数
图片

请大神看看能否修改代码以支持。

Describe the solution you'd like

通过修改源码,支持azure openai

Additional context

No response

Support for JSONB schemas

Is your feature request related to a problem?

Not being able to define jsonb schemas means I can't really use it effectively for my daily job.

Describe the solution you'd like

SQLChat remembering the schema of jsonb columns.

Additional context

No response

Support GPT 4.0

Is your feature request related to a problem?

目前用的是 gpt3.5 吧?如果我想改成 4,在哪里可以更改?

Describe the solution you'd like

界面添加也行,或者配置文件在哪,谢谢。

Additional context

No response

prompt optmization

Is your feature request related to a problem?

每当我在我的某一个数据库下面提问时,sqlchat都会带上该数据库的中数据表的schema信息,但是由于chatGPT有询问max_tokens限制,导致当该数据库下面表信息过多时,无法进行正确的提问。

Describe the solution you'd like

是否可以进行某些优化来解决这一问题,比如将数据库进行更细粒度控制,在界面上可以勾选某一数据库下面的某一些表,然后再根据该一个或者多个表进行提问,这样prompt会显得更短

Additional context

No response

update SQL statement of message after SQL be changed in Execute SQL

Is your feature request related to a problem?

🤔 SQL chat generates a wrong SQL statement. I correct it in "Execute SQL". I need to correct it again when the next time I open "Execute SQL".

Describe the solution you'd like

sync the change from "Execute SQL" to message history.

Additional context

No response

Network problem, failed to connect to Open AI server

Describe the bug

1.git clone splchat项目下来
2.添加.env文件,输入api key,OPENAI_API_KEY= XXXX
2.pnpm i && pnpm dev
3.进入localhost:3000,打开项目后,正常聊天,显示500网络失败;左下角setting弹窗里面添加过自己的key之后也失败

背景: 网络环境ok,postman测试https://api.openai.com/v1/chat/completions接口正常使用

网络信息:
Request URL: http://localhost:3000/api/chat
Request Method: POST
Status Code: 500 Internal Server Error
Remote Address: [::1]:3000
Referrer Policy: strict-origin-when-cross-origin
Cache-Control: no-store, must-revalidate
Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Date: Wed, 19 Apr 2023 03:22:49 GMT
ETag: "ofxhq550gm2rz"
Keep-Alive: timeout=5
Transfer-Encoding: chunked
Vary: Accept-Encoding
X-Powered-By: Next.js
Accept: /
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Connection: keep-alive
Content-Length: 1588
Content-Type: text/plain;charset=UTF-8
Host: localhost:3000
Origin: http://localhost:3000
Referer: http://localhost:3000/

To reproduce

Additional context

No response

vercel deployment

Is your feature request related to a problem?

add vercel deployment button and feature

Describe the solution you'd like

add vercel deployment button and feature

Additional context

No response

Response Issue with quota exceeded

Describe the bug

You exceeded your current quota, please check your plan and billing details.

To reproduce

You exceeded your current quota, please check your plan and billing details.

Additional context

No response

Support pg choose schema.

Is your feature request related to a problem?

When use postgres,the code just select pubilc schema.

Describe the solution you'd like

Connection need provide a choice for schema.

Additional context

No response

ClickHouse support

Is your feature request related to a problem?

I wan't to ask my ClickHouse databases in natural language

Describe the solution you'd like

Just add support for ClickHouse Database in your great product

Additional context

No response

Type error: Namespace '.............Prisma' has no exported member 'ChatCreateInput'.

Describe the bug

when clone the repo and run docker build -f Dockerfile . return following error, seems use a non-existing method, any solution?
=> ERROR [builder 4/4] RUN yarn run build 53.5s

[builder 4/4] RUN yarn run build:
#15 4.866 yarn run v1.22.19
#15 5.103 $ next build
#15 8.156 Attention: Next.js now collects completely anonymous telemetry regarding usage.
#15 8.160 This information is used to shape Next.js' roadmap and prioritize features.
#15 8.160 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
#15 8.160 https://nextjs.org/telemetry
#15 8.162
#15 8.885 info - Linting and checking validity of types...
#15 53.06 Failed to compile.
#15 53.06
#15 53.06 ./prisma/seed.ts:6:24
#15 53.06 Type error: Namespace '"/app/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/.prisma/client/index".Prisma' has no exported member 'ChatCreateInput'.
#15 53.06
#15 53.06 4 | const prisma = new PrismaClient();
#15 53.06 5 |
#15 53.06 > 6 | const chatData: Prisma.ChatCreateInput[] = [
#15 53.06 | ^
#15 53.06 7 | {
#15 53.06 8 | id: uuidv4(),
#15 53.06 9 | createdAt: new Date(),
#15 53.27 error Command failed with exit code 1.
#15 53.27 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.


executor failed running [/bin/sh -c yarn run build]: exit code: 1

To reproduce

  1. clone the repo (at branch main)
  2. docker build -f Dockerfile .

in a mac environment (intel cpu)

Additional context

No response

Support SQLite3

Is your feature request related to a problem?

话说你们这个开源软件支持sqlite3么,另外,docker-compose.yml能不能提供一份给我,我就不自己写了

Describe the solution you'd like

话说你们这个开源软件支持sqlite3么,另外,docker-compose.yml能不能提供一份给我,我就不自己写了

Additional context

话说你们这个开源软件支持sqlite3么,另外,docker-compose.yml能不能提供一份给我,我就不自己写了

Dockerize repository for improved deployment experience

Is your feature request related to a problem?

It would be beneficial to have a Docker image available in the repository to simplify and streamline the deployment process.

Describe the solution you'd like

The Docker image would make it easier for users to deploy the repository with minimal setup and configuration, saving time and effort.

Additional context

No response

How to deploy on Railway?

If I clone it, create a new repository, and deploy the repository on Railway, there will be bugs. Is there a way to deploy it on Railway?

system versioned tables in mariadb not recognized

Describe the bug

I have a schema where some tables have SYSTEM VERSION turned on - sqlchat seems to not see these tables at all. When I ask him to show schema it shows just the tables without versioning.

To reproduce

CREATE TABLE test (
id INT PRIMARY KEY,
name VARCHAR(50),
age INT,
salary DECIMAL(10,2),
period_start DATE,
period_end DATE

) WITH SYSTEM VERSIONING;

create new chat window, ask to describe schema

Additional context

No response

set the default port when creating a connection

Is your feature request related to a problem?

👀 when creating a connection, all option needs to be input. I think it would be more convenient to have a default port.

Describe the solution you'd like

to set a default port when selecting a Database type.

Additional context

No response

Cache the Database Schema

Is your feature request related to a problem?

SQL Chat always refetch the Database Schema in every chat. It is very very slow!

Describe the solution you'd like

Solution 1. cache Database Schema in the background when the system is free or startup. I think the way is faster for using🤔
Solution 2. call getOrFetchDatabaseSchema to cache Database Schema like getOrFetchDatabaseList. I think the solution is very easy to implement.

Additional context

No response

我希望sqlchat能增加两个新特性,可以大大提升用户体验 (I hope that SQLChat can add two new features, which can greatly enhance the user experience.)

Is your feature request related to a problem?

我每次问它问题,它都要反问我你的数据库模式是啥?表名是啥?重复的问题很浪费时间。
Every time I ask it a question, it always asks me back what my database schema is and what the table name is. It's very time-consuming to deal with repetitive questions like that.

Describe the solution you'd like

一是可以自定义保存多个提示词,类似现在很多chatgpt web项目那样,因为现在gpt3.5是没有记忆的,我每次问问题,它都要反问我你的数据库模式是啥?表名是啥?我想在提示词里固化这些信息。这样会方便很多。
One is the ability to customize and save multiple prompts, similar to many chatbot web projects nowadays. Because GPT3.5 currently has no memory, every time I ask a question it asks me back about my database schema and table names. I want to solidify this information in the prompts so that it will be more convenient.

二是,跳过手工点执行那步,生成完信息直接执行,我可以在执行结果之后再做调整,手动点一下执行没意义。然后执行结果可以提供导出csv,感谢。
The second point is to skip the manual execution step and directly execute after generating the information. I can make adjustments after seeing the execution results, so manually clicking on execution is meaningless. Then, the execution results can be exported as a CSV file. Thank you.

Additional context

No response

make Select component scrollable

Is your feature request related to a problem?

👀 When the num of databases is very much, some databases can't be select.
CleanShot 2023-04-23 at 15 08 21@2x

Describe the solution you'd like

  • make Select component scrollable

Additional context

No response

mssql didn't have table struct

Describe the bug

when connecting mssql. the struct of the tableList didn't have column struct

image

To reproduce

connect a mssql and look local storage

Additional context

docker mssql latest

Support OLAP database like ClickHouse

Is your feature request related to a problem?

目前Connector支持的三种均为TP数据库,后续是否有计划新增对Clickhouse这类AP数据库的支持

Describe the solution you'd like

Additional context

No response

add button to update database of connection manually

Is your feature request related to a problem?

When I add some databases to the database👀 the database of Select didn't update. Regardless I to change the connection or relaunch the browser, the config didn't refetch. Unless changing the config of the connection.
So I think adding a button to update the database is a good idea.

Describe the solution you'd like

add a button to refetch the database of connection.

Additional context

No response

Can't fetch database Schema

Describe the bug

when sending a message with a database containing 180+ schema. the request didn't response and backend throw error

error - unhandledRejection: Error: Too many connections
    at Object.createConnection (/Users/ctrdh/Code/sqlchat/node_modules/.pnpm/[email protected]/node_modules/mysql2/promise.js:252:31)
    at getMySQLConnection (webpack-internal:///(api)/./src/lib/connectors/mysql/index.ts:29:78)
    at getTableStructure (webpack-internal:///(api)/./src/lib/connectors/mysql/index.ts:82:24)
    at Object.getTableStructure (webpack-internal:///(api)/./src/lib/connectors/mysql/index.ts:96:73)
    at eval (webpack-internal:///(api)/./src/pages/api/connection/db_schema.ts:26:71)
    at Array.map (<anonymous>)
    at handler (webpack-internal:///(api)/./src/pages/api/connection/db_schema.ts:26:38)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.apiResolver (/Users/ctrdh/Code/sqlchat/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/api-utils/node.js:372:9)
    at async DevServer.runApi (/Users/ctrdh/Code/sqlchat/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js:514:9)
    at async Object.fn (/Users/ctrdh/Code/sqlchat/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js:828:35)
    at async Router.execute (/Users/ctrdh/Code/sqlchat/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/router.js:243:32)
    at async DevServer.runImpl (/Users/ctrdh/Code/sqlchat/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:432:29)
    at async DevServer.run (/Users/ctrdh/Code/sqlchat/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/dev/next-dev-server.js:831:20)
    at async DevServer.handleRequestImpl (/Users/ctrdh/Code/sqlchat/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:375:20)
    at async /Users/ctrdh/Code/sqlchat/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/base-server.js:157:99 {
  code: 'ER_CON_COUNT_ERROR',
  errno: 1040,
  sqlState: ''
}

🤔 the limit is decided in max_connections of MySQL, So the difference config might not trigger the bug.

show variables like 'max_connections';

To reproduce

send message and select database containing multiple schema

Additional context

No response

Can't generate correctly query statement

Describe the bug

SQL chat generates wrong SQL statements by its own guesswork

SQL chat:
CleanShot 2023-04-22 at 11 04 17@2x

Correctly Table Struct:
CleanShot 2023-04-22 at 11 06 40@2x

Reason:
SQL chat didn't transfer the full table struct to OpneAi.

Solution:
case 1. Transfer full table struct. but the cost is too expensive!
case 2. Transfer the corresponding table structure as prompt.
case 2.1 User to choose table manually.
case 2.2 System to find the correct table by ai.

To reproduce

give SQL chat a big database and ask to generate a query statement.

Additional context

No response

Token Limitation

Is your feature request related to a problem?

For some complex tables, the structure information of the table exceeds the token limit, the conversation could not proceed and gpt continuously returns incorrect and incomplete content. What are the solutions to this problem?

Describe the solution you'd like

Solve the token limitation problem.

Additional context

No response

Connector for MSSQL

Is your feature request related to a problem?

How to connect to MSSQL?

Describe the solution you'd like

Need connector for MSSQL?

Additional context

No response

installdocker

Describe the bug

Listening on port 3000 url: http://9f360ba7399b:3000
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
at new PrismaClient (/app/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/.prisma/client/index.js:3:11)
at 2415 (/app/.next/server/chunks/415.js:18:16)
at webpack_require (/app/.next/server/webpack-api-runtime.js:25:42)
at 639 (/app/.next/server/chunks/639.js:26:77)
at webpack_require (/app/.next/server/webpack-api-runtime.js:25:42)
at webpack_exec (/app/.next/server/pages/api/auth/[...nextauth].js:56:39)
at /app/.next/server/pages/api/auth/[...nextauth].js:57:70
at webpack_require.X (/app/.next/server/webpack-api-runtime.js:177:21)
at /app/.next/server/pages/api/auth/[...nextauth].js:57:47
at Object. (/app/.next/server/pages/api/auth/[...nextauth].js:60:3)
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
at new PrismaClient (/app/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/.prisma/client/index.js:3:11)
at 2415 (/app/.next/server/chunks/415.js:18:16)
at webpack_require (/app/.next/server/webpack-api-runtime.js:25:42)
at 639 (/app/.next/server/chunks/639.js:26:77)
at webpack_require (/app/.next/server/webpack-api-runtime.js:25:42)
at webpack_exec (/app/.next/server/pages/api/auth/[...nextauth].js:56:39)
at /app/.next/server/pages/api/auth/[...nextauth].js:57:70
at webpack_require.X (/app/.next/server/webpack-api-runtime.js:177:21)
at /app/.next/server/pages/api/auth/[...nextauth].js:57:47
at Object. (/app/.next/server/pages/api/auth/[...nextauth].js:60:3)

To reproduce

Listening on port 3000 url: http://9f360ba7399b:3000
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
at new PrismaClient (/app/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/.prisma/client/index.js:3:11)
at 2415 (/app/.next/server/chunks/415.js:18:16)
at webpack_require (/app/.next/server/webpack-api-runtime.js:25:42)
at 639 (/app/.next/server/chunks/639.js:26:77)
at webpack_require (/app/.next/server/webpack-api-runtime.js:25:42)
at webpack_exec (/app/.next/server/pages/api/auth/[...nextauth].js:56:39)
at /app/.next/server/pages/api/auth/[...nextauth].js:57:70
at webpack_require.X (/app/.next/server/webpack-api-runtime.js:177:21)
at /app/.next/server/pages/api/auth/[...nextauth].js:57:47
at Object. (/app/.next/server/pages/api/auth/[...nextauth].js:60:3)
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
at new PrismaClient (/app/node_modules/.pnpm/@prisma[email protected][email protected]/node_modules/.prisma/client/index.js:3:11)
at 2415 (/app/.next/server/chunks/415.js:18:16)
at webpack_require (/app/.next/server/webpack-api-runtime.js:25:42)
at 639 (/app/.next/server/chunks/639.js:26:77)
at webpack_require (/app/.next/server/webpack-api-runtime.js:25:42)
at webpack_exec (/app/.next/server/pages/api/auth/[...nextauth].js:56:39)
at /app/.next/server/pages/api/auth/[...nextauth].js:57:70
at webpack_require.X (/app/.next/server/webpack-api-runtime.js:177:21)
at /app/.next/server/pages/api/auth/[...nextauth].js:57:47
at Object. (/app/.next/server/pages/api/auth/[...nextauth].js:60:3)

Additional context

No response

crash when displaying output from select query

Describe the bug

When I try to retrieve any data from my booking table I get an error on screen:
Application error: a client-side exception has occurred (see the browser console for more information).

in console there's a bunch of errors:
framework-281bd828f4ecdac7.js:9 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
a6 @ framework-281bd828f4ecdac7.js:9
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
framework-281bd828f4ecdac7.js:9 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
a6 @ framework-281bd828f4ecdac7.js:9
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
framework-281bd828f4ecdac7.js:9 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
a6 @ framework-281bd828f4ecdac7.js:9
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
framework-281bd828f4ecdac7.js:9 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
a6 @ framework-281bd828f4ecdac7.js:9
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
framework-281bd828f4ecdac7.js:9 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
a6 @ framework-281bd828f4ecdac7.js:9
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
framework-281bd828f4ecdac7.js:9 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
a6 @ framework-281bd828f4ecdac7.js:9
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Btype%2C%20data%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at lJ (framework-281bd828f4ecdac7.js:9:54221)
at o (framework-281bd828f4ecdac7.js:9:59251)
at uu (framework-281bd828f4ecdac7.js:9:71132)
at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 A client-side exception has occurred, see here for more info: https://nextjs.org/docs/messages/client-side-exception-occurred
K @ main-b471d74b2885b119.js:1
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error rendering page: Error: Cancel rendering route
at c (main-b471d74b2885b119.js:1:12323)
at main-b471d74b2885b119.js:1:12275
at new Promise ()
at eo (main-b471d74b2885b119.js:1:12252)
at main-b471d74b2885b119.js:1:10863
(anonymous) @ main-b471d74b2885b119.js:1
Promise.catch (async)
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error rendering page: Error: Cancel rendering route
at c (main-b471d74b2885b119.js:1:12323)
at main-b471d74b2885b119.js:1:12275
at new Promise ()
at eo (main-b471d74b2885b119.js:1:12252)
at main-b471d74b2885b119.js:1:10863
(anonymous) @ main-b471d74b2885b119.js:1
Promise.catch (async)
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error rendering page: Error: Cancel rendering route
at c (main-b471d74b2885b119.js:1:12323)
at main-b471d74b2885b119.js:1:12275
at new Promise ()
at eo (main-b471d74b2885b119.js:1:12252)
at main-b471d74b2885b119.js:1:10863
(anonymous) @ main-b471d74b2885b119.js:1
Promise.catch (async)
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error rendering page: Error: Cancel rendering route
at c (main-b471d74b2885b119.js:1:12323)
at main-b471d74b2885b119.js:1:12275
at new Promise ()
at eo (main-b471d74b2885b119.js:1:12252)
at main-b471d74b2885b119.js:1:10863
(anonymous) @ main-b471d74b2885b119.js:1
Promise.catch (async)
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33
main-b471d74b2885b119.js:1 Error rendering page: Error: Cancel rendering route
at c (main-b471d74b2885b119.js:1:12323)
at main-b471d74b2885b119.js:1:12275
at new Promise ()
at eo (main-b471d74b2885b119.js:1:12252)
at main-b471d74b2885b119.js:1:10863
(anonymous) @ main-b471d74b2885b119.js:1
Promise.catch (async)
fn @ main-b471d74b2885b119.js:1
componentDidCatch @ main-b471d74b2885b119.js:1
a.componentDidCatch.t.callback @ framework-281bd828f4ecdac7.js:9
lH @ framework-281bd828f4ecdac7.js:9
uY @ framework-281bd828f4ecdac7.js:9
e @ framework-281bd828f4ecdac7.js:9
(anonymous) @ framework-281bd828f4ecdac7.js:9
oI @ framework-281bd828f4ecdac7.js:9
oS @ framework-281bd828f4ecdac7.js:9
x @ framework-281bd828f4ecdac7.js:33
T @ framework-281bd828f4ecdac7.js:33

at i (framework-281bd828f4ecdac7.js:9:121294)
at oO (framework-281bd828f4ecdac7.js:9:99114)
at framework-281bd828f4ecdac7.js:9:98981
at oF (framework-281bd828f4ecdac7.js:9:98988)
at ox (framework-281bd828f4ecdac7.js:9:95740)
at oS (framework-281bd828f4ecdac7.js:9:94295)
at x (framework-281bd828f4ecdac7.js:33:1373)

a

To reproduce

CREATE TABLE booking (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(400) DEFAULT NULL,
ownerId int(11) DEFAULT NULL,
eventstart datetime DEFAULT NULL,
roomId int(11) DEFAULT NULL,
eventend datetime DEFAULT NULL,
allday bit(1) DEFAULT NULL,
repBookId int(11) DEFAULT NULL,
clientId int(11) DEFAULT NULL,
invoiceId int(11) DEFAULT NULL,
paidId int(11) DEFAULT NULL,
mojp bit(1) NOT NULL DEFAULT b'0',
paid tinyint(1) DEFAULT NULL,
mpid int(11) DEFAULT NULL,
mpclientId int(11) DEFAULT NULL,
gcal bit(1) NOT NULL DEFAULT b'0',
gcaluid varchar(200) DEFAULT NULL,
mpType varchar(10) DEFAULT NULL,
online bit(1) DEFAULT b'0',
proformaInvoiceId int(11) DEFAULT NULL,
PRIMARY KEY (id),
KEY eventstart (eventstart),
KEY FK_bookingrepeatb (repBookId),
KEY FK_booking (roomId),
KEY FK_bookingusers (ownerId),
KEY invoiceId (invoiceId),
KEY paidId (paidId),
KEY booking_ibfk_1 (clientId),
KEY FK_proformainvoice (proformaInvoiceId),
CONSTRAINT FK_booking FOREIGN KEY (roomId) REFERENCES room (id) ON DELETE CASCADE,
CONSTRAINT FK_bookingrepeatb FOREIGN KEY (repBookId) REFERENCES repeatbookings (id) ON DELETE CASCADE,
CONSTRAINT FK_bookingusers FOREIGN KEY (ownerId) REFERENCES user (id) ON DELETE CASCADE,
CONSTRAINT FK_proformainvoice FOREIGN KEY (proformaInvoiceId) REFERENCES proformainvoice (id) ON DELETE SET NULL,
CONSTRAINT booking_ibfk_1 FOREIGN KEY (clientId) REFERENCES client (id) ON DELETE SET NULL,
CONSTRAINT booking_ibfk_2 FOREIGN KEY (invoiceId) REFERENCES invoice (id) ON DELETE SET NULL,
CONSTRAINT booking_ibfk_3 FOREIGN KEY (paidId) REFERENCES payment (id) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=74996 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_slovenian_ci CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC;

the constraints and indexes probably don't matter in this case...

Additional context

No response

Support SSL connection for MySQL

Describe the bug

在创建MySQL连接时,如果使用SSL,会提示错误:

Ignoring invalid configuration option passed to Connection: useSSL. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
Add command: ClientHandshake
 raw: 0a352e372e34312d6c6f67002f0000004179366c276a383200ffff080200ffc1150000000000000000000020722d347b547e5a385c3c64006d7973716c5f6e61746976655f70617373776f726400
Trace
    at Connection.handlePacket (D:\Code\AzureSQLChatGPTDemo\node_modules\.pnpm\[email protected]\node_modules\mysql2\lib\connection.js:446:17)
    at PacketParser.onPacket (D:\Code\AzureSQLChatGPTDemo\node_modules\.pnpm\[email protected]\node_modules\mysql2\lib\connection.js:94:12)
    at PacketParser.executeStart (D:\Code\AzureSQLChatGPTDemo\node_modules\.pnpm\[email protected]\node_modules\mysql2\lib\packet_parser.js:75:16)
    at Socket.<anonymous> (D:\Code\AzureSQLChatGPTDemo\node_modules\.pnpm\[email protected]\node_modules\mysql2\lib\connection.js:101:25)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
6 undefined ==> ClientHandshake#unknown name(0,,82)
Server hello packet: capability flags:3254779903=(long password, found rows, long flag, connect with db, no schema, compress, odbc, local files, ignore space, protocol 41, interactive, ssl, ignore sigpipe, transactions, reserved, secure connection, multi statements, multi results, ps multi results, plugin auth, connect attrs, plugin auth lenenc client data, can handle expired passwords, session track, deprecate eof, ssl verify server cert, remember options)
Sending handshake packet: flags:12252111=(long password, found rows, long flag, connect with db, odbc, local files, ignore space, protocol 41, ignore sigpipe, transactions, reserved, secure connection, multi results, plugin auth, connect attrs, plugin auth lenenc client data, session track)
6 47 <== ClientHandshake#unknown name(1,,127)
6 47 <== 7b000001cff3ba0000000000e0000000000000000000000000000000000000000000000061646d696e757365720000656d706c6f796565006d7973716c5f6e61746976655f70617373776f726400300c5f636c69656e745f6e616d650c4e6f64652d4d7953514c2d320f5f636c69656e745f76657273696f6e05332e322e30
 raw: ff15042332383030304163636573732064656e69656420666f722075736572202761646d696e757365722740273132302e3232392e37382e3131352720287573696e672070617373776f72643a204e4f29
Trace
    at Connection.handlePacket (D:\Code\AzureSQLChatGPTDemo\node_modules\.pnpm\[email protected]\node_modules\mysql2\lib\connection.js:446:17)
    at PacketParser.onPacket (D:\Code\AzureSQLChatGPTDemo\node_modules\.pnpm\[email protected]\node_modules\mysql2\lib\connection.js:94:12)
    at PacketParser.executeStart (D:\Code\AzureSQLChatGPTDemo\node_modules\.pnpm\[email protected]\node_modules\mysql2\lib\packet_parser.js:75:16)
    at Socket.<anonymous> (D:\Code\AzureSQLChatGPTDemo\node_modules\.pnpm\[email protected]\node_modules\mysql2\lib\connection.js:101:25)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
6 47 ==> ClientHandshake#unknown name(2,Error,85)

我修改了lib/connectors/mysql/index.ts

const getMySQLConnection = async (connection: Connection): Promise<mysql.Connection> => {
  // const connectionUrl = convertToConnectionUrl(connection);
  // const conn = await mysql.createConnection(connectionUrl);
  const serverCa = [fs.readFileSync(path.join(__dirname, "/cert/DigiCertGlobalRootCA.crt.pem"), "utf8")];

  console.log(serverCa)

  const conn = await mysql.createConnection({
    host: connection.host,
    port: parseInt(connection.port),
    user: connection.username,
    password: connection.password,
    database: connection.database,
    debug:true,
    ssl: {
      rejectUnauthorized: false,
      ca: serverCa
    }
  });

  return conn;
};

To reproduce

不使用url的方法,创建一个新的function:

const getMySQLConnection = async (connection: Connection): Promise<mysql.Connection> => {
  // const connectionUrl = convertToConnectionUrl(connection);
  // const conn = await mysql.createConnection(connectionUrl);
  const serverCa = [fs.readFileSync(path.join(__dirname, "/cert/DigiCertGlobalRootCA.crt.pem"), "utf8")];

  console.log(serverCa)

  const conn = await mysql.createConnection({
    host: connection.host,
    port: parseInt(connection.port),
    user: connection.username,
    password: connection.password,
    database: connection.database,
    debug:true,
    ssl: {
      rejectUnauthorized: false,
      ca: serverCa
    }
  });

  return conn;
};

点击Create Connection,填写信息,保存,查看后台日志。

Additional context

No response

another way to convert natural language to sql

Is your feature request related to a problem?

If one doesn't have openAI account or tired of quota issue.

Describe the solution you'd like

Here's another solution:

获取出生年大于2000的读者的邮箱、昵称,按出生年倒序排列。
=> SELECT 邮箱, 昵称 FROM 读者 WHERE 出生年 > 2000 ORDER BY 出生年 DESC;

添加读者记录,邮箱为“[email protected]”,出生年为2000。
=> INSERT INTO 读者 (邮箱, 出生年) VALUES ("[email protected]", 2000);

Details please see here

Additional context

No response

MAX_TOKEN needs to be parameterized to support various models

Describe the bug

https://github.com/sqlchat/sqlchat/blob/main/src/components/ConversationView/index.tsx#L26-L28
Currently, the MAX_TOKEN is hardcoded as 4000, which is almost the context limit of gpt-3.5-turbo [4096]

However, GPT4 can support 8192 tokens, which is double the MAX_TOKEN, the app can handle larger context in GPT4 if MAX_TOKEN is adjusted accordingly

reference: https://platform.openai.com/docs/models/overview

To reproduce

As above

Additional context

No response

load database schema is very slow

Is your feature request related to a problem?

I have a database containing 20~30 tables. the speed of load database schema is very slow! 🤔

Describe the solution you'd like

make getTableStructure to async👀

// db_schema.ts

...
try {
    const connector = newConnector(connection);
    const tableStructures: Table[] = [];
    const rawTableNameList = await connector.getTables(db);
    for (const tableName of rawTableNameList) {
      const structure = await connector.getTableStructure(db, tableName);
      tableStructures.push({
        name: tableName,
        structure,
      });
    }
    res.status(200).json({
      data: tableStructures,
    });
  } catch (error: any) {
    res.status(400).json({
      message: error.message || "Failed to get database schema.",
      code: error.code || "UNKNOWN",
    });
  }
...

Additional context

No response

only part of the database is accessible

Describe the bug

1- prompt :
would you give me all tables in the database
.......
result :
it return only 6 tables out of 63

2- prompt :
would you check there is a 63 table in the database
...

I'm sorry, but I cannot check if there are 63 tables in the database as the provided database schema only includes the SQL code for creating six tables. If there are additional tables in the database, I would need access to the database to view them.

To reproduce

would you give me all tables in the database

Additional context

No response

can not upload file, chat

Describe the bug

2b5cd86f943a5625929ec5cd0b00f64 ![image](https://github.com/sqlchat/sqlchat/assets/134575458/2eb59ca4-4efe-4f9f-914e-bc65c1193d94)

To reproduce

none

Additional context

can log in but can not upload file and do chat, is there something wrong with my setting?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.