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

Feature: Hide the View Definition script in HTML output #310

Closed
MizdaCollinz opened this issue Apr 18, 2018 · 6 comments
Closed

Feature: Hide the View Definition script in HTML output #310

MizdaCollinz opened this issue Apr 18, 2018 · 6 comments

Comments

@MizdaCollinz
Copy link

(Feature Request)

It would be useful to be able to disable the view definition SQL script from being displayed in the HTML output as I would prefer if this underlying information was not visible when I provided documentation on my views.

Alternatively if there is an easy way to achieve this I'm open to suggestions

@MizdaCollinz MizdaCollinz changed the title Hide the View Definition script in HTML output Feature: Hide the View Definition script in HTML output Apr 18, 2018
@npetzall
Copy link
Member

Could you write a more detailed explanation as to why one would want to hide the source of the data in a view.

I can see a scenario where there are multiple tables that contains a specific column name, so when looking at a view without definition I'm unable to know which table is the source of data.

@npetzall
Copy link
Member

There is, what I think is a really simple hack, way to achieve this.

You could override the sql to fetch view Definition and make sure it returns zero rows or an empty definition.

If you let me know which database Type I could try to provide you an example.

@MizdaCollinz
Copy link
Author

I'm providing views on tables in a different schema and would like to abstract the details of how the views are created from what they are providing to the user of the views, thanks I'll look into that approach

@npetzall
Copy link
Member

As an exampleI think this should work for mysql but the principal applies to all database types.

New file mysql-noviewdefs.properties with following content:

extends=mysql
selectViewsSql=select table_schema as view_catalog, null as view_schema, table_name as view_name, view_definition, null as view_comment from information_schema.views where table_schema=:schema and 0=1

And finally use the database type when running -t mysql-noviewdefs

@npetzall
Copy link
Member

@MizdaCollinz You also have the option to exclude view entirely with -noviews

@rafalkasa This shouldn't be hard to implement, should we?

@npetzall
Copy link
Member

Same solution as in #410 can be used, by changing the template.

@npetzall npetzall closed this as completed Nov 1, 2018
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