Page 1 of 1
PostgreSQL Switching schemas based on user
Posted: Fri 13 Feb 2015 12:47
Hello all.
I got the following need.
I got 1 database with multiple schemas in the form
MyDB.
schema_1
MyDB.
schema_2
MyDB.
schema_3
user1 is assigned to client1
user2 is assigned to client2
user3 is assigned to client3
All schemas above got the same exact table structure and relations (copy).
How can I enforce Entity Framework and Entity Developer to ignore the schema part in Model.edml
For example:
schema_3
Code: Select all
<EntitySet Name="message_tags" EntityType="DataEntities.Store.message_tag" store:Type="Tables" Schema="schema_3" Table="message_tag" />
and switch schema prefix at runtime according to the user connected?
Re: PostgreSQL Switching schemas based on user
Posted: Mon 16 Feb 2015 14:49
by Shalex
[email protected] wrote:How can I enforce Entity Framework and Entity Developer to ignore the schema part in Model.edml
Please open your *.edml model in Entity Developer (stanalone or integrated in Visual Studio), navigate to Tools > Entity Developer > Model Explorer > *.Store > Tables/Views, select all your tables and views, press F4 (properties) and clear the value in their Schema property.
[email protected] wrote:and switch schema prefix at runtime according to the user connected?
Just change the connection string of your context.
Re: PostgreSQL Switching schemas based on user
Posted: Mon 16 Feb 2015 16:08
Shalex wrote:[email protected] wrote:How can I enforce Entity Framework and Entity Developer to ignore the schema part in Model.edml
Please open your *.edml model in Entity Developer (stanalone or integrated in Visual Studio), navigate to Tools > Entity Developer > Model Explorer > *.Store > Tables/Views, select all your tables and views, press F4 (properties) and clear the value in their Schema property.
[email protected] wrote:and switch schema prefix at runtime according to the user connected?
Just change the connection string of your context.
Hi,
Thanks for your answer, about the edml part of the question , I was actually asking if there is a way for it to be ignored by the Devart Entity library. That is because I have changed the connection string in the context -at runtime- to switch between schemas but it ignores it to the one defined in the edml.
Re: PostgreSQL Switching schemas based on user
Posted: Tue 17 Feb 2015 09:48
by Shalex
[email protected] wrote:I was actually asking if there is a way for it to be ignored by the Devart Entity library
Yes, there is a such way with the IgnoreSchemaName option:
http://www.devart.com/dotconnect/postgr ... tions.html. Does this help?
Re: PostgreSQL Switching schemas based on user
Posted: Tue 22 Mar 2016 17:05
by aKhan1
I am using the Devart Version 4.5.901.0 and I cant find see the Schema or IgnoreDboSchemaName properties. Can you please direct me to which file do I need to look at or if I use the Entity developer, how to navigate to that property? Thanks
Re: PostgreSQL Switching schemas based on user
Posted: Wed 23 Mar 2016 17:35
by Shalex
aKhan1 wrote:I cant find see the Schema or IgnoreDboSchemaName properties. Can you please direct me to which file do I need to look at or if I use the Entity developer, how to navigate to that property?
These options are available in our Entity Framework implementation. About LinqConnect, we have answered you in this thread:
http://forums.devart.com/viewtopic.php?t=33407.