Michael Schaufelberger
Explore posts from serversHow can I get data from a different table when adding a column? - Multi Schema Migrations
Hi 👋
Say I want to store a user's full name inside a post. For this, I would add a column to the
posts
table userFullName
using pgroll:
How can I make sure pgroll fills the new column with the data of the user? Can I do something like this?
Edit:
I'm getting an error if I try this:
unable to execute start operation: failed to create trigger: pq: syntax error at or near "SELECT"
8 replies
FetcherError: Internal Error
Hi 👋
When trying to write to our non-postgres DB, we are currently getting the cryptic error:
How can we identify the cause? We currently cannot write to the database anymore (Edit: for some requests, some others still seem to work).
20 replies
What is good practice with Xata's (Multi-version Schema) Migrations?
For now, we have used mainly Drizzle Kit for our migration needs. However, we are at a point where we would like to use Xata's Multi-Version schema feature.
What's a good workflow that allows for good DX and safe migrations?
With "normal" Xata migrations, every single schema change is a migration and results in its own file. This is suboptimal DX since during development you may have to add a field, rename it and delete it again until you have found the best schema for a feature and have many files in the end that are difficult to review.
Do you have any experience/recommendations on how we could handle the experimentation vs. migration phase?
Multi-version Schemas have a lifecycle. Is this something we can use to solve this problem?
I need to be honest that I don't know how other tools handle it.
4 replies
Issues connecting to the database
Hi
We are currently experiencing issues when connecting to the Postgres database on eu-central.
Mainly, schema changes are not working. But we also had disconnects when reading data or rather when trying to connect to read data.
Is there currently something unstable?
Username:
5713tr
27 replies
Vercel connections timeout when using a transaction
Hi
We are using Drizzle together with the TCP Pool pg client.
I have also tried
which just makes at least the serverless function not run until its own timeout is reached.
However, the serverless function times out when we want to use a transaction. This only happens when deployed to Vercel.
I tried to check how many connections we have using pgAdmin. But there are none, which I think we are just not allowed to see, because my current one should show up.
How can I use transactions on Vercel using Drizzle? This is currently a major blocker.
I read some threads here of a 40 connection limit. When reading stuff like this https://neon.tech/docs/connect/connection-pooling#connection-pooling it makes me question if Xata can even handle TCP in serverless functions.
Would a dedicated Cluster solve this issue?
7 replies
`xata pull <branch>` results in a high number of migration files - Safe to ignore?
This happens after running migrations or pushes with Drizzle. I have been testing different data models and now have over 200 migration files. Is it safe to ignore the folder since we are planning on running all migrations with Drizzle anyways?
4 replies
Re-executing Drizzle Kit push fails after successful push
I'm getting the following error:
PL/pgSQL function "xata.pg_catalog".regnamespace(text) line 14 at RAISE
Is this an error with Xata or Drizzle? It loks like Xata.
Also, I'm not referencing publics
anywhere. Which seems like a typo?15 replies
Can we use ULIDs without a dedicated cluster?
We are looking for some solution between a Postgres serial and a long UUID. So ULIDs are a natural choice. I would use something like https://github.com/geckoboard/pgulid or https://github.com/pksunkara/pgx_ulid.
But without a dedicated cluster we cannot create types/functions. So is there another way to use ULID-like IDs?
I've seen that
select ('rec_'::text || (xata_private.xid())::text)
produces a similar result. Can we use this for the foreseeable future for our own ID fields?5 replies