> Does anybody know how to handle it? I saw that Teiid supports both views and Postgres data source...
If you cannot add it directly in the database the workaround is to add a teiid view selecting from the postgresql view and define a primary key there.
I am trying to expose data from multiple Postgres data models into Salesforce using Odata.
For this I am using Teiid spring boot starter.
I defined multiple data sources(one for each postgres db that contains relevant data for my OData consumer) - inside application.properties and also defined matching spring bean.
Now I want to define virtual view and expose only this virtual view as OData endpoint.
1. Is it possible to define virtual view in the old way using -vdb.xml with the spring boot starter? I want to keep my code very simple and not interested in adding extra java classes?
(saw the following in the Teiid spring boot documentation:
With Teiid Spring Boot, there is no need to use the any tooling, your application layer and View definition layer become one. The virtual View construction happens with Annotations in your Java code. It is exactly same steps as to defining Entity using JPA framework with couple extra annotations that are specific to Teiid.)
2. If it is possible, is this xml valid? assuming I have "principal" table in my data source
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb name="users" version="1">
<description>My virtual view above Postgres DBs</description>
<model name="Users" visible="false">
<source name="authenticationDataSource" translator-name="postgresql" connection-jndi-name="authenticationDataSource" />
<model name="UserView" type="VIRTUAL">
CREATE VIEW UsersView (
AS SELECT U.id, U.email FROM principal AS U;
Running my app and accessing localhost:8080/$metadata shows all the data sources as EntityTypes and many more entities(with the prefix "pg_catalog") but my virtual view isn't showed.
Directly adding the Dynamic VDB without need for the Java Classes to define a View is new feature I added couple weeks back to the code that is not released yet. You can see an example here . I hope to release this version of the code in next week or two, until then you fork and build locally and use it.
A primary key / unique constraint is still missing, you may want something like:
CREATE VIEW UsersView (
id string PRIMARY KEY,
I am using version 1.0.2-SNAPSHOT... isn't your code there?
Thanks Steven, I added this but I still can't see the view..
by the way, Is it possible to get read permissions to the gitbook documentation?
> Thanks Steven, I added this but I still can't see the view..
Any table / view with a primary key will be visible. Make sure you are looking under the right namespace / schema.
> by the way, Is it possible to get read permissions to the gitbook documentation?
Are you saying that you can't see the git project: GitHub - teiid/teiid-documents: Community documents for Teiid Engine and Teiid Server
Or you can't see the generated docs : teiid-documents | Community documents for Teiid Engine and Teiid Server - or links from the site Teiid Wildfly Documents | Teiid
Do you have estimation for version 1.0.2 release date?
We will be releasing Teiid 12 this week, the Spring Boot version will be released soon after that.