Rhys
Rhys
Explore posts from servers
DTDrizzle Team
Created by Rhys on 9/23/2023 in #help
Weird number overflow behavior between two database types
I am dumb salute For anyone else who runs into this problem, in your MySQL2 connection set supportBigNumbers: true
mysql.createPool({
supportBigNumbers: true,
uri: dbUrl,
}),
mysql.createPool({
supportBigNumbers: true,
uri: dbUrl,
}),
4 replies
DTDrizzle Team
Created by Rhys on 9/23/2023 in #help
Weird number overflow behavior between two database types
Upon diving into the drizzle code a fair bit, I think this may be a MySQL2 issue not a Drizzle issue
4 replies
DTDrizzle Team
Created by Rhys on 9/15/2023 in #help
Planetscale swapped the order of Primary Key Relation
Having some way to control the order of the foregin keys would be helpful though for this scenario - I tried
sql`PRIMARY KEY (`userId`, `serverId`)`/
sql`PRIMARY KEY (`userId`, `serverId`)`/
on a whim and that didn't work
3 replies
DTDrizzle Team
Created by Rhys on 9/15/2023 in #help
Planetscale swapped the order of Primary Key Relation
Actually I don't think this is a Drizzle issue, I think this is just the first time I'm pushing with Drizzle to a database that was made before Drizzle
3 replies
DTDrizzle Team
Created by Themion on 7/25/2023 in #help
Is there any tip for unit testing with drizzle?
https://github.com/AnswerOverflow/AnswerOverflow/blob/main/.github/workflows/github-actions.yml Here’s a code base reference, that’s the GitHub action file which starts up a docker compose file and has the database urls set, you just gotta start the containers, set the environment variables, and run it like normal
17 replies
DTDrizzle Team
Created by Themion on 7/25/2023 in #help
Is there any tip for unit testing with drizzle?
Don’t clear the database after each test run and disable threading, I’ve done that before and that’s really slow What I do is use random ids so that there’s no conflicts and have my tests run against an actual database https://github.com/AnswerOverflow/AnswerOverflow/tree/main/packages/db Here’s my project it’s open source so you can see how it all works
17 replies
DTDrizzle Team
Created by dandyDandelion31156 on 6/27/2023 in #help
Support for unsigned integers
at the moment im using unsigned for the bitfield column although that doesn't actually make a difference since it's the same number of decimal places 😅 unsigned would also make sense for storing discord snowflakes as unsigned bigints since there's no reason to store them as signed, unless there's a risk of the value overflowing with JS not expecting a value that large
13 replies
DTDrizzle Team
Created by dandyDandelion31156 on 6/27/2023 in #help
Support for unsigned integers
Found a workaround from: https://www.answeroverflow.com/m/1141819615467556929 https://github.com/drizzle-team/drizzle-orm/issues/818
const unsignedInt = customType<{
data: number;
// I also tried this ↓ https://orm.drizzle.team/docs/custom-types#examples
// notNull: true;
// default: true;
}>({
dataType() {
return 'int unsigned';
},
});
const unsignedInt = customType<{
data: number;
// I also tried this ↓ https://orm.drizzle.team/docs/custom-types#examples
// notNull: true;
// default: true;
}>({
dataType() {
return 'int unsigned';
},
});
13 replies
DTDrizzle Team
Created by dandyDandelion31156 on 6/27/2023 in #help
Support for unsigned integers
also interested in being able to use an unsigned integer with drizzle and if there's any workarounds existing atm - thanks!
13 replies
DTDrizzle Team
Created by Rhys on 6/7/2023 in #help
Migrating from Prisma to Drizzle - What would be helpful to track for a before / after?
Good to know thanks, prepared statements also look pretty interesting I hadn’t seen those yet
7 replies
DTDrizzle Team
Created by Rhys on 6/7/2023 in #help
Migrating from Prisma to Drizzle - What would be helpful to track for a before / after?
For the driver part in a long running connection, I.e the discord bot would it make sense to do a different driver than the HTTP planetscale driver? My understanding is the planetscale driver is great for serverless funcs since you skip the connection parts but since the bot is long running that may not be as big of a deal
7 replies
DTDrizzle Team
Created by Rhys on 6/7/2023 in #help
Migrating from Prisma to Drizzle - What would be helpful to track for a before / after?
Yeah I and @ꨄJolt have both played around with it and have enjoyed the experience, bit of learning to do going back to writing SQL but none of the queries on the project are that complex
7 replies