regclass error

I'm trying to deploy a MedusaJS(commerce platform) instance using Xata. There is an error during the migration process: MedusaJS tries to run:
SELECT
table_name,
table_schema AS schema_name,
(SELECT pg_catalog.obj_description(c.oid) FROM pg_catalog.pg_class c
WHERE c.oid = (SELECT ('"' || table_schema || '"."' || table_name || '"')::regclass::oid)
AND c.relname = table_name) AS table_comment
FROM information_schema.tables
WHERE "table_schema" NOT LIKE 'pg_%'
AND "table_schema" NOT LIKE 'crdb_%'
AND "table_schema" NOT LIKE '_timescaledb_%'
AND "table_schema" NOT IN ('information_schema', 'tiger', 'topology')
AND table_name != 'geometry_columns'
AND table_name != 'spatial_ref_sys'
AND table_type != 'VIEW'
AND table_name NOT IN (SELECT inhrelid::regclass::text FROM pg_inherits)
ORDER BY table_name
SELECT
table_name,
table_schema AS schema_name,
(SELECT pg_catalog.obj_description(c.oid) FROM pg_catalog.pg_class c
WHERE c.oid = (SELECT ('"' || table_schema || '"."' || table_name || '"')::regclass::oid)
AND c.relname = table_name) AS table_comment
FROM information_schema.tables
WHERE "table_schema" NOT LIKE 'pg_%'
AND "table_schema" NOT LIKE 'crdb_%'
AND "table_schema" NOT LIKE '_timescaledb_%'
AND "table_schema" NOT IN ('information_schema', 'tiger', 'topology')
AND table_name != 'geometry_columns'
AND table_name != 'spatial_ref_sys'
AND table_type != 'VIEW'
AND table_name NOT IN (SELECT inhrelid::regclass::text FROM pg_inherits)
ORDER BY table_name
And it results in the error on Xata side: invalid SQL: ERROR: relation "public.mikro_orm_migrations" does not exist (SQLSTATE 42P01) But the sql: SELECT * from public.mikro_orm_migrations returns the rows. So the table is there. The issue is probably caused by the "::regclass::oid" syntax that Medusa/its underlying ORM(Mikro-ORM) tries to run. Is this something Xata can/wants to support for non-dedicated databases?
1 Reply
cmck
cmck2d ago
Hi, thanks for reaching out. I believe you are correct regarding the ::regclass::oid being the issue here along with permissions and Xata's shared cluster architecture. Unfortunately, Xata does not actively support MedusaJS and we have no plans to do so in the near future.

Did you find this page helpful?