Michael Schaufelberger
Michael Schaufelberger
Explore posts from servers
TtRPC
Created by Michael Schaufelberger on 11/27/2024 in #❓-help
Hydration error when using useQuery instead of useSuspenseQuery when prefetching
Nope, not yet unfortunately. Some findings: - If I delay the SSR after prefetching significantly (e.g. sleeping right after the prefetch for 4s so the prefetch can complete), the error goes away. This basically means, that if the promise is resolved already, it works. - If I delay the query's output significantly, so the prefetch cannot be done in time, the error goes away. - Everything else, is very prone to the hydration mismatch. I.e. it happens close to 100% of the time. Upgrading to the latest for the trpc and react-query packages did not work. As of now, that is:
"@tanstack/react-query": "^5.66.11",
"@tanstack/react-query-devtools": "^5.66.11",
"@trpc/client": "11.0.0-rc.819",
"@trpc/react-query": "11.0.0-rc.819",
"@trpc/server": "11.0.0-rc.819",
"@tanstack/react-query": "^5.66.11",
"@tanstack/react-query-devtools": "^5.66.11",
"@trpc/client": "11.0.0-rc.819",
"@trpc/react-query": "11.0.0-rc.819",
"@trpc/server": "11.0.0-rc.819",
Edit: This is the case if I use query.isFetching btw. I just need to use this, because I also want to change the table's behavior in case of a refetch. But this shouldn't matter for the initial render afaik.
5 replies
Aarktype
Created by Michael Schaufelberger on 2/7/2025 in #questions
[attest] Getting `requested module ... does not provide an export` error for my bench script
Thank you. Yeah that's the case. Sorry for wasting your time. Coincidentally, I've never ran any script in this project that had references to an internal monorepo package before. 🤦‍♂️ For anyone finding this: Do not forget "type": "module" in your workspace package's package.json and you need to use verbatimModuleSyntax (in your whole project) for tsx to be able to run everything 😅
3 replies
XXata
Created by Michael Schaufelberger on 1/24/2025 in #help
Drizzle pull/push: Permission denied for view pg_stat_user_indexes
Hi cmck Thanks for looking into it. I've found that drizzle-kit uses the pg_stat_user_indexes to find all indexes in the db. https://github.com/drizzle-team/drizzle-orm/blob/e5c63db0df0eaff5cae8321d97a77e5b47c5800d/drizzle-kit/src/serializer/pgSerializer.ts#L1572-L1583 But afaik this runs for all the tables found FROM pg_catalog.pg_class c if the relkind = 'r' (https://github.com/drizzle-team/drizzle-orm/blob/e5c63db0df0eaff5cae8321d97a77e5b47c5800d/drizzle-kit/src/serializer/pgSerializer.ts#L985-L1002). Which returns just the public's schema tables when drizzle-kit runs it. Maybe that helps...
9 replies
XXata
Created by Michael Schaufelberger on 1/24/2025 in #help
Drizzle pull/push: Permission denied for view pg_stat_user_indexes
Hi I'm still experiencing this issue with test-template2. It's not high-prio, since I can use drizzle-kit generate for the time being - but I would love to quickly get a "diff" of the schema versions using drizzle.
9 replies
XXata
Created by Michael Schaufelberger on 1/17/2025 in #help
Branch copy has old schema version
That would be great! Thank you 🙏
20 replies
XXata
Created by Michael Schaufelberger on 1/17/2025 in #help
Branch copy has old schema version
Okay, thanks! We'll see what we do.
20 replies
XXata
Created by Michael Schaufelberger on 1/17/2025 in #help
Branch copy has old schema version
A quick follow-up question.
You'd have to use a new database and maybe dump and import the schema.
What's the simplest way to achieve this so we don't generate too many migrations again? Someone in our team changed the schema too soon, using the ui, making the branch stay in a bad state. So we want to tackle this issue rather sooner than later.
20 replies
XXata
Created by Michael Schaufelberger on 1/24/2025 in #help
Drizzle pull/push: Permission denied for view pg_stat_user_indexes
Thank you!
9 replies
XXata
Created by Michael Schaufelberger on 1/17/2025 in #help
Branch copy has old schema version
Thanks for the info. 👍
20 replies
XXata
Created by Schahin on 12/29/2024 in #help
pgroll with drizzle generated migrations - possible?
To @Schahin and anyone finding this I had a similar issue a while ago. I think Xata is actively working on something where you can turn sql files into xata migrations. https://github.com/xataio/pgroll/issues/504 With that you probably will be able to quite easily create pgroll migrations whenever you run drizzle's generate.
4 replies
XXata
Created by Michael Schaufelberger on 1/17/2025 in #help
Branch copy has old schema version
Okay, thanks! Is there a way to squash the migration history? I think I've read this somewhere in a pgroll issue, but am not sure if it's applicable or even possible. Can we maybe just create a new dev branch where we create the schema ourselves, e.g. by using DBeaver or Drizzle? Or would this have a similar issue?
20 replies
TtRPC
Created by Michael Schaufelberger on 1/15/2025 in #❓-help
How do *you* structure the tRPC router when dealing with isolated components?
Thank you for the insight. I think splitting the namespace or even the router is a good idea. So I can better know which procedures are from isolated/deeply nested components.
5 replies
TtRPC
Created by sh03 on 12/12/2024 in #❓-help
Simplifying SSR (e.g. in Next.JS)
Hi @sh03 Have you found a solution to this?
5 replies
XXata
Created by Michael Schaufelberger on 1/17/2025 in #help
Branch copy has old schema version
FYI: I will now directly alter the schema for test-template2 using PSQL while you are investigating (to work on what i need to work on :P). OK?
20 replies
XXata
Created by Michael Schaufelberger on 1/17/2025 in #help
Branch copy has old schema version
Interesting. I've just created test-template2 and it had the same issues. Then I've tried a completely new name, I'm sure never existed something-new and both those branches are missing the new columns. It seems that it's not about the target's branch name, but there's an issue reading the base branch.
20 replies
XXata
Created by Michael Schaufelberger on 1/17/2025 in #help
Branch copy has old schema version
Oh, sorry, didn't mention that. column eventSeries.languages does not exist
20 replies
XXata
Created by Michael Schaufelberger on 12/3/2024 in #help
Cannot install Xata CLI in Linux using the script or homebrew
No description
5 replies
XXata
Created by Michael Schaufelberger on 11/22/2024 in #help
Xata Dashboard error when trying to delete a file
To share a little context, we had a lot of difficulty integrating Files with the Native SQL Table, which is why we introduced the toggle so you can flip between the "old" and "new" table.
This makes sense. Although, currently, the Native SQL Table is unusable if you have a single file field in the table you want to edit. Editing is basically blocked until you switch the setting. May I make a suggestion to skip/block updating the file fields when having the setting enabled? So we can at least edit the other fields.
17 replies
TtRPC
Created by Rule on 11/27/2024 in #❓-help
tRPC 404 in Next.js API Routes
That's fine. Glad I could help!
10 replies
TtRPC
Created by Rule on 11/27/2024 in #❓-help
tRPC 404 in Next.js API Routes
and remove the createContext from mine. i think that's optional
10 replies