SQL sources
Having set up an SQL connection, you can define a source
. The name implies that this will be a source for Portrait and your future sections. Technically speaking, sources are SQL queries. The results of these queries will be stored as lists in Portrait.
Add the following to the source
section inside the application.yml file:
sources:
source:
- id: 'Customer'
conn: 'NAVDEMO'
sourceType: 'sql'
runInterval: 3600
key: No_
keyName: Name
excludeKeysFromSuggestions: []
sourceSpecific:
sqlQuery: "SELECT * FROM [CRONUS AG$Customer] CUS"
The name of the source will be Customer
. The name will be later on used inside the section. In this example, the connection NAVDEMO
is used and therefore must be defined firsthand. The sourceType will be in case of ELO always be sql
. Thus, sourceSpecific config is required. Each SQL source needs a sqlQuery.
Settings
Name |
|
---|---|
id | Name of the source |
conn | Used connection. |
sourceType | In case of SQL: |
keyName | Name of the indexed object. |
key | Unique Id of the indexed object. The key must be unique to this document in Portrait. Avoid key conflicts at all costs. For instance, a simple unique id (e.g. 1, 2, 3…) in the source “Customer” will clash with the same unique id (1,2,3,…) in source “Supplier”. |
runInterval | reindex interval of the source in seconds |
runDelay | delay before the first reindex run in seconds. |
runAt | instead of using an interval, you can define a specific time when the reindex will be triggered. Example: runtAt: 07:00
|
excludeKeysFromSuggestions | This list excludes the Keys from being added to the suggesters. Suggesters are used inside the search as “Completion Suggester” and “Did you Mean”. |
icon | See Entry Icons |
sourceSpecific.sqlQuery | The used sql query for retrieving the data. We recommend that you go invest some time for your query and define the columns (avoid |