Skip to content

Which means "auto_register=True" #329

Answered by RobertCraigie
felinto-dev asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry that isn't clear enough I'll try and make it easier to find in the future.

That parameter means that you can query from model classes, for example:

from prisma import Prisma
from prisma.models import User

prisma = Prisma(auto_register=True)
await prisma.connect()

# this line would fail if auto_register was False or omitted
user = await User.prisma().create(
    data={
        'name': 'Robert',
    },
)

This is required as some people may want to have multiple Prisma instances at once.

https://prisma-client-py.readthedocs.io/en/stable/reference/model-actions/#registering-a-client-instance

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@felinto-dev
Comment options

Answer selected by felinto-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants