Haaxor1689
Explore posts from serversDTDrizzle Team
•Created by Haaxor1689 on 7/27/2024 in #help
sqlite create new db file push programatically
Hi, I'm using
better-sqlite3
with drizzle
in my electron project and for my use case, I have some binary format data that my app can read, and I'd like to make an export to a new sqlite .db
file. I have the schemas and everything set up but I want to take the db file path from user input and just create new one on the spot and fill it with data. Is there a way to push my schema to this db file programatically just like drizzle-kit push
does normally?6 replies
Transferring huge buffer
I'm using tRPC with superjson serializer in an Electron app. I have a router querry that loads an png image, parses it with
sharp
and sends it as a buffer to client to render inside canvas. For larger files (62MB) I'm getting a Invalid array length
error from superjson though. Can you think of a way to work around this issue?7 replies
Report progress of mutation
I'm using tRPC in a electron app and am running a nodeWorker from main thread. Is there a way to report partial progress to
useMutation
in renderrer thread? I know I could use subscription but is this possible with mutation?7 replies
setMutationDefaults for optimistic updates
I have a
preferences
router, with a get
query and a set
mutation. I had optimistic updates set up in the onSuccess of the useMutation hook, wherever I used it, like this:
Now that I'm adding more and more instances where I need to use the set
endpoint, I don't want to copy paste the onSuccess
for optimistic updates. There is the setMutationDefaults
function of query client that would be ideal for this but it isn't working.
Is this not working in tRPC wrapper because it's not setting the mutationKey
or am I doing something wrong? Like I could make a wrapper hook for this mutation but using these defaults seems to me like much cleaner solution.5 replies