Nx Prisma Targets

Resources

12 thoughts on “Nx Prisma Targets”

  1. For me, I have encountered an issue at this point where the “jobber-auth” database is not showing in pgadmin4 under the server. I have created the server in pgadmin with the same configuration as shown in this video. I then ran the prisma migrate command using the “migrate-prisma” target in the “project.json” file of “jobber-auth” project and the outputted logs did mention the following: “PostgreSQL database jobber-auth created at localhost:5432”. I have shared my GitHub repository below if this helps. I should also mention that I added the .env file (from the root of the project) to “.gitignore” hence you can’t see it, but I do have the exact same postgres database url for the “AUTH_DATABASE_URL” key. Would you happen to know why this is happening? I am using a Windows laptop for additional reference. Thanks

    GitHub repository: https://github.com/yusufesse/jobber/tree/main

  2. Hi! a have a problem… when i run :
    nx generate-types cnj-auth

    after ask i can’t type any name or words ….
    ? Enter a name for the new migration: » —> here <—
    i try cmd, gitbash, vscode the same problem
    Win11 x64

  3. this command
    nx g service/module prism
    works initially the same way, but does not ask for the path where to create new files…. and creates them in the root directory of the project, so I need to manually move them to the prisma folder and make changes to the app.module …

  4. anderson.belino28

    I did the whole process but when I’m at root and run the nx Migrate-Prisma Access-Control command, it loads everything perfectly, but it doesn’t allow me to type the name of the migration and any obligations.

    —————————————–//———————————————
    Configuration in project.json

    },
    “generate-prism”: {
    “command”: “prism generation”,
    “options”: {
    “cwd”: “{projectRoot}”,
    “input”: [“prisma/schema.prisma”]
    },
    “cache”: true
    },
    “migrate-prisma”: {
    “command”: “prisma migrate dev”,
    “options”: {
    “cwd”: “{projectRoot}”,
    “forwardAllArgs”: true
    }
    }

    —————————————–//———————————————
    Command result
    PS C:\Development\APP Project\app> nx migrate-prisma access-control

    > nx run access control:migrate-prisma

    > prism migrate dev

    Environment variables loaded from ..\..\.env
    Prisma Schema loaded from prism\schema.prisma
    Data source “db”: PostgreSQL database “access_control”, schema “public” at “localhost:5432”

    ? Enter a name for the new migration: »

  5. question on 5:43, Isn’t it bad to keep regenerating Prisma types on every hot reload? The build process now depends on type generation, and serve depends on build, causing Prisma types to be regenerated on each hot reload.

Leave a Reply