Switch Database

4 posts, 0 answers
  1. Rainwalker
    Rainwalker avatar
    1 posts
    Member since:
    Jul 2011

    Posted 24 Aug 2012 Link to this post

    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?
  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 28 Aug 2012 Link to this post

    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!
  3. DevCraft banner
  4. Barry1
    Barry1 avatar
    1 posts
    Member since:
    Mar 2015

    Posted 16 Mar 2015 in reply to Zoran Link to this post

    Hi Zoran,
    I found your post
    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.

    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
  5. Kaloyan Nikolov
    Admin
    Kaloyan Nikolov avatar
    118 posts

    Posted 18 Mar 2015 Link to this post

    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.
     
Back to Top