FreeBSD 14 - Help!
```[Davenk@s2]:<~/domains/firetickets.davenk.serv00.net/public_nodejs/public>$ npx prisma generate
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
...
Dependency-dependents relations
I am having difficulty understanding whether my schema is correct, even if it reports no errors. It's basically that I'm trying to express a package registry as part of a package manager, and am having difficulty specifying
dependencies
and dependents
relations as part of the PackageVersion
model.
```prisma
model PackageVersion {
id BigInt @id @default(autoincrement())...Does Prisma Postgres support logical replication to work with Electric SQL?
Hi guys , does Prisma Postgres support logical replication? I am trying to use Electric SQL with Prisma Postgres. Any ideas if that is possible or not at this stage?
Sveltekit not receiving real-time data
Hello devs , i was trying to add real time events in my sveltekit app and with the release of prisma pulse and prisma postgreSQL so i added these features to my app but i had problem with prisma pulse , when i create a new DB i receive events when a change happens only in a short period of time and it stops working and i'm not having any error , in my pluse dashboard it says Replication slot status
Unavailable idk if it means something , and this is my code , it will be nice of you if you take a look maybe i was doing things not in the right way
```
//api/+server.js
import { prisma } from "$lib/index.js";...
Nestjs Prisma extension
Hi everyone
I'm trying to fill the
code
field with a custom nanoid()
with only uppercase letters and numbers, but when I do the $extends
with my logic, I have two problems:
- I think my custom nanoid()
isn't working
- Typescript is complaining because I didn't fill the code on the .create
...nixos and prisma
There doesn't seem to be any support. is the correct way to go about it to compile manually for nixos?
how to return the number of pages when doing pagination?
If I'm taking 20 results for each page, how do you also return the total of pages in the same query?
Repeating the query without pagination?
🧐...
prisma generate --sql and seeding
Hi,
How can I use raw SQL to seed my database in Prisma?
I would like to use the new SQL feature, but it seems to not work well with nested folders. ( prisma > sql > [version] > seed > [file].sql )
Also, I tried to read the content of SQL files, but I don't know why, when they are read, they aren't syntactically correct anymore to be called in executeRawUnsafe....
About recommended connection pool size
vm cpu: 15
prisma: 6.1.0
mysql 8.0.18
mysql max_connections: 4030
...
Handle auto filter base on status of model (prisma and nestjs)
In my project, I have some roles, they are Student, Lecture, and Admin. I also have some model with status.
Status = enum(Public, Private, Archive)
Role= enum(Student, Private,Public)
...
Join a column with multiple tables.
I want to store all media in the system in a central table. Now the associated resource of the media can be anything, like chat, project, ticket, etc.
So I have a Media model like this
```
model Media {
id String @id ...
Using a JSON field as an id
Hello! I want to cache API results in the database and I was wondering if it'd be possible to use the
id
in the JSON field as an id, perhaps through @@id
or some client extension?Solution:
Hello @PIat 👋
You could store the API result in a JSON field and also store the ID you want to use in a separate field marked as
@id
. However it won't be possible to skip having an id
field altogether.
You can use a client extension to manipulate the data before saving it to the database. So essentially, getting the id
from JSON and using the same value in the actual id
column..."Something went wrong, please try again" ERROR
I cant use prisma pulse with superbase Database connection string
i keep getting this error and dont know why
"Something went wrong, please try again"...
Query Performance
Hello, I wonder if there's any way to disable the extra SELECT queries made during updates.
For example: This is the query I'm using to update a player.
```ts...
P3006 error I cannot run npx prisma migrate
this is the error
``
Error: P3006
Migration
20241223102808_init` failed to apply cleanly to the shadow database....TypedSql Array Parameter for Postgres
I am attempting to use array parameters as inputs to my queries, but when I generate the client I get the following error:
Error: SQL documentation parsing: invalid type: 'Int[]' (accepted types are: 'Int', 'BigInt', 'Float', 'Boolean', 'String', 'DateTime', 'Json', 'Bytes', 'Decimal')
at '{Int[]} $1:groupIds Array of group IDs to process'.
...
Executing data migration/data field seed script for a migration automatically
I did a quick search on the topic but didn't find any concrete solution I can use and it is quite the everyday case. Basically, I need to introduce a new required field in my db (postgres). The recommended solution is the expand-contract pattern where I first introduce the field as optional, then seed the data and then make it required in 2 separate migrations. For the data seeding aspect, I see a couple of options: default value in schema (which can reduce the migrations to 1), modify the migra...