Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

查询库表字段信息 #695

Closed
Xuxin19960702 opened this issue Mar 29, 2024 · 2 comments
Closed

查询库表字段信息 #695

Xuxin19960702 opened this issue Mar 29, 2024 · 2 comments

Comments

@Xuxin19960702
Copy link

Description

想要查询库表的字段和字段的comment。

sql语句如下:
SELECT column_name, column_comment FROM information_schema.columns WHERE table_schema = 'your_database_name' AND table_name = 'your_table_name';

自己测试尝试了已有语法的组合,并未实现此功能,特地来请教大佬。

@TommyLemon
Copy link
Collaborator

数据库基础属性表已提供:
Table -> information_schema.tables
Column -> information_schema.columns

当然也可以在 Access 表里注册下:
table='tables', alias='Tables'
table='columns', alias='Columns'

image

http://apijson.cn/api/?send=true&type=JSON&url=http%3A%2F%2Fapijson.cn%3A8080%2Fget&json={%22[]%22:{%22Column%22:{%22@column%22:%22column_name%2Ccolumn_comment%22,%22@schema%22:%22information_schema%22,%22table_schema%22:%22sys%22,%22table_name%22:%22Comment%22}},%22@explain%22:true}

可以在 APIAuto 网页抓包看到对 MySQL, PostgreSQL, Oracle, SQLServer 等主流数据库详细的 表、字段 属性等查询 JSON
#85 (comment)

@Xuxin19960702
Copy link
Author

懂了,感谢大佬!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants