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

Adding support for other schema(s) #2

Merged
merged 3 commits into from
Aug 17, 2021
Merged

Adding support for other schema(s) #2

merged 3 commits into from
Aug 17, 2021

Conversation

erlinghaugstad
Copy link

Schema name will be prepended to all schema(s) other than public. This will support having the same table name in public and in other schema(s).

Note that public will still not be appended to the tables in the public schema.

Erling Haugstad added 2 commits August 17, 2021 09:32
Schema name will be prepended to all schema(s) other than public. This will support having the same table name in public and in other schema(s).

Note that public will still not be appended to the tables in the public schema.
Some tables might contain sensitive implementation details or there might be use cases where they should be skipped for other reasons.
@koistya
Copy link
Member

koistya commented Aug 17, 2021

@erlinghaugstad amazing!

BTW, do you think we can rename includedSchemas to schemas?

In the future, we can allow excluding schemas like this:

  • updateTypes(db, {}) - generates types for the public schema only (default)
  • updateTypes(db, { schemas: ["public", "log"] }) - generates types for "public" and "log" schemas
  • updateTypes(db, { schemas: ["!log"] } - generates types for all schemas excluding "log"

@erlinghaugstad
Copy link
Author

Sure, i can fix your suggested change to inclusion/exclusion of schemas as well 👍🏻

I was pondering if public should always be included, or only by default and if you specify something you would have to include it. I guess that i still the case, and that it still makes sense.

Supporting both exclusion and inclusion of schemas with '!' the the negative operator.
@erlinghaugstad
Copy link
Author

Should all be in now, if this is a success 🤞🏻

@erlinghaugstad
Copy link
Author

One note, this should solve all except the last bullet point "..generates types for all schemas excluding...", should we wait until we need it?

@koistya
Copy link
Member

koistya commented Aug 17, 2021

@erlinghaugstad yep, agreed, excluding schemas can wait until we need it.

@koistya koistya merged commit 9f41581 into kriasoft:main Aug 17, 2021
koistya added a commit that referenced this pull request Aug 17, 2021
koistya added a commit that referenced this pull request Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants