Closed masaya-kato63 closed 1 year ago
What about the --exclude
option?
https://github.com/k1LoW/tbls/blob/e043006da266cbf918b3a8f4cff9e8bffd6f002d/cmd/doc.go#L236
--exclude
seems to work as expected in such scenario, at least when specified in the tbls.yml
:
exclude:
# DB Schema owned by hasura
- hdb_catalog.*
However, it doesn't exclude the stored procedures from being generated, which is probably relevant to this comment as well.
Perhaps I am not understanding what you are looking for. If you could give me an example of a "specific schema and the state you want to achieve" that would be helpful.
Should I use any extensions?
@k1LoW @av Thank you for your confirmation. Sorry I missed the exclude option. Finally, I would like to ask about how to write exclude, is it possible to write exclude tables other than the public schema table? I don't want to list options like --exclude "repack.*" for each schema I want to exclude.
is it possible to write exclude tables other than the public schema table?
Try using --include 'public.*'
$ tbls out github://k1LoW/tbls/sample/postgres/schema.json -t json | jq .tables[].name
"public.users"
"public.user_options"
"public.posts"
"public.comments"
"public.comment_stars"
"public.logs"
"public.post_comments"
"public.post_comment_stars"
"public.CamelizeTable"
"public.hyphen-table"
"administrator.blogs"
"backup.blogs"
"backup.blog_options"
"time.bar"
"time.hyphenated-table"
"time.referencing"
$ tbls out github://k1LoW/tbls/sample/postgres/schema.json -t json --include 'public.*' | jq .tables[].name
"public.users"
"public.user_options"
"public.posts"
"public.comments"
"public.comment_stars"
"public.logs"
"public.post_comments"
"public.post_comment_stars"
"public.CamelizeTable"
"public.hyphen-table"
Thank you for teaching me.
I would also like to see an exclusion setting for the tbls doc command. PostgreSQL extensions often automatically create schemas and tables over which the user has no control. (e.g. pg_repack). I would like to exclude those schemas and tables.