tcurdt
Explore posts from serversDTDrizzle Team
•Created by tcurdt on 10/16/2024 in #help
inArray not working as expected
This works but looks like a (sql injection)
const tagsArray = selectedTags.map((tag) =>
'${tag}'
).join(', ');
where.push(sql${tagData.tags} @> ARRAY[${sql.raw(tagsArray)}]::text[]
);
Why doesn't this just work (tm)?
where.push(inArray(tagData.tags, selectedTags));39 replies
DTDrizzle Team
•Created by tcurdt on 10/12/2024 in #help
custom datatypes
Let's say I have
but I want to shorten this to
textArray()
. I'd assume this should be as easy as
but what is the correct type?
Especially when looking at more complicated shorthands like
I can't get it to be a transparent pass through as ref()
does not allow for adding notNull()
.
Any pointers for reducing the verbosity with some helper functions?2 replies
DTDrizzle Team
•Created by tcurdt on 10/9/2024 in #help
PgColumnBuilderBase and notNull()
holy mother of types ... could someone help me out here?
OK:
id: ref(sometable.id)
KO: id: ref(sometable.id).notNull()
Is there a base type or interface I can use that does include notNull()
and friends?2 replies
DTDrizzle Team
•Created by tcurdt on 10/8/2024 in #help
Unclear docs on bigserial mode
Unfortunately the docs are not clear here:
Is there a way to always use mode 'number'?
3 replies
DTDrizzle Team
•Created by tcurdt on 10/8/2024 in #help
Wrong docs on casing
The docs chat bot suggests this but that seems wrong
Where can I specify the rule for the column aliases?
Right now it's a lot of noise
responseId: bigint('response_id')
21 replies
DTDrizzle Team
•Created by tcurdt on 9/24/2024 in #help
Generate drizzle model from database
I have a postgres database and I am wondering if there is a way to generate the typescript table declarations from the database.
I didn't find anything in the drizzlekit docs about this.
2 replies
DTDrizzle Team
•Created by tcurdt on 5/29/2024 in #help
schema validation enforcement
The above schema is nice and well - but how can I enforce that
email
actually only allows to store strings that are emails?
So I looked at drizzle-zod
but it looks like I would have to define the schema twice?
There is no way to attach this to the table schema itself?
What about using postgres constraints?
https://www.postgresql.org/docs/current/ddl-constraints.html1 replies
CDCloudflare Developers
•Created by tcurdt on 2/27/2024 in #pages-help
Cloudflare pages very slow
Cloudflare has become very(!) slow for me.
Before I was just proxying my VPS.
To remove this from the equation I moved the site(s) directly to Cloudflare pages.
Unfortunately this did not help much.
Sometimes I am still looking at only 40-100Kbytes/sec for some images.
It takes so long that Lighthouse times out.
I tried from various locations.
What is going on?
How can I track down this down?
7 replies
DTDrizzle Team
•Created by tcurdt on 7/19/2023 in #help
accessing results of a select
I am confused. Based on this docs https://orm.drizzle.team/docs/crud this here
todos
should be an array of objects. But it seems to be
What am I missing?9 replies