Using Microsoft Entity Frameworks to Access PostgreSQL Schema Objects with Virtuoso
This document details the steps required to provide Microsoft Entity Framework access to
Prerequisites
The following prerequisites must be in place for this solution to be possible.
PostgreSQL DBMS
A
ODBC Driver for PostgreSQL
A pgr8ma
will be assumed to exist on the machine hosting the Virtuoso Server.
Virtuoso Universal Server
A Virtuoso installation including the Virtuoso Universal Server and ADO.NET Entity Framework Provider is required. The Virtuoso components used must be Release 5.10.x or above, this being the minimum version containing support for Microsoft Entity Frameworks.
Microsoft Visual Studio 2008 SP1
Microsoft Visual Studio 2008 Service Pack 1 is required, this being the only version containing the necessary Entity Framework support available at the time of writing.
Tasks
Ensure PostgreSQL Primary Keys (PKs) are not nullable
The Visual Studio 2008 Entity Data Model (EDM) requires that all primary keys are NOT Nullable.
Visual Studio 2008 will fail to generate an EDM if any are.
Therefore, ensure any tables to be used are defined as not nullable in the
Install and configure OpenLink ODBC Driver for PostgreSQL
The Virtuoso Virtual Database engine uses ODBC as the connectivity mechanism for linking remote database objects into its local schema.
Thus, a
Installation instructions for the
Install and configure OpenLink Virtuoso Universal Server
Linking PostgreSQL tables into Virtuoso
Creating a Visual Studio hosted Entity Data Model (EDM)
Using EDM to create Entity Framework based applications
Now that a Microsoft Entity Data Model has been created for our
Entity Frameworks based ADO.NET Data Service
Visual Studio Windows Form Application
Referenced by...