P
Prisma5w ago
Zige

`queryCompiler` + `driverAdapters` returns string instead of string[]

Hi, I want to use the new queryCompiler with the driverAdapters. I installed, adapter, added the preview feature, but I get a strange behaviour. I have this schema:
model Rule {
id Int @id @default(autoincrement())
conditions String[]
topics String[]
}
model Rule {
id Int @id @default(autoincrement())
conditions String[]
topics String[]
}
Even eslint shows that the return type should be array of strings, but when I execute findMany (no filters) I get this object:
[
{
id: 5,
conditions: 'something',
topics: 'something',
},
{
id: 3,
conditions: 'something',
topics: 'something',
}
]
[
{
id: 5,
conditions: 'something',
topics: 'something',
},
{
id: 3,
conditions: 'something',
topics: 'something',
}
]
In DB (when I look there with pgAdmin4) there is one string in the array, but it sees it as an array. My code fails due to this behaviour and it worked in the past (before the previewFeatures). I want to map the array but I cannot because it fails due to the property not being an array. I tried adding more elements to the array in the DB and that resulted into one string with joined (,) two elements inside... (topics: 'something,something1',) I am not an advanced dev so there might be my fault of course, but relying on the fact that it works just fine when I get back to no adapter and no queryCompiler, makes me feel there might be trouble in prisma.
3 Replies
Prisma AI Help
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into #ask-ai if you get antsy for a second opinion!
Zige
ZigeOP5w ago
I found gh issue with the same problem as mine: https://github.com/prisma/prisma/issues/27029 (there is no comment yet)
GitHub
[6.7.0] Bug: When using the queryCompiler feature, String[] fields ...
Bug description When querying array fields, the result returns a comma-separated string instead of a proper array of strings. Severity ⚠️ Major: Breaks core functionality (e.g., migrations fail) Re...
Nurul
Nurul4w ago
Thank you for sharing the link to existing Issue. I'll reproduce this issue. This is on our team's radar.

Did you find this page helpful?