Exclude certain schemas/tables from connection (postgres)
I have naming conflicts between two schemas in the same postgres database.
x.Project and y.Project
become Project and Project1 (although, I believed these would get prefixed with [schema]_ in case of an conflict, which I could live with - but still not great)
My initial thought was that I could just create a new postgres role/user which does not have privileges on schema "y" because I'm not interested in anything under schema "y". Instead I can still see all the tables under schema "y".
So, is there no option to exclude certain schemas/tables from being scaffolded and visualized in the left side menu or something similar I can do to get rid of this naming conflict?
Comments
Are you using the EF Core driver in LINQPad 7? (If so, the scaffolding for Postgres is done by EF Core rather than LINQPad.)
Thanks for a swift response.
Yes, I'm using the EF Core driver in LINQPad 7.
If I'm not misstaken I believe the dbscaffold in EF (if that's what you are using) can accept a --schema parameter, but I suppose you are not using that, so this is probably spiraling towards a feature request
To acheive this, will I then have to scaffold my own DbContext and feed that to LinqPad through "Use a typed data context from your own assembly" in the "Add connecton" wizard?
Yes, that will work
Thank you so much.
One final thing. Will I need to compile my own custom assembly to use the the scaffolded DbContext or can I reference an EF Core assembly that LinqPad uses under the hood?
If that assebly exists, where can I find that?
If not, do you have any documentation for how to build a custom assembly for EF Core 6/7 db context?
See https://www.linqpad.net/EntityFramework.aspx