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

Support schemas that are using the preview feature relationJoins on different generators #862

Open
nettrino opened this issue Jan 3, 2024 · 1 comment

Comments

@nettrino
Copy link

nettrino commented Jan 3, 2024

Problem

I am using the python prisma client in a project that uses a shared schema. That shema has the preview feature relationJoins enabled, which breaks prisma generate:

error: The preview feature "relationJoins" is not known. Expected one of: deno, driverAdapters, fullTextIndex, fullTextSearch, metrics, multiSchema, postgresqlExtensions, tracing, views

I am not currently using that feature in my codebase, and would rather not have to be forced to modify the schema on the fly if I can avoid it, especially since it is not used in this generate.

The schema generators are as follows:

generator client {
    provider        = "prisma-client-js"
    binaryTargets   = ["native"]
    previewFeatures = ["views", "multiSchema", "relationJoins"]
}

generator pythonclient {
    provider             = "prisma-client-py"
    interface            = "asyncio"
    recursive_type_depth = 5
    previewFeatures      = ["views", "multiSchema"]
}

generator goclient {
    provider        = "go run github.com/steebchen/prisma-client-go"
    previewFeatures = ["views", "multiSchema"]
}

/// Always after the prisma-client-js generator
generator json {
    provider        = "prisma-json-types-generator"
    // all type overwrites are defined in src/lib/db.ts
    previewFeatures = ["views", "multiSchema"]
}

Suggested solution

Allow prisma generate to proceed with a warning / force flag if the feature is not used in teh python provider

@nettrino nettrino changed the title Support schemas that are using the preview feature relationJoins on different clients Support schemas that are using the preview feature relationJoins on different generators Jan 3, 2024
@RobertCraigie
Copy link
Owner

RobertCraigie commented Jan 3, 2024

This is likely because the Prisma version is outdated, I haven't published a new release for the last couple Prisma versions. Could you try installing prisma-client-py from GitHub?

I'll hopefully be able to publish to pypi soon.

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