Michael Schaufelberger
Explore posts from serversDrizzle pull/push: Permission denied for view pg_stat_user_indexes
Hi
Is there an update regarding this? After thinking about it, I'm not sure if
pgroll
having the diff / introspection abilities alone would be enough for a good DX.
There's an open GitHub issue where I've quickly written down my thoughts.
https://github.com/xataio/pgroll/issues/199#issuecomment-2841522734
Edit: I still have the same issue with the new database in our workspace.10 replies
Branch copy has old schema version
I've set up a new database in the meantime. Actually, back in February.
Is there anything I need to keep in mind when starting fresh?
Currently, I'm planning on creating an initial migration with Drizzle, turn that into a pgroll migration and run this migration as initial migration on a blank branch.
I've also created a new
blank
branch based on the initial main
branch to make sure I always have one without a history. I assume that's the way to go, right? Or is it possible to create a branch without a base branch?25 replies
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:
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.10 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
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...10 replies
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.10 replies
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.
25 replies
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
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?
25 replies
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
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.25 replies