BinaryArtifex
Explore posts from serversDTDrizzle Team
•Created by BinaryArtifex on 1/6/2024 in #help
how to add ulid compatibility to postgres?
Is there a way to create a custom ulid type with postgres to use as a primary key? it could either be automatically generated from the database side or passed in from the client. it was easy enough to create a custom type using mysql that was essentially just a char(26), however im trying to implement something a little closer to this article - https://blog.daveallie.com/ulid-primary-keys. any advice would be greatly appreciated. This is also in the context of having a supabase postgres instance.
2 replies
DTDrizzle Team
•Created by BinaryArtifex on 8/31/2023 in #help
help with a generic mysql2 connection
gday folks, im trying to create what is essentially a generic mysql2 connection that is compatible with planetscale but also compatible with a local msyql2 server running in docker, for instance...my production database is planetscale hosted and any sort of dev or testing i want to do locally. My connection at the moment is literally just
drizzle(connection, { mode: DB_MODE, schema })
however due to the sheer amount of options within the configuration im concerned im missing something crucial for the continued integration with planetscale with such a minimal config. granted the port, user, password, schema, etc are all in the uri, but is there anything else i should be considering?2 replies
DTDrizzle Team
•Created by BinaryArtifex on 7/31/2023 in #help
onDuplicateKeyUpdate ???
i don't suppose anyone knows how to actually use this method? zero documentation on it and the planetscale dbClient only recognises this method after the values function. There is no "onConflictDoUpdate" or "onConflictDoNothing"....i just want it so if there is an item with the same slug, ignore the query...
2 replies
DTDrizzle Team
•Created by BinaryArtifex on 7/29/2023 in #help
onConflictDoNothing does not exist on planetscale client
i am getting an "Property onConflictDoNothing does not exist on type" on the following script....
the client is a type of
PlanetScaleDatabase<typeof schema>
the only typesafe method i get is onDuplicateKeyUpdate
6 replies
DTDrizzle Team
•Created by BinaryArtifex on 7/29/2023 in #help
cannot set alias for composite primary key, getting (errno 1059) (sqlstate 42000) errors
My table has the following schema ->
when migrating to planetscale i get the following error ->
the generated sql produces this monster index for the composite primary key
how the heck can i set an alias for a composite primary key?
13 replies