tcurdt
tcurdt
Explore posts from servers
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
ok ... that is recent 🙂
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
drizzle supports views?
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
that does feel counter intuitive to me though ... it seems aggregating as early as possible should scale better ... but that's really just my unsubstantiated gut feeling 🙃
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
interesting ... sounds like I need to read up on that difference ... first time I am trying it like that also curious to see if there is a big difference in the execution plan
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
but I still don't quite understand the why that approach works and my previous approach doesn't
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
man, your utility functions are golden. thanks for those.
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
no no, not the _ .. but the T itself if it isn't even used. ...and I also get an type warning despite
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
]
}
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
]
}
but that sounds more like an eslint config issue.
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
I don't quite get this
[P in PGCastTypes]: P extends `${infer _T}[]` ? P : never;
[P in PGCastTypes]: P extends `${infer _T}[]` ? P : never;
Why the _T?
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
But shouldn't this also work with an IN operator?
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
why is there a casting problem?
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
tagData.tags should be an array and selectedTags also is an array
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
and TBH I don't fully understand why is doesn't yet.
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
I wished the where.push(inArray(tagData.tags, selectedTags)); would just work
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
Thanks for the help. I would have never figured that out by myself.
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
Any idea, @Raphaël M (@rphlmr) ⚡ ?
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
Here we go! That's most stripped down version that still shows it. https://drizzle.run/g9pjwezeysxkxsfh6d83ayye
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
I'll try to reproduce it in playground. That's probably the easiest.
39 replies
DTDrizzle Team
Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
The tagData is a CTE which gives a type error for inArray that says "no overload matches the call". And then the query errors out with
PostgresError: malformed array literal: "tag2"
PostgresError: malformed array literal: "tag2"
with selectedTags being [ "tag2" ]
39 replies
DTDrizzle Team
Created by tcurdt on 10/12/2024 in #help
custom datatypes
anyone?
2 replies
DTDrizzle Team
Created by Reizel on 10/12/2024 in #help
How to update/insert id of a reference when I have a different constraint
Doing it for many items would have been a very important detail to mention. This sounds like you want a CTE. Not sure whether drizzle supports that yet. https://www.reddit.com/r/webdev/comments/18mhecm/how_can_i_write_sql_ctes_in_drizzleorm_for/ https://github.com/drizzle-team/drizzle-orm/issues/2078 Would be interesting what actually sql queries prisma generates from that "upsert".
8 replies