Dani
Dani
Explore posts from servers
XXata
Created by Dani on 4/28/2025 in #help
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?
2 replies
CDCloudflare Developers
Created by Dani on 8/19/2024 in #pages-help
"Fail open" question
If "Fail Open" mode is active (Pricing | Cloudflare Pages docs)
Once the daily request limit has been reached, Projects in fail open mode will bypass the Function and prevent it from operating on incoming traffic. Incoming requests will behave as if there was no Function, and pass through to the site’s static assets. This is the default configuration for all Pages projects.
I understand from the documentation that my _worker.js file would not be seen as a static asset, but what about if my _worker.js file imports some others files? For example, given the following _routes.json:
{
"version": 1,
"include": [
"/*"
],
"exclude": [
"/assets/*",
"/"
]
}
{
"version": 1,
"include": [
"/*"
],
"exclude": [
"/assets/*",
"/"
]
}
And the following directory structure:
├── _routes.json
├── _worker.js
├── assets
│ ├── chunks
│ │ └── some-public-file.js
│ └── static
│ └── some-public-file.css
├── index.html
└── server
├── imported-by-_worker.js
└── some-other-private-file.js
├── _routes.json
├── _worker.js
├── assets
│ ├── chunks
│ │ └── some-public-file.js
│ └── static
│ └── some-public-file.css
├── index.html
└── server
├── imported-by-_worker.js
└── some-other-private-file.js
In this case, in “Fail open” mode, can the content of server folder be visible, or does it still respect _routes.json? Will pages publicly serve my server-side source code(server directory) when an out-of-quota request is made to, for example /server/imported-by-_worker.js?
5 replies