Exclude all tables except specific table
I have a database where I want to exclude all tables from the auth schema, except auth.users. This database also has tables in other schemas that I want to be included.
I tried
# .tbls.yml
include:
- * # also `"*"`, `'*'`, `"**/*"` as well as removing this line
- auth.users
exclude:
- auth.*
However, this causes all output to be excluded, producing an empty output.
- How can I exclude all tables in the
authschema, exceptauth.users? - How can I include all other tables when using an
includesection? (*does not seem to work when used alone)
Environment
tbls 1.56.2- OS
Debian bullseye - Shell
bash
exclude: and include: are shown in the following figure.

ref: https://github.com/k1LoW/tbls#filter-tables
How can I exclude all tables in the auth schema, except auth.users?
There may be no other way but to list.
How can I include all other tables when using an include section? (* does not seem to work when used alone)
tbls will target all tables even if nothing is specified. If the table you want is not output, it may not be included in the range of the DSN given to tbls.
Could you provide a schema (DDL) and DSN example ?
Hm, i guess that if it is not possible to include specific tables when using a general exclude, there is no point in doing
include:
- "*"
If i skip the include section and use specific excludes, things work as expected, so I don't think an example is necessary. However, if I were to rephrase my question into a feature request:
Right now, logic is
- Add tables from
include - Remove tables from
exclude - Result
As a user, I would expect the logic to be
- Add tables from include
- Remove tables from exclude
- Check for
include/excludeoverlaps - If include is more specific than exclude (i.e.
schema.MyTable>schema.*orschema.MyT*>schema.*), include the table(s). If include is equally or less specific than exclude, exclude wins. - Result
If include is more specific than exclude (i.e. schema.MyTable > schema.* or schema.MyT* > schema.*), include the table(s). If include is equally or less specific than exclude, exclude wins.
This logic is not included now. But it looks good to me.