My organization uses postgres Schemas for tenant isolation.
As such, we need to be able to dynamically connect to a requested schema; when using raw npgsql, we can just add SearchPath=tenant, and interact with tables directly. because this changes the connection string it forces npg to pool the connection properly.
However, going through RepoDb, we hit PostgreSqlDbHelper.GetFields, which explicitly retrieves the schema from the table attribute or static value on DbSettings.
That means if I've set the searchPath to something other than public, it will still look for the fields in public, find nothing, and throw.
if it was possible to provide an instance rather than static value of the schema, it would be possible to pass or set the desired schema when constructing Repositories.
Describe the enhancement
My organization uses postgres Schemas for tenant isolation.
As such, we need to be able to dynamically connect to a requested schema; when using raw npgsql, we can just add SearchPath=tenant, and interact with tables directly. because this changes the connection string it forces npg to pool the connection properly.
However, going through RepoDb, we hit PostgreSqlDbHelper.GetFields, which explicitly retrieves the schema from the table attribute or static value on DbSettings.
That means if I've set the searchPath to something other than public, it will still look for the fields in public, find nothing, and throw.
if it was possible to provide an instance rather than static value of the schema, it would be possible to pass or set the desired schema when constructing Repositories.