prisma: `prefer_socket` doesn't work when connect OceanBase with prisma
Bug description
- OceanBase is a MySQL compatible database and doesn’t support
@@socketvariable. https://github.com/oceanbase/oceanbase/issues/1936 - When connect OceanBase with prisma,
prefer_socketis configured and doesn’t work with following error:
Error: Schema engine error:
Unknown system variable 'socket'
Related prisma issue:
How to reproduce
- Clone reproducible repo: https://github.com/dengfuping/prisma-oceanbase-test
- isntall node and npm: https://nodejs.org/en
- run script
npm install - Configure oceanbase connect string in
.env.localfile - run script
npx prisma migrate dev --name init
Expected behavior
prefer_socket works and connect OceanBase with prisma should be success.
Prisma information
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
}
// Add your code using Prisma Client
Environment & setup
- OS: macOS
- Database: MySQL
- Node.js version: v21.6.2
Prisma Version
5.12.1
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 21 (5 by maintainers)
Commits related to this issue
- fix(connection): prefer_socket=false should work, fix prisma/prisma#24010 — committed to dengfuping/mysql_async by blackbeam 3 years ago
- fix(connection): prefer_socket=false should work, fix prisma/prisma#24010 — committed to dengfuping/mysql_async by dengfuping 2 years ago
- chore(deps): Use custom mysql_async to support prefer_socket, fix prisma/prisma#24010 — committed to dengfuping/prisma-engines by dengfuping 2 years ago
When it will be updated to version 0.33.0? I notice that Prisma maintains a version of mysql_async.
prefer_socket=falsenot working might be a problem in our underlying MySQL driver: https://github.com/blackbeam/mysql_async/issues/253 + https://github.com/blackbeam/mysql_async/releases/tag/v0.33.0@janpio @Weakky Hi, could you help to review this PR?