Kasper
Kasper
DTDrizzle Team
Created by Hello, I’m Allie! on 5/3/2024 in #help
Delta Updates(somehow)?
Well it is possible to only push updates for rows/fields that need to be changed. But finding the rows/fields that has been updated is the hard part here. It's also outside the scope of Drizzle. If the data has a unique key you can identify in the db, you could do a fetch per row to compare and optionally update. But that will be a lot of querys to the DB. You would also have to set up logic for loading and processing the CSV files in chunks, so you don't run out of memory.
3 replies
DTDrizzle Team
Created by bernat on 5/4/2024 in #help
Typing type Table based on my schema
Do you have some example schema you could show? You can also read about how to use delete here: https://orm.drizzle.team/docs/delete
2 replies
TTCTheo's Typesafe Cult
Created by Paul on 4/22/2024 in #questions
Is Prisma ORM still slow?
Yeah, they also had a heavy GraphQL binary that has since been converted to JSON. But it still has some overhead that for example drizzle does not have. You can check that out here: https://orm.drizzle.team/benchmarks
11 replies
DTDrizzle Team
Created by TAINCER on 4/21/2024 in #help
Use schema definition as normal types
Do you mean like this?
// schema.ts

export const usersTable = mysqlTable('users', {
id: bigint('id', { mode: 'number', unsigned: true }).primaryKey(),
name: varchar('name', { length: 256 }).notNull(),
verified: boolean('verified').notNull().default(false),
});

export type User = typeof usersTable.$inferSelect;
export type UserInsert = typeof usersTable.$inferInsert;
// schema.ts

export const usersTable = mysqlTable('users', {
id: bigint('id', { mode: 'number', unsigned: true }).primaryKey(),
name: varchar('name', { length: 256 }).notNull(),
verified: boolean('verified').notNull().default(false),
});

export type User = typeof usersTable.$inferSelect;
export type UserInsert = typeof usersTable.$inferInsert;
3 replies
TTCTheo's Typesafe Cult
Created by Gold240sx on 4/21/2024 in #questions
UploadThing > other file storage??
Changing a logo on a site isn't really about which file uploader, but rather about how you do it. You would need a file uploader to upload the new logo. You would need a place to store the new URL for the new logo that can be updated dynamically, so maybe a DB? How would you handle it if the new logo is a different size? How would you make the uploader only accessible to the owner of the site, and not everyone? Making it this complex is most likely overkill, so IMO you should just upload the logo to the project files, and then change it manually if needed.
3 replies
TTCTheo's Typesafe Cult
Created by Samip Poudel on 4/21/2024 in #questions
Improving Next.js Monolith
Maybe a turborepo? https://turbo.build EDIT: I also feel like the check should be server-side, so it can be cached better and so on. I of course have not seen your app or code, but just a thought.
2 replies
TTCTheo's Typesafe Cult
Created by Alex on 4/21/2024 in #questions
nginx vs traefik vs caddy
I haven't been incentivized enough to move away from Nginx yet, it works for good enough for my use case. But I have heard and read good things about Caddy.
4 replies
TTCTheo's Typesafe Cult
Created by InfiniteCodeMonkeyTheorem on 4/21/2024 in #questions
How do I protect myself from assholes?
Theo has a sponsor called Upstash that also provides really easy rate limiting. Using it in a few projects now! (I'm not sposored) https://upstash.com/docs/oss/sdks/ts/ratelimit/overview
7 replies
DTDrizzle Team
Created by SirCameron on 7/17/2023 in #help
Fulltext index MySQL
@Andrew Sherman any news on fulltext indexing?
5 replies
TTCTheo's Typesafe Cult
Created by max14 on 8/7/2023 in #questions
Drizzle ORM schema not working
@thatbarryguy Why?
22 replies
TTCTheo's Typesafe Cult
Created by Benjamin on 8/9/2023 in #questions
Why the infered type of this function is `string | undefined`?
Yeah, because it cant know which of them is not undefined.
24 replies
TTCTheo's Typesafe Cult
Created by Benjamin on 8/9/2023 in #questions
Why the infered type of this function is `string | undefined`?
Yup
24 replies
TTCTheo's Typesafe Cult
Created by Benjamin on 8/9/2023 in #questions
Why the infered type of this function is `string | undefined`?
Not the best, but yeah
24 replies
TTCTheo's Typesafe Cult
Created by Benjamin on 8/9/2023 in #questions
Why the infered type of this function is `string | undefined`?
export const myFunction = ({ value1 }: { value1?: string }, value2?: string) => {
if (value1 && !value2) {
return value1
}

if (!value1 && value2) {
return value2
}

if (value1 && value2) {
return value2
}

throw new Error("No value provided.");
};
export const myFunction = ({ value1 }: { value1?: string }, value2?: string) => {
if (value1 && !value2) {
return value1
}

if (!value1 && value2) {
return value2
}

if (value1 && value2) {
return value2
}

throw new Error("No value provided.");
};
24 replies
TTCTheo's Typesafe Cult
Created by Mocha on 8/7/2023 in #questions
How to deploy API to Vercel
Have you looket at https://uploadthing.com/ ?
6 replies
TTCTheo's Typesafe Cult
Created by Quentin on 8/7/2023 in #questions
Drizzle vs. Prisma: why does Drizzle need less row reads?
26 replies
TTCTheo's Typesafe Cult
Created by Quentin on 8/7/2023 in #questions
Drizzle vs. Prisma: why does Drizzle need less row reads?
They do have something similar to prisma now
26 replies