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

feat(frontend): add pg_catalog.pg_views and support \dv #6295

Merged
merged 4 commits into from
Nov 10, 2022
Merged

Conversation

HuaHuaY
Copy link
Contributor

@HuaHuaY HuaHuaY commented Nov 10, 2022

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

  1. add pg_catalog.pg_views.
  2. modify pg_catalog.pg_class to support \dv
  3. small refactoring in struct DatabaseManager and macro prepare_sys_catalog.

Notice

Because we mark all system catalogs as table in RisingWave, but PostgreSQL's system catalogs are divided into tables and views, the output of pg_views is different from PostgreSQL's. pg_views doesn't contain information about system catalogs.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.

Types of user-facing changes

Please keep the types that apply to your changes, and remove those that do not apply.

  • SQL commands, functions, and operators

Release note

  1. support \dv.
  2. add pg_catalog.pg_views(PostgreSQL's doc: https://www.postgresql.org/docs/current/view-pg-views.html).
    The view pg_views provides access to useful information about each view in the database.

Refer to a related PR or issue link (optional)

close #6118

Copy link
Contributor

@lmatz lmatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

#6118 My mistake, \dv actually does not go through pg_views 😅 but for other usage

Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Merging #6295 (b347461) into main (23880ab) will decrease coverage by 0.03%.
The diff coverage is 63.88%.

@@            Coverage Diff             @@
##             main    #6295      +/-   ##
==========================================
- Coverage   74.38%   74.34%   -0.04%     
==========================================
  Files         950      953       +3     
  Lines      153750   154348     +598     
==========================================
+ Hits       114360   114753     +393     
- Misses      39390    39595     +205     
Flag Coverage Δ
rust 74.34% <63.88%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/common/src/array/mod.rs 88.79% <ø> (ø)
src/common/src/types/chrono_wrapper.rs 62.56% <0.00%> (-5.73%) ⬇️
src/common/src/types/decimal.rs 75.63% <0.00%> (-4.96%) ⬇️
src/common/src/types/interval.rs 79.19% <0.00%> (-0.58%) ⬇️
src/common/src/types/mod.rs 66.04% <0.00%> (+2.05%) ⬆️
src/common/src/types/to_binary.rs 0.00% <0.00%> (ø)
src/connector/src/sink/mod.rs 0.00% <0.00%> (ø)
...rc/connector/src/source/kafka/enumerator/client.rs 0.00% <0.00%> (ø)
...ntend/src/catalog/system_catalog/pg_catalog/mod.rs 0.00% <0.00%> (ø)
src/frontend/src/lib.rs 40.00% <ø> (ø)
... and 25 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mergify mergify bot merged commit daf3ea3 into main Nov 10, 2022
@mergify mergify bot deleted the zehua/pg_views branch November 10, 2022 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support pg_views
3 participants