Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prisma generate on binary in venv generates js client instead? #961

Closed
Bewinxed opened this issue May 7, 2024 · 2 comments
Closed

prisma generate on binary in venv generates js client instead? #961

Bewinxed opened this issue May 7, 2024 · 2 comments

Comments

@Bewinxed
Copy link

Bewinxed commented May 7, 2024

Bug description

my project structure

**
.venv/bin/prisma
backend/
├── core
│   └── __pycache__
├── models
│   └── __pycache__
├── prisma
├── public
│   └── img
├── __pycache__
├── routes
│   ├── auth
│   │   └── __pycache__
│   ├── __pycache__
│   ├── scrapers
│   │   └── __pycache__
│   └── users
│       ├── personas
│       │   └── __pycache__
│       └── __pycache__
├── services
│   └── __pycache__
├── uploads
└── utils
    └── __pycache__**

When I invoke prisma generate, even by calling the binary in .venv directly, it installs the @prisma library, then creates node_modules and generates the client in node_modules
I have made sure to uninstall prisma from global modules
from prisma import Prisma() does not work.


everoot@uwucloud:~/dev/eve# ./.venv/bin/prisma generate --schema=./backend/prisma/schema.prisma 
Prisma schema loaded from backend/prisma/schema.prisma
Warning: [Prisma auto-install on generate] Prisma could not find a package.json file in the inferred project root /root/dev/eve. During the next step, when an auto-install of Prisma package(s) will be attempted, it will then be created by your package manager on the appropriate level if necessary.
bun add v1.1.6 (e58d67b4)

 installed [email protected] with binaries:
  - prisma

 6 packages installed [794.00ms]
  Removed: 1
bun add v1.1.6 (e58d67b4)

 installed @prisma/[email protected]

 1 package installed [103.00ms]

✔ Installed the @prisma/client and prisma packages in your project

✔ Generated Prisma Client (v5.11.0) to ./node_modules/@prisma/client in 338ms

Start using Prisma Client in Node.js (See: https://pris.ly/d/client)

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

or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)

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


See other ways of importing Prisma Client: http://pris.ly/d/importing-client

┌─────────────────────────────────────────────────────────────┐
│  Deploying your app to serverless or edge functions?        │
│  Try Prisma Accelerate for connection pooling and caching.  │
│  https://pris.ly/cli/accelerate                             │
└─────────────────────────────────────────────────────────────┘

How to reproduce

Expected behavior

generate prisma client in python

Prisma information

generator client {
  provider             = "prisma-client-js"
  interface            = "async"
  recursive_type_depth = 3
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

Environment & setup

  • OS: Ubuntu
  • Database: PostgreSQL
  • Python version: 3.12
  • Prisma version:
prisma                  : 5.11.0
prisma client python    : 0.13.1
platform                : debian-openssl-3.0.x
expected engine version : efd2449663b3d73d637ea1fd226bafbcf45b3102
installed extras        : []
install path            : /root/dev/eve/.venv/lib/python3.12/site-packages/prisma
binary cache dir        : /root/.cache/prisma-python/binaries/5.11.0/efd2449663b3d73d637ea1fd226bafbcf45b3102
@RobertCraigie
Copy link
Owner

Hey @Bewinxed, I think you have a typo in your schema file, you have to change provider = "prisma-client-js" to provider = "prisma-client-py"

generator client {
  provider             = "prisma-client-py"
  interface            = "async"
  recursive_type_depth = 3
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

@RobertCraigie RobertCraigie closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
@Bewinxed
Copy link
Author

Bewinxed commented May 15, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants