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

    Kha

    02/08/2021, 6:42 AM
    If I want to work with a date attribute as part of my model, would you suggest just storing it as a string or store it as a DateTime (I don’t need the time part)
    ✅ 1
    s
    r
    • 3
    • 10
  • m

    Mykyta Machekhin

    02/08/2021, 8:08 AM
    Hy guys. I have run the followings command:
    npm i --save-dev prisma
    npm i @Prisma/client
    . But still have 2.15 version. Why can this happen?
    ✅ 1
    k
    n
    • 3
    • 10
  • r

    rahul

    02/08/2021, 12:59 PM
    hello, is there any way to customize the location of the migrations directory?
  • r

    rahul

    02/08/2021, 1:00 PM
    i dont see any CLI options for it but wondering if it's an undocumented feature?
    j
    • 2
    • 4
  • n

    Natalia

    02/08/2021, 2:12 PM
    Hey all, tomorrow at 6 PM CET we are hosting our open mic Advanced TypeScript Trickery meetup. typescript The link to the Zoom call will be shared tomorrow, so RSVP here. Hoping to see you there! 🤗
    prisma cool 4
    🎤 3
    ♥️ 4
    typescript 3
    prisma rainbow 4
  • j

    John Peña

    02/08/2021, 10:43 PM
    anyone have tips on getting started writing unit tests that involve prisma? ideally with jest
    plus one +1 1
    👀 1
    s
    u
    • 3
    • 8
  • i

    iamclaytonray

    02/09/2021, 2:04 AM
    Anyone have a decent approach to omit certain fields from Prisma/Express?
    m
    y
    +2
    • 5
    • 13
  • r

    ryan

    02/09/2021, 4:30 PM
    Hi all! 👋 We recently released two new video guides which are relevant to topics from the 2.16 release. Create Many The first is regarding the new
    createMany
    method. The video will walk you through how to use it in the context of database seeding:

    https://youtu.be/QxyqR4yh1GI▾

    Prisma CLI The second is about the package name change for the Prisma CLI. As you may have seen, you should install the CLI using the package of
    prisma
    going forward. This video explains the details:

    https://youtu.be/6wsOP68NIFQ▾

    🙌 5
    prisma cool 2
    🎤 5
    fast parrot 5
    prisma rainbow 4
    ♥️ 3
  • m

    Martïn

    02/09/2021, 10:20 PM
    I just noticed a patch release v2.16.1 https://github.com/prisma/prisma/releases/tag/2.16.1 This fixes a problem some users are having with certain Docker, MariaDB, MySQL or SQL Server configurations, preventing Prisma to connect with localhost. A recent Docker update caused a regression related to IPv6 and name resolution.
    💯 2
  • j

    Jeff Barg

    02/09/2021, 10:29 PM
    👋 Hey! New to the slack, love Prisma. I’m using Prisma Migrate to maintain our database migrations. Has anyone done a migration to move a foreign key from one side of a 1-1 relationship to the other model? Ideally this is straightforward, but it looks like I’d have to do a manual migration which is pretty tricky
    r
    a
    • 3
    • 4
  • t

    Tarrence

    02/10/2021, 3:52 AM
    Hi! Is it possible to see raw prisma queries that are being run against the db?
  • t

    Tarrence

    02/10/2021, 3:52 AM
    I'm using the go client
    a
    • 2
    • 1
  • t

    Tarrence

    02/10/2021, 3:53 AM
    For some reason this query is failing with
    time out of range
    l
    • 2
    • 1
  • t

    Tarrence

    02/10/2021, 3:53 AM
    Copy code
    debug: 2021/02/10 03:51:57 prisma engine payload: `{"query":"mutation {result: executeRaw(query:\"UPDATE \\\"EventInstance\\\" SET \\\"start\\\" = date_trunc('day', \\\"start\\\") + CAST ($1 as time), \\\"end\\\" = date_trunc('day', \\\"end\\\") + CAST ($2 as time) WHERE \\\"eventId\\\" = $3\\n\\t\",parameters:\"[\\\"2021-02-08T04:00:00Z+00:00\\\",\\\"2021-02-08T05:00:00Z+00:00\\\",\\\"readily-illegally-upward-urchin\\\"]\",) }","variables":{}}`
    l
    • 2
    • 1
  • r

    Ralf Vogler

    02/10/2021, 2:56 PM
    Is there some way to update an optional DateTime to
    now()
    ? Can't use
    @updatedAt
    since there's nothing else to update. Currently I'm setting it to
    new Date()
    but that comes from the client which might be not in sync with the server's time.
    d
    r
    • 3
    • 7
  • d

    Daniel Norman

    02/10/2021, 3:54 PM
    Hey all, In 15 minutes we’ll be hosting a live stream on load testing as part of a series on Prisma in production.

    https://www.youtube.com/watch?v=ZV01hyVR1yw&ab_channel=Prisma▾

    🦜 7
    👍 2
    ⏰ 5
    🔝 1
    prisma rainbow 8
  • c

    Chase Roossin

    02/10/2021, 11:54 PM
    If I had a model that had relationship (1-m)... is there a way to query count of M and if I am one of those? I guess what is the most efficient way to deal with the following problem? I have a
    Post
    that has relationship to many
    Likes
    - When retrieving many posts... what is the most efficient way to see how many likes its got and if you are on of those likes. Seems like you would need several queries? Does anyone have an example of the most performant way to do this?
    👀 1
    r
    • 2
    • 5
  • p

    Pedro Fellipe

    02/11/2021, 12:26 AM
    guys i was doing the tutorial and find this, i think the correct is 'apollo-server'. I dont know where to report
    a
    • 2
    • 3
  • m

    Martïn

    02/11/2021, 7:14 AM
    Just found this beautiful write-up by Reed Barber on freeCodeCamp about Building a YouTube Clone with React (+ Prisma handling the data layer) : https://www.freecodecamp.org/news/build-youtube-with-react/
    fast parrot 4
    💯 7
    prisma green 7
    prisma rainbow 3
    ✨ 3
    react 3
  • m

    mxstbr

    02/11/2021, 11:47 AM
    👋 I just launched my new premium SaaS product boilerplate, Bedrock! 🎉https://bedrock.mxstbr.com It comes with Prisma prisma dark & Nexus nexus in combination with TypeScript typescript, GraphQL Codegen graphql and urql already preconfigured to perfection, so I figured y'all would enjoy it 😉 If you have any questions about it, feel free to ping me here — I'm around!
    💯 11
    graphql 7
    🦜 4
    🎉 1
    prisma cool 8
    typescript 5
    prisma rainbow 7
    🚀 1
    prisma green 8
    nexus 6
    n
    m
    • 3
    • 2
  • r

    Ralf Vogler

    02/11/2021, 3:38 PM
    Are nested selects supported/planned? I can include the relation and filter it on the client, but a 'select as' would be nicer.
    r
    • 2
    • 11
  • s

    Sébastien Dubois

    02/11/2021, 4:08 PM
    Hello everyone. Is it possible to instruct the prisma CLI to generate TS string enums instead of string unions types for enums?
    r
    • 2
    • 3
  • d

    Dustin

    02/11/2021, 5:24 PM
    Hey guys, is it possible to run a prisma migration and pass the database URL as a cli argument?
    👀 1
    r
    • 2
    • 3
  • c

    Chip Clark

    02/11/2021, 5:26 PM
    ERROR: Error parsing connection string: Conversion error: Invalid JDBC token in ... `sqlserver://SQLAM11,4411;database=MDD_Test;user=app_user;password=Xx/Xx/Xx' I get this error when running: npx prisma introspect I do NOT get this error when running: npx prisma generate schema.prisma: generator client {   provider        = "prisma-client-js"   previewFeatures = ["microsoftSqlServer", "nativeTypes"] } datasource db {   provider = "sqlserver"   url      = env("DATABASE_URL")   }
    j
    j
    • 3
    • 5
  • i

    Ivan Lukianchuk

    02/12/2021, 2:44 AM
    I tried pushing my nextJs site to vercel and it failed with some error saying: Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again. Is this not somehow done automatically, or how to do I make vercel do it? it also said check out this url, which wasn't too helpful: https://github.com/prisma/prisma-client-js/issues/390
    r
    • 2
    • 17
  • m

    Maciek K

    02/12/2021, 10:11 AM
    Hi. I'm about to migrate one app from prisma 1 to prisma 2. As I have failed to recreate production prisma server with database on my localhost to do a test migration, I will try a different approach. I have currently three services on prisma server. Postgres schemas in one dbs (just like Prisma 1 generated it) •
    app_1/prod
    (The one we are migrating along with the one below) •
    app_1/dev
    (yes, im usually developing the app while accesing the remote prisma server, not localhost prisma) •
    app_2/prod
    (This one will probably stay forever on Prisma1) My idea is to do the migration on
    app_1/dev
    and if everything goes smooth, do the same on
    app_1/prod
    My questions: Is this a good approach, or should i try once more to recreate the prisma server on localhost? And the most important question: While doing migration work on the
    app_1/dev
    schema, will the other schemas in db be affected by it? Will anything collide? What about the
    management
    schema? Anything to worry here while doing the migration in that way? Thanks!
    n
    • 2
    • 3
  • l

    Leonard

    02/12/2021, 9:09 PM
    👋
  • y

    Yucheng

    02/14/2021, 2:16 AM
    👋 Hey quick question on using Prisma with nextjs. I see a lot of examples using the PrismaClient directly in getServerSideProps. I am wondering how this is secure since getServerSideProps is sometime ran on the client side. Doesnt this mean our DB is exposed on the frontend?
    e
    r
    • 3
    • 3
  • v

    vnadygin

    02/14/2021, 2:25 PM
    Hello guys. I am looking for some solution to add cache to the backend. I am using nexus with prisma. I found that my queries are quite heavy and with 500+ concurrent requests response time is more than 10 seconds. Any way I can add redis cache or memcache? Cannot find any solutions
    m
    r
    • 3
    • 2
  • b

    Bradly Locking

    02/14/2021, 11:04 PM
    Hey all. It would by great to pick anyone's brain who has managed to successfully implement Prisma1 and extended it to support GraphQL unions and interfaces?
1...416417418...637Latest