Read table metadata
Tools read metadata to discover tables and columns. This page shows supported information_schema queries for an existing listener.
Before you run it: SHOW forms are refused. Do not assume ORM schema synchronization or every discovery query is compatible.
Metadata means information about the table, not its customer rows. The queries below look for namespace shop and table orders; change those filters to the namespace and table you actually created. An empty catalog result can mean the filter names do not match.
- Name the intended tableFilter for the actual namespace and table.
- Query catalog viewsRead supported columns, keys and constraint information.
- Compare the tool's needsCheck which discovery requests the ORM makes.
- Declare models where neededConfigure explicit fields when automatic discovery is unsupported.
Follow the example
- Connect with the documented permissions.
- Run the catalog queries.
- Compare results with your tool’s requirements.
- Declare models explicitly when automatic discovery is unsupported.
Supported catalog queries
Five views, served by the same shared catalog the other wire protocols read: tables, columns, table_constraints, key_column_usage, referential_constraints.
-- List the tables in a schema.
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'shop';
-- Describe one table's columns.
SELECT column_name, data_type, is_nullable
FROM information_schema.columns
WHERE table_schema = 'shop' AND table_name = 'orders';
-- Constraints, and the columns they cover.
SELECT constraint_name, constraint_type FROM information_schema.table_constraints
WHERE table_name = 'orders';
SELECT constraint_name, column_name FROM information_schema.key_column_usage
WHERE table_name = 'orders';Unsupported catalog queries
SHOW TABLES; -- refused
SHOW DATABASES; -- refused
SHOW COLUMNS FROM orders; -- refused
SHOW CREATE TABLE orders; -- refused
SHOW INDEX FROM orders; -- refused
SHOW WARNINGS; -- refused
SHOW VARIABLES LIKE 'sql_mode'; -- refusedThe refusal is deliberate, and it is the safer of the two options. The shared front door carries a compatibility shim for a different protocol that answers any SHOW x with a single fabricated row reading x = 'on'. Left alone, SHOW TABLES would return that row: a confident, wrong answer. Refusing at the dialect boundary turns it into an error you can see.
Configure the ORM explicitly
// Safe: you tell the ORM the shape, it never asks the database.
const Order = sequelize.define(
"Order",
{
id: { type: DataTypes.STRING, primaryKey: true },
customer: DataTypes.STRING,
total_cents: DataTypes.INTEGER,
status: DataTypes.STRING,
},
{ tableName: "orders", timestamps: false, freezeTableName: true },
);
// Not safe on this listener - each of these introspects with SHOW:
// await sequelize.sync();
// await sequelize.getQueryInterface().describeTable("orders");
// await sequelize.getQueryInterface().showIndex("orders");
// Also not available: associations. Model the join in your query instead of
// asking the ORM to follow a relation for you.
// Order.belongsTo(Customer); // will not loadCheck compatibility before adoption
This listener suits explicitly declared ORM models and the documented single-table queries. Association loading is not supported. For other operations, check the SQL endpoint. Current PostgreSQL database logins remain read-only; they do not provide universal ORM parity.
MySQL is a registered trademark of Oracle Corporation and/or its affiliates. OriginChainDB is not affiliated with, endorsed by, or sponsored by Oracle Corporation. OriginChainDB implements a compatible wire protocol so that existing MySQL clients can connect to it; it does not distribute MySQL software.
Expected result
Supported views return table, column and constraint information.