Issue with Drizzle ORM and drizzle-kit push with Tembo Cloud PostgreSQL

Hello everyone,

I'm currently working on a project using Drizzle ORM with PostgreSQL hosted on Tembo Cloud. My PostgreSQL database has the pg_stat_statements extension installed by default. I'm encountering an issue when trying to push my schema changes using drizzle-kit.

Issue:

When I attempt to push my schema changes using drizzle-kit, I receive a warning about dropping pg_stat_statements and pg_stat_statements_info tables, which would cause data loss. Here are the relevant outputs:

 Warning  You are about to execute current statements:

DROP TABLE "pg_stat_statements_info" CASCADE;
DROP TABLE "pg_stat_statements" CASCADE;
ALTER TABLE "tbl_users" ADD CONSTRAINT "tbl_users_id_unique" UNIQUE("id");

 Warning  Found data-loss statements:
· You're about to delete pg_stat_statements_info table with 1 items
· You're about to delete pg_stat_statements table with 109 items

THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED

Do you still want to push changes?
❯ No, abort
  Yes, I want to remove 2 tables,


Question:

How can I prevent Drizzle ORM from attempting to drop these pg_stat_statements tables? I've tried using the tablesFilter and extensionsFilters settings, but it doesn't seem to work as expected. Any guidance or suggestions would be greatly appreciated!

Repository:

You can find the project repository here: next-graphlq-clerk-drizzle-all-in-one

Thank you in advance for your help!
image.png
image.png
GitHub
Contribute to jacksonkasi1/apollo-graphql-clerk-drizzle-psql development by creating an account on GitHub.
Was this page helpful?