I am building dbt models using multiple database connectors that my organization uses for many cases. We also use CRDB which is the only database not supported by dbt in my organization.
My problem is when trying to create a view or a table using a CRDB connection I get the following error:
I tried searching on Google which led me to this open GitHub issue:
But I did not understand how other people’s solutions can be implemented correctly in a heavy-data organization.
Our CRDB is the center of the organization. We already made full migration to dbt with Airflow. This is our last milestone.
Encountered an error:
Database Error
there is already a transaction in progress
As you’ve probably discoverered, dbt has the concept of adapters to convert from the high level constructs (create a table, drop a view…) that it expects to the warehouse-specific DDL that each one needs.
In a pinch, you can try connecting with the Postgres adapter but apparently there are some incompatibilities between Postgres and CRDB.
One other idea: given that your error message is (sorta) about concurrency, you could try running dbt with a single thread only (dbt run --threads 1) before trying to make an adapter - I don’t think it’ll work but worth validating!