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

    KJReactor

    08/10/2021, 1:56 PM
    Hello everyone
    👋 3
  • k

    KJReactor

    08/10/2021, 1:57 PM
    Anyone wants to create relay type of connection objects with prisma? Tell me what you think of https://www.npmjs.com/package/graphql-connection-helper
  • n

    Nditah Samweld

    08/10/2021, 3:46 PM
    Here is my first article on Prisma https://dev.to/nditah/how-to-build-a-rest-api-with-node-prisma-and-postgresql-429a Credit goes to @nikolasburk
    💯 3
    🙌 5
    ❤️ 3
    prisma rainbow 4
    v
    • 2
    • 1
  • d

    dhatGuy

    08/10/2021, 4:49 PM
    Hello everyone. I have a next app set up with prisma and nextauth. The app works locally but after deploying and I try to login, I get this error
    Copy code
    The table `public.Profile` does not exist in the current database.
    Error: The table `public.Profile` does not exist in the current database.
    The table ought to be
    public.profile
    r
    • 2
    • 2
  • d

    Duane Creates

    08/10/2021, 5:26 PM
    is prisma usable in a multi-tenant app where each tenant has their own database?
    r
    • 2
    • 2
  • c

    Chip Clark

    08/10/2021, 6:22 PM
    Trying to use Prisma.join I have this SQL script
    Copy code
    SELECT        contcomp.ContactCompanyID, contcomp.CompanyName, contcomp.CompanyWebSite, contact.ContactCompanyID AS Expr1, contact.ContactID, contact.LastName, contact.FirstName, contact.MiddleName, 
                             contact.PreferredFirstName, contact.DisplayName, contact.InterActionID, contact.EmailAddress, contact.Prefix, contact.Suffix, contact.JobTitle
    FROM            dbo.ContactCompany AS contcomp INNER JOIN
                             dbo.Contact AS contact ON contcomp.ContactCompanyID = contact.ContactCompanyID
    and I'm trying to convert to a prisma.queryRaw
    Copy code
    let rawView = 'SELECT contcomp.ContactCompanyID, contcomp.CompanyName, contcomp.CompanyWebSite, ' +
                      'dbo.Contact.ContactCompanyID AS Expr1, dbo.Contact.ContactID, dbo.Contact.LastName, ' +
                      'dbo.Contact.FirstName, dbo.Contact.MiddleName, dbo.Contact.PreferredFirstName, ' +
                      'dbo.Contact.DisplayName, dbo.Contact.InterActionID, dbo.Contact.EmailAddress, ' +
                      'dbo.Contact.Prefix,  dbo.Contact.Suffix, dbo.Contact.JobTitle ' +
                      'FROM dbo.ContactCompany AS contcomp ' +
                      '(${Prisma.join(dbo.Contact)}) ON contcomp.ContactCompanyID = contact.ContactCompanyID ';
    I get Invalid prisma.queryRaw:
    Incorrect syntax near '$'.
    Looking at the document here: https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#tagged-template-helpers
    ✅ 1
    r
    • 2
    • 5
  • r

    Richard Dunlap

    08/10/2021, 6:41 PM
    Hey all, I'm trying to set up Prisma in an existing project (current just for database migrations). When running
    npx prisma migrate dev
    , I get an error:
    Copy code
    Database error code: 1118
    
    Database error:
    Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead,
    check the manual. You have to change some columns to TEXT or BLOBs
    
    Please check the query number 235 from the migration file.
    I'm not sure why this would be in issue since the schema was generated from prisma's introspection command. Even worse. I don't know how to find query number
    235
    since they aren't numbered in the migration's
    .sql
    file. Can anyone point me in the right direction? Thanks
    j
    r
    • 3
    • 5
  • a

    Adeel Ahmad

    08/10/2021, 7:00 PM
    is it normal to have your lambda package of over 100 MB when using prisma client ? any tip to reduce the size?
    r
    • 2
    • 1
  • d

    Dev__

    08/10/2021, 7:34 PM
    hello, the new interactive transaction give me a type of any
    await this.prisma.$transaction(async prisma => {
    j
    r
    • 3
    • 3
  • i

    Irakli Safareli

    08/11/2021, 9:29 AM
    Hi,
    prisma generate
    in docker
    node:16.5.0-alpine
    is throwing
    Error: Unknown binaryTarget linux-arm-openssl-undefined and no custom binaries were provided
    . (prisma@2.29.0). SOLUTION: https://web.archive.org/web/20210527154633/https://blog.jaimyn.dev/how-to-build-multi-architecture-docker-images-on-an-m1-mac/
    🙌 5
  • m

    Muzammil

    08/11/2021, 11:22 AM
    Hello
    👋 1
  • c

    Carlos Gomez

    08/11/2021, 8:40 PM
    Hi, I'm using
    prisma db seed
    in a Docker container with
    seed.ts
    .
    ts-node
    is unable to resolve paths. Any ideas?
    Copy code
    P> prisma db seed --preview-feature
    
    Prisma schema loaded from prisma/schema.prisma
    Running seed: ts-node --project ./tsconfig.json -T "prisma/seed.ts" ...
    Error: Cannot find module 'src/prisma.client'
    Require stack:
    - /app/prisma/seed.ts
        at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15)
        at Function.Module._resolveFilename (/app/node_modules/tsconfig-paths/lib/register.js:75:40)
        at Function.Module._load (node:internal/modules/cjs/loader:772:27)
        at Module.require (node:internal/modules/cjs/loader:999:19)
        at require (node:internal/modules/cjs/helpers:93:18)
        at Object.<anonymous> (/app/prisma/seed.ts:1:1)
        at Module._compile (node:internal/modules/cjs/loader:1095:14)
        at Module.m._compile (/app/node_modules/ts-node/src/index.ts:1295:23)
        at Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
        at Object.require.extensions.<computed> [as .ts] (/app/node_modules/ts-node/src/index.ts:1298:12)
    Error: Command failed with exit code 1: ts-node --project ./tsconfig.json -T "prisma/seed.ts"
    ✅ 1
    r
    • 2
    • 2
  • m

    Melvin Gaye

    08/11/2021, 11:43 PM
    Trying to use an array of values in a IN clause but Prisma.join is not returning properly. SOLVED....I had the parameters in the wrong order.... Nope not solved....query returns but it does NOT exclude the values in the array and it still shows the same as above instead of Not IN (1,2,3)
    r
    • 2
    • 3
  • l

    Leo Li

    08/12/2021, 12:53 AM
    Hi, the doc says for implicit Many-to-many relations the name of col must be named as
    A
    and
    B
    . Is there a way to name it meaningful? Or I have to construct it explicitly?
    m
    r
    • 3
    • 6
  • v

    Vladi Stevanovic

    08/12/2021, 8:37 AM
    📰 Today, the "What's new in Prisma" livestream is hosted by @Daniel Norman from Poznań! 🙌 Join us for a deep dive in the v2.29 release with PM @Matt Mueller (Prisma Client PM) and backend dev @do4gr ⏰ 5pm Berlin | 8am San Francisco

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

  • g

    Gelo

    08/12/2021, 9:48 AM
    Hi, what IP should I allow if I will going to add cloud.prisma.io to my database trusted sources?
  • d

    Dev__

    08/12/2021, 1:18 PM
    is there a way to convert a
    Prisma.Decimal
    to a float? whenever I return it always sends it as a string
    r
    e
    s
    • 4
    • 7
  • e

    egor guscha

    08/12/2021, 2:23 PM
    Hi! I have an error, how to solve? P.S. macbook m1
    s
    • 2
    • 6
  • g

    Gelo

    08/12/2021, 2:48 PM
    Prisma studio error on latest version
    r
    • 2
    • 5
  • s

    stephan levi

    08/12/2021, 2:59 PM
    can i run PRISMA as a native AWS service ?
    r
    • 2
    • 1
  • j

    James

    08/12/2021, 5:20 PM
    👋 Hello! I'm entirely new to Prisma, but relatively familiar with SQL. I'm trying to figure out how to translate my raw mysql queries to prisma. For example:
    Copy code
    SELECT 
        p.*, ROUND(AVG(rt.rating), 1) AS user_rating
    FROM
        posts AS p
            LEFT JOIN
        ratings AS rt ON rt.entry_id = p.id
    GROUP BY p.id;
    I found the docs for aggregations &amp; counts, but it doesn't seem to do what I need (I think). Do I need to create a new model to accomplish joins / selects from other tables? I did post on stack overflow earlier if slightly more context would help. Also, if there is a more appropriate place to ask newbie questions in please let me know 🙂
    v
    • 2
    • 4
  • m

    Maotora

    08/12/2021, 7:46 PM
    psql -h localhost -p 5432 -U postgres -d dbname
    Works perfectly fine but; `psql "postgresql://postgres:Password$2021@localhost:5432/dbname"`` Gives error
    psql: error: FATAL:  password authentication failed for user "postgres"
  • m

    Maotora

    08/12/2021, 7:49 PM
    I need help ^, in the first case, I was prompted for a password and I used the same password as specified in the connection string but I keep getting that error.
    y
    r
    • 3
    • 5
  • g

    Gelo

    08/12/2021, 11:33 PM
    why @default(now()) is always 1 day late?
    n
    • 2
    • 1
  • g

    Gelo

    08/12/2021, 11:51 PM
    how to set this to prisma date and time default? new Date().toLocaleDateString()
    v
    r
    • 3
    • 6
  • a

    Alan

    08/13/2021, 2:57 AM
    is there a way to store
    DATABASE_URL
    in a file? (instead of
    .env
    )?
    r
    • 2
    • 10
  • d

    Dev__

    08/13/2021, 2:38 PM
    hi, I am still having some issues with the interactive transactions API. for some reason it says this
    Argument of type '() => Promise<Integration[]>' is not assignable to parameter of type 'PrismaPromise<any>[]'
    Copy code
    const [updatedIntegration] = await this.prisma.$transaction(async () => {
        const method = ...
    
    	const updatedIntegration = await this.prisma.integration.update({
    		data: {
    			name,
    			username,
    			password: hashedPassword,
    			descriptionCharacterLimit,
    			integrationMethodId: method.id
    		},
    		where: {
    			id: integration.id
    		}
    	});
    
    	// some more queries...
    
    	return [updatedIntegration];
    });
    v
    r
    a
    • 4
    • 28
  • m

    Marcelo Pastore

    08/13/2021, 7:28 PM
    Hi there people, how are you doing? Started working with prisma recently and finding it great, but still having some troubles that i could not find the answers yet. Right now, i am facing some trouble with floats, in my schema i have they like these: nwValue Float @map(“nw_value”) @db.Float And when i try to get it with $queryRaw, the returned value loses it precision even being saved with 2 decimal cases in the database. After some fruitless attempts, i decided to use findMany method, but the returned value came as string (“0.25"). My main interest is to use $queryRaw since i am implementing Prisma in an existing code with queries being called with mysql connector. Some suggestion?
    r
    • 2
    • 2
  • k

    KJReactor

    08/13/2021, 10:37 PM
    I am trying to rename relational fields as per the documentation but I'm getting an error that the "fields" attribute is required. Doesn't that defeat the purpose of rename relational fields cause otherwise annotated fields would have to be used? using v2.29.1
    r
    • 2
    • 5
  • h

    Halvor

    08/14/2021, 9:12 AM
    I am creating a row in a table with 3 optional relations, is it possible to conditionally select which to add inline?
1...469470471...637Latest