This is a migrated thread and some comments may be shown as answers.

Switch Database

3 Answers 81 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rainwalker
Top achievements
Rank 1
Rainwalker asked on 24 Aug 2012, 07:13 AM
Hi, I'm new to Open Access. Planning to build an app using it. Question: Is it possible to switch database, say from mssql to postgresql, simply just change the connection string?

3 Answers, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 28 Aug 2012, 03:25 PM
Hello Rainwalker, 

This is a feature we are currently working on and it is already available if you use the Fluent API. So here are some things you need to consider before trying out a multiple database backends scenario:

  1. You need to have the same database schema created on both servers, Postgresql and MySQL. You can use OpenAccess to create the schema for you if you prefer using the model-first approach.
  2. The obstacle that needs to be solved in such multiple-backend scenarios is usually the SQL types that are different for the different backends. You need not to use actual SQL types when you define your mapping via Fluent API, but you need to employ the abstract mapping approach which describes the SQL types that you would like to map to, but allows OpenAccess to decide which is the most appropriate in the correct backend. This way, OpenAccess will know that a unicode string should be mapped to an NVARCHAR in SQL Server and to a NVARCHAR2 in Oracle for example.

We are working on allowing such backend-independent type mapping in the Visual Designer as well, which would allow a user to use multiple backends with one .rlinq file, but that is not possible for the moment.

Kind regards,
Zoran
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
0
Barry1
Top achievements
Rank 1
answered on 16 Mar 2015, 06:34 AM
Hi Zoran,
I found your post
[quote]Zoran said:Hello Rainwalker, 

This is a feature we are currently working on and it is already available if you use the Fluent API. So here are some things you need to consider before trying out a multiple database backends scenario:

  1. You need to have the same database schema created on both servers, Postgresql and MySQL. You can use OpenAccess to create the schema for you if you prefer using the model-first approach.
  2. The obstacle that needs to be solved in such multiple-backend scenarios is usually the SQL types that are different for the different backends. You need not to use actual SQL types when you define your mapping via Fluent API, but you need to employ the abstract mapping approach which describes the SQL types that you would like to map to, but allows OpenAccess to decide which is the most appropriate in the correct backend. This way, OpenAccess will know that a unicode string should be mapped to an NVARCHAR in SQL Server and to a NVARCHAR2 in Oracle for example.
We are working on allowing such backend-independent type mapping in the Visual Designer as well, which would allow a user to use multiple backends with one .rlinq file, but that is not possible for the moment.
[/quote]
and I'd like to hear, if with actual Versions there are maybe new ways of beeing backend-independend?
Greets and thanks in advance
Bastian
0
Kaloyan Nikolov
Telerik team
answered on 18 Mar 2015, 05:05 PM
Hello Bastian,

The information given from my colleague is still valid. Telerik Data Access supports database independent mapping only if it is code first fluent mapping. This article describes in more details how this can be achieved. For the time being we don't have plans to make this feature available in the visual designer. 

Should you have any further questions do not hesitate to get back to us. 

Regards,
Kaloyan Nikolov
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
Data Access Free Edition
Asked by
Rainwalker
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Barry1
Top achievements
Rank 1
Kaloyan Nikolov
Telerik team
Share this question
or