Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

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

Open
@nettrino

Description

@nettrino

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions