Zen
Zen
Explore posts from servers
TtRPC
Created by Zen on 5/10/2023 in #❓-help
Caching(?) previous data until query returns new data
nevermind, found it. There's a flag you can put on the query keepPreviousData:true - https://tanstack.com/query/v4/docs/react/guides/paginated-queries#better-paginated-queries-with-keeppreviousdata
3 replies
DTDrizzle Team
Created by Zen on 5/7/2023 in #help
Replace on Insert
for reference onDuplicateKeyUpdate worked! My final code looked something like this:
db.insert(TestingTable)
.values(values)
.onDuplicateKeyUpdate({
set: {
fizz: sql`values(fizz)`,
buzz: sql`values(buzz)`,
fizzBuzz: sql`values(fuzz_buzz)`,
updatedAt: sql`values(updated_at)`,
},
});
db.insert(TestingTable)
.values(values)
.onDuplicateKeyUpdate({
set: {
fizz: sql`values(fizz)`,
buzz: sql`values(buzz)`,
fizzBuzz: sql`values(fuzz_buzz)`,
updatedAt: sql`values(updated_at)`,
},
});
10 replies
DTDrizzle Team
Created by Zen on 5/7/2023 in #help
Replace on Insert
yup the REPLACE is what I'm used to using in SQL. I've never used ON DUPLICATE KEY UPDATE in SQL before, I'll check it out now - hopefully that's what I need!
10 replies
DTDrizzle Team
Created by Zen on 5/7/2023 in #help
Replace on Insert
though I'm again reminded how postgres is the superior database!
10 replies
DTDrizzle Team
Created by Zen on 5/7/2023 in #help
Replace on Insert
Sorry I wasn't clear - I'm using mysql-core which doesn't have the onConflictDoUpdate chain
10 replies