skip to main content
Using Data Sources : Enabling OData Access for a Data Source

Enabling OData Access for a Data Source

Use the Schema Map editor to enable OData support for a Data Source. If a schema map is not defined, the OData API can't be used to access the data source.
Using the Schema Map Editor to generate the OData mapping is highly recommended. In some rare cases, manually generating or editing the JSON string might be required. However, this is an advanced use case.
Note: When making changes to the OData schema map or other OData configuration options, set the Data Source Caching parameter to 0. If Data Source Caching is enabled (set to 1), you may need to wait for the current cached configuration to expire before the new configuration is seen. It can take up to 10 minutes after the last OData query against a data source for the cached configuration to expire and the new configuration becomes visible.
1. In the left navigation panel, click Data Sources to open the Data Sources view.
2. Click Data Sources in the left navigation panel. The Data Sources page opens.
*To create a new data source, see Creating a Data Source Definition.
*To enable OData for an existing data source edit the data source by clicking the name of the data source in the list.
The Create Data Source dialog opens. Note: To set up a data source for data stores behind a firewall, you must first install and configure an On-Premise Connector. See Using DataDirect Cloud On-Premise Connector for more information.
3. On the General tab, enter the login credentials required for the data store.
4. On the OData tab, clear the OData Read Only check box to enable write operations. Select the check box if you do not want to allow write operations.
5. On the OData tab, click Configure Schema.
The Configure Schema wizard appears.
Initial Configure Schema screen
6. Select the schema that contains the tables that you want to expose through OData.
The Configure Schema definition window appears. You can filter the available tables to show all tables, or to show tables with primary keys or tables without primary keys. In the following figure, all tables are shown for a Google Analytics user. The Account table has a primary key (Primary Key). Because the primary key was designated in the database, the key is gold and cannot be changed.
Selecting tables in the Configure Schema wizard
7. Select the tables that you want to expose through the OData feed.
If the table does not have a column identified as a primary key, select one or more columns as primary keys. A primary key icon (Primary Key selected in the Configure Schema wizard) appears next to the selected column name.
8. Optionally, define the Singular and Plural values for entity names that are plural by default, such as Orders. OData uses the singular name to navigate entities and the plural name to house collections of data or entity sets. DataDirect Cloud automatically identifies the singular and plural names for each entity. If the entity name is already plural, this will cause a double pluralization, for example, Orders becomes Orderses. example of an entity name that is already plural, and the Singular and Plural fields that can specify alternate names
9. Click Save & Close to save your selections and close the Schema Editor. The choices you made appear in the Schema Map field as a JSON string the next time you open the Data Source.
If you selected a table that does not have a primary key, an error message appears. Select one or more primary keys, and then click Save & Close to save your selections.
Table with no primary key
10. Click the Update button to save the Data Source and cause the changes that you made to the OData schema map to take effect.