skip to main content
Using the driver : Configuring the relational map
  

Try DataDirect Drivers Now

Configuring the relational map

The Autonomous REST Connector maps JSON responses to a relational model, exposing your REST data to relational, SQL-based applications. The driver supports two methods for mapping data: using the Sample property to map a single endpoint, and using an input REST file to define one or more endpoints. Which method you use depends on the characteristics of your session. If any of the following apply to your session, you will need to create an input REST file:
*Accesses multiple endpoints
*Issues POST requests
*Accesses endpoints that require paging
*Accesses endpoints that use custom HTTP headers
*Uses custom HTTP response code processing
*Requires a custom authentication flow
If none of these characteristics apply, you can use either method.
Sample property method
When using the Sample property, the driver issues a query to the endpoint specified with the Sample property at connection. The results of the query provide a sample of the data, which are then inspected by the driver and used to infer a schema. Using the Sample property method requires minimal configuration, but offers limited functionality compared to the input REST file method. For more information on configuring this method, see "Using the Sample property method."
Input REST file method
In addition to being able to specify multiple endpoints for your session, the input REST file method also allows you to define POST requests, configure paging, and define additional customizations described in "Creating an input REST file." To use this method, you will need to create an input REST file, which is a simple text file that contains a comma separated list of endpoints. After you create the file, you will need to specify its location using the Config property.
See "Creating an input REST file" for a full description of the syntax used in the REST file. For information on configuring the driver for the input REST file method, see "Using the input REST file method".
Schema map generation
Upon initial connection, the driver generates a schema map that is stored in either internal memory or a resolved REST file--depending on the setting of the CreateMap property. When CreateMap is set to Session (the default), the driver stores the schema map using internal memory, which persists for only the life of the session before being discarded. When CreateMap is set to forceNew or notExist, the driver generates the relational map in a resolved REST file and set of internal driver files. The REST file persists indefinitely when the property is set to notExist. Conversely, if the property is set to forceNew, the driver deletes and regenerates the REST file at the beginning of every connection. See "CreateMap" for details.
Resolved REST file
The resolved REST file is a driver generated file that contains the fully defined map of REST responses. The driver uses this map to execute SQL queries. The resolved REST file is distinct from the input REST file, which is user created and supplies a list of end point for the driver to sample. In other words, the input REST file specifies which endpoints to sample, while the resolved REST file stores the response definitions discovered by sampling. Note that the resolved REST file is supported using both the Sample property and input REST file methods.
The driver generates the resolved REST file in the location specified by the SchemaMap property. In most scenarios, the resolved REST file works transparently from this location, with no additional driver configuration. However, in some instances, you may want to change the relational view generated by the driver. To modify the relational view, you will need to edit the resolved REST file. See "Modifying the relational view" for details.
* Using the Sample property method
* Using the input REST file method
* Creating an input REST file
* Modifying the relational view
* Mapping new native objects to a table