RaphaelEtim
PPrisma
•Created by яσчαℓтℓя on 11/20/2024 in #help-and-questions
TypeError: The "payload" argument must be of type object. Received null
Hi @яσчαℓтℓя
Can you please enable detailed debugging and share the relevant logs?
https://www.prisma.io/docs/orm/prisma-client/debugging-and-troubleshooting/debugging
2 replies
PPrisma
•Created by Naveen MC on 11/18/2024 in #help-and-questions
Best way to look for text in a deeply nested JSON?
Thanks for sharing your solution 🚀
9 replies
PPrisma
•Created by Naveen MC on 11/18/2024 in #help-and-questions
Best way to look for text in a deeply nested JSON?
Hi @Naveen MC
For PostgreSQL, you could use the
jsonb_path_query_array
function, which allows you to search across all possible locations in the JSON field. For example:
This query searches for the term "Rocket" case-insensitively across all string values in the JSON structure, regardless of their location or nesting level.9 replies
PPrisma
•Created by davidpink on 11/9/2024 in #help-and-questions
Error when updating Record
We have identified the root cause and have prioritize this issue. I'll provide an update once the fix is rolled out by the engineering team.
12 replies
PPrisma
•Created by Julian IncrEdelman on 11/17/2024 in #help-and-questions
Tracing / OTEL only works with manual active spans.
Thanks for raising this. The reproduction will be helpful for me to share with the engineering team so that they can take steps to fix it.
7 replies
PPrisma
•Created by Jvwer on 11/19/2024 in #help-and-questions
FindUnique/Update using unique index on sub field
Hi @Jvwer
Currently, there is no direct way to make this 'self-made' index available for unique filtering operations. We do have an open issue that discusses the possibility of allowing unique fields on related models to be used in queries, which is similar to your use case with nested fields.
4 replies
PPrisma
•Created by Mathias on 11/19/2024 in #help-and-questions
Concurrent request (Prisma)
@Mathias You could look at wrapping your insert operation in a transaction with the
Serializable
isolation level. This ensures that concurrent operations are executed as if they were run serially, reducing the chance of duplicate inserts.
This section of the documentation might help
https://www.prisma.io/docs/orm/prisma-client/queries/transactions#transaction-timing-issues8 replies
PPrisma
•Created by Mathias on 11/19/2024 in #help-and-questions
Concurrent request (Prisma)
Hi @Mathias
Have you seen the guide on Optimistic Concurrency Control ? This would involve adding a version field to each entry that increments with every update. With this setup, you can implement checks in your update logic, ensuring that only a single version is active.
8 replies
PPrisma
•Created by Naveen MC on 11/18/2024 in #help-and-questions
Best way to look for text in a deeply nested JSON?
Hi @Naveen MC
Since the JSON field has an unpredictable structure, i think using database specific JSON search function through either raw query of typedsql should work. This would also allow search across all possible locations in the json field.
9 replies
PPrisma
•Created by Julian IncrEdelman on 11/17/2024 in #help-and-questions
Tracing / OTEL only works with manual active spans.
Thanks for confirming, do you have a reproducible example you can share?
7 replies
PPrisma
•Created by Julian IncrEdelman on 11/17/2024 in #help-and-questions
Tracing / OTEL only works with manual active spans.
Hi @Julian IncrEdelman
What version of Prisma are you using? We recently released version 5.22.0 which fixed some of the bugs associated with tracing.
7 replies
PPrisma
•Created by Israel Santos on 11/16/2024 in #help-and-questions
Dynamic Database Name Support in Studio
Hi @Israel Santos
Currently, Prisma doesn't have a built-in feature to dynamically switch databases within Studio as you've described. One workaround is to use environment variable to dynamically set the database URL using dotenv-cli. For example:
1. You will create an env file
.env.TENANT_000050
. In this file, you will add the database URL for that tenant.
2. You will create another env file .env.master
. In this file, you will add the database URL for that master.
3. Install dotenv-cli
Then you can issue the command below to start studio for the tenant.
Note: I’m considering making a fork or opening a PR to implement this directly in the Studio interface. I think having an input field to dynamically change the database name via the browser would be a fantastic productivity booster.Prisma Studio is free software but not OSS so you won't be able to fork it as the repo is private. You can however submit a feature request and document your usecase so that our engineering team can take a look.
2 replies
PPrisma
•Created by Ankit-kashyap on 11/13/2024 in #help-and-questions
No migrations file in the source code but build is getting failed
Great to hear it's resolved now.
4 replies
PPrisma
•Created by Ankit-kashyap on 11/13/2024 in #help-and-questions
No migrations file in the source code but build is getting failed
4 replies
PPrisma
•Created by piscopancer on 11/15/2024 in #help-and-questions
`Prisma.skip` seen as `undefined`?
Hi @piscopancer
I can see you are using the latest version of Prisma client which should allow you to use
Prisma.skip
. I'm not sure why it isn't working as expected within your react native setup. Could you please open an issue here.5 replies
PPrisma
•Created by piscopancer on 11/15/2024 in #help-and-questions
narrow down String type using prisma client's extension?
Prisma does not have built-in support for defining string union types directly in the schema. You could consider using an enum
4 replies
PPrisma
•Created by Seb on 11/14/2024 in #help-and-questions
mongo dates without JS Date object?
i think you should be able to use unix timestamp. you may also need the $numberLong operator.
To insert a unix timestamp, i think this could work
8 replies
PPrisma
•Created by Seb on 11/14/2024 in #help-and-questions
mongo dates without JS Date object?
You should also be aware that using
$runCommandRaw
can result in date strings instead of ISODate objects, which might cause issues when querying later. You should be able to workaround it by using the $date operator as mentioned here https://github.com/prisma/prisma/issues/14815#issuecomment-19025715928 replies
PPrisma
•Created by Seb on 11/14/2024 in #help-and-questions
mongo dates without JS Date object?
Hi @Seb
You can use use
$runCommandRaw
method for this. This should allow you to insert datetime values without explicitly converting each timestamp in your code.8 replies
PPrisma
•Created by Seb on 11/14/2024 in #help-and-questions
using mongo -- insert document without any checks whatsoever?
Hi @Seb
Would Json type work for your usecase? You can define a JSON field in your Prisma schema to store additional, unstructured data. This allows you to insert extra values without strictly matching the schema.
4 replies