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

[ 功能建议 ] 建议在oracle查询表结构时,加一个注释列 #1032

Closed
czxin788 opened this issue Feb 25, 2021 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@czxin788
Copy link
Contributor

目前遇到的问题/使用障碍

在查询oracle表的结构时,不能看到字段注释,不方便。

希望如何解决/实现它

在oracle.py里面加个b.comments字段,即可显示出来

def describe_table(self, db_name, tb_name, **kwargs):
"""return ResultSet"""
# https://www.thepolyglotdeveloper.com/2015/01/find-tables-oracle-database-column-name/
sql = f"""SELECT
a.column_name,
data_type,
data_length,
nullable,
data_default,
b.comments
FROM all_tab_cols a, all_col_comments b
WHERE a.table_name = b.table_name
and a.owner = b.OWNER
and a.COLUMN_NAME = b.COLUMN_NAME
and a.table_name = '{tb_name}' and a.owner = '{db_name}' order by column_id
"""
result = self.query(db_name=db_name, sql=sql)
return result

效果如下截图:
image

@LeoQuote
Copy link
Collaborator

大佬直接提 pr 吧

@stale
Copy link

stale bot commented Jun 4, 2021

你已经很久没有回复这个issue了,如果没有进一步的信息的话, 会作为不活跃issue关闭, 感谢你对本项目的贡献。
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 4, 2021
@stale stale bot closed this as completed Jun 18, 2021
@hhyo hhyo reopened this Jun 21, 2021
@stale stale bot removed the wontfix This will not be worked on label Jun 21, 2021
@hhyo hhyo added enhancement New feature or request wontfix This will not be worked on labels Jun 21, 2021
@stale stale bot removed the wontfix This will not be worked on label Jun 21, 2021
@hhyo hhyo closed this as completed Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants