https://www.prisma.io/ logo
Join Slack
Powered by
# orm-help
  • h

    hart

    12/18/2021, 2:15 AM
    Hi, I'm having an issue trying to create a baseline migration.. it seems to fail because prisma thinks the schema is out of sync with the db (odd because prisma was used to create and administer the db everywhere) So I tried a
    prisma db pull
    which updated the schema a bit and added a
    name:
    property to my
    unique:
    attributes. For example (from git diff):
    Copy code
    -  @@unique([credentialSetLabel, orderId])
    +  @@unique([credentialSetLabel, orderId], name: "Sweep.credentialSetLabel_orderId_unique")
    This causes an issue with the vs code extension which now says
    Copy code
    Error validating model "SweepMarket": The `name` property within the `@@unique` attribute only allows for the following characters: `_a-zA-Z0-9`.
    but
    prisma validate
    says the schema file is valid. I'm using sqlite for the db.. anyone have an idea how I can make things work enough to be able to make/apply migrations? Also, I'm thinking this is a bug in the VS code extension but couldn't find anything in their github
  • h

    hart

    12/18/2021, 2:16 AM
    Oh, and I'm using prisma 2.24.1 also
  • t

    Timo

    12/18/2021, 8:05 AM
    What's the fastest way to create 10k objects? Using $transaction? And how many can I stack?
  • r

    random

    12/18/2021, 8:35 AM
    How would I just grab one row from a relationship? Using
    take: 1
    still get all rows related to that relationship.
    export const users = () => {
      
    return db.user.findMany({
        
    select: {
          
    id: true,
          
    name: true,
          
    userActivity: {
            
    take: 1,
            
    select: {
              
    type: true,
              
    createdAt: true,
            
    },
          
    },
        
    },
      
    })
    }
  • r

    random

    12/18/2021, 8:37 AM
    lol... the lack of markdown on slack is disturbing.
  • n

    Neo Lambada

    12/18/2021, 10:24 AM
    I would like to check if my database connection is correct before starting the server. which means i will be confident that my database url in the .env file is correct and the server will only start if the connection to the database is correct. so is it wise to check by explicitly calling the connect method and start the query engine display the message to the console and disconnect the connection.
  • h

    hinogi

    12/18/2021, 10:25 AM
    @random seems to work though
    Untitled_js.js
    r
    • 2
    • 2
  • h

    hinogi

    12/18/2021, 10:27 AM
    So is there an option for writing a db connector yourself or is that option still in the making since 2019?
  • h

    hinogi

    12/18/2021, 10:29 AM
    in reference to

    https://www.youtube.com/watch?v=RAoXdyI_PH4&t=907s▾

    @marcus
  • o

    Okan Yıldırım

    12/18/2021, 10:29 AM
    Hello
    ✅ 1
  • o

    Okan Yıldırım

    12/18/2021, 10:30 AM
    To search not null queries, can I do this?:
    where: { textEn: { not: null } },
  • v

    Vilke

    12/18/2021, 4:36 PM
    Hey, how I seed .csv files to prisma? headers: fisrtname,lastname,address,phonenumber. I need to make rawsql query?
  • j

    Jin

    12/19/2021, 2:40 PM
    does somebody know what is the HOST address of my postgressdb in cloud run?
  • j

    Jin

    12/19/2021, 3:41 PM
    do I need Kubernaetes Engine to run dockerfile and docker-compose together?
  • j

    Jin

    12/19/2021, 3:41 PM
    https://kevinsimper.medium.com/building-docker-images-with-docker-compose-on-google-cloud-container-builder-292b1eb3fd31
  • f

    Firat Özcan

    12/19/2021, 4:09 PM
    Hey, I just started using Prisma and I can't quite figure out the best way to create relations with database level cascades
  • f

    Firat Özcan

    12/19/2021, 4:10 PM
    I got a schema like this and when I checked the database there was no foreign key set for the
    UserMeta
    table and I cannot use @relation because Prisma then tells me, that the relation already exists and I only have to provide it in one of the tables
    Schema.prisma.txt
    m
    • 2
    • 1
  • f

    Firat Özcan

    12/19/2021, 4:11 PM
    This is a bit weird though, because I want the foreign key in the
    UserMeta
    table so I can configure
    onDelete
    on it
  • f

    Firat Özcan

    12/19/2021, 4:11 PM
    It's also a bit annoying that I cannot say that the
    user
    field is not optional and will always be there
  • j

    Jin

    12/19/2021, 6:00 PM
    do i need kubebate to communicate my app container and docker compose?
    a
    • 2
    • 4
  • b

    Benjamin LONGEARET

    12/19/2021, 8:11 PM
    Hello everybody! First of all, thanks for the amazing work on that project! I have a question regarding some immutable data. What should be the best strategy to implement a version system for some of each table in our system. I mean : • no update, only insert • a bump of the version • some linked version between dependent tables The idea, is to get the history of a ressource in our databases. Thanks a lot. Enjoy this end of year. Bennnou.
  • j

    James Mintram

    12/19/2021, 9:29 PM
    Hey all, what's the best way to recreate an env file? I tried the
    init
    option, but the command errors as prisma has already been initialised for this project.
    a
    • 2
    • 1
  • r

    Ryan Donohue

    12/19/2021, 9:38 PM
    Yo! Anyone able to give me a hand with some unit tests?
    a
    • 2
    • 1
  • m

    Michael Plaxico

    12/19/2021, 9:56 PM
    Hello, all. I’m attempting to initialize
    PrismaClient
    in a new Nest.js application. All of my secrets are managed in AWS Secrets Manager, because I’d like to avoid having any sort of secret/.env files in my source code. I am able to instantiate an instance of
    PrismaClient
    programmatically, but the resulting client instance cannot be bound to my Prisma service in Nest.js. I’d like to bind that client to
    this.client
    in my
    PrismaService
    constructor, but, as you well know, constructors are synchronous and their declaration cannot be prefaced with
    async
    to make them asynchronous either. My thinking is that, if I instantiate a single instance of
    PrismaClient
    within my
    PrismaService
    , I should then be able to import
    PrismaService
    into my domain-specific service modules (e.g.,
    cars.service.ts
    ,
    bicycles.service.ts
    , etc.) then reference those services with my resolvers (e.g.,
    cars.resolvers.ts
    ). What I don’t want to do--though what would probably work--is instantiate an instance of
    PrismaClient
    when- and wherever I need to interact with a datasource. I’m aware that there are a few prescribed patterns for connecting to Prisma, but they all seem to involve environment variables or config files, whereas I’d like my own implementation to involve only the secrets I keep within AWS Secrets Manager and an instance of
    PrismaClient
    that I instantiate within a
    PrismaService
    . Hopefully all of that makes sense. -_-; Edit: I guess another thought that comes to mind is somehow accessing the environment variables stored within AWS Secrets Manager and . . . I don’t know . . . writing prescribing them to a container or something of the like whenever it is instantiated, though this sort of thing is admittedly beyond my depth and presumes that I am utilizing something like Docker.
  • j

    Jared Fraser

    12/20/2021, 5:02 AM
    Any updates if https://github.com/prisma/prisma/issues/9435 is being worked on? This is blocking our ability to upgrade from 3.1.1
    n
    • 2
    • 3
  • u

    user

    12/20/2021, 8:46 AM
    Tips for Content Creation by DevRel - Part 2 #shorts

    https://www.youtube.com/watch?v=2GFi-Svcm70▾

    📷 If you're looking to improve your content, or are considering starting to create content, follow these tips from a developer relations perspective! 👀 #shorts #prisma #tipsforcontent
  • u

    user

    12/20/2021, 8:46 AM
    Tips for Content Creation by DevRel - Part 1 #shorts

    https://www.youtube.com/watch?v=HwidU6xEyks▾

    📷 If you're looking to improve your content, or are considering starting to create content, follow these tips from a developer relations perspective! 👀 #shorts #prisma #tipsforcontent
  • b

    Barry

    12/20/2021, 9:17 AM
    does prisma have transaction commit callback or rollback callback?
    n
    • 2
    • 4
  • e

    ed

    12/20/2021, 7:00 PM
    👋 🧭 📐 Any thoughts on telemetry or tracing Prisma database to help with optimization? There’s this ticket https://github.com/prisma/prisma/issues/5956 but I haven’t seen any updates in a while. We’re having trouble specifically using Datadog as a telemetry sink, tying queries made in a serverless context hosted on Vercel with a NextJS app. Any help or insight would be appreciated! /cc @Matt Mueller (Prisma Client PM) 🙏
    m
    • 2
    • 5
  • a

    Alex Vilchis

    12/20/2021, 7:15 PM
    Hi, everyone 👋 Do you guys have any examples of a setup using Prisma Client from Cypress tests? I am currently using cy.task to execute a node process but this is forcing me to create a task for every query I need to perform, which is cumbersome
    🤔 1
    a
    • 2
    • 4
1...523524525...637Latest