SQL Taxonomy Job
The SQL Taxonomy job retrieves masterdata from a SQL database. Raptor will use the exported data to generate tags from it using the Entity Configuration. Taxonomy jobs are useful to proactively create tags that might be useful for Raptor users.
SQL taxonomy Taxonomy jobs use a Source service connection to a SQL database (see Service connections) and can use the Default delta packager (for publicly accessible databases) or a custom delta packager for on-premise databases. Contact a 9altitudes consultant if a custom delta packager needs to be set up.
To configure a SQL sync job, the following components must be defined:
Target Database Connection Specify the connection string for the source SQL database.
SQL Queries Provide the SQL queries to retrieve the required data. You can:
Use views or direct
SELECTstatementsInclude SQL parameters (e.g., timestamp filtering)
Rename columns using
ASApply any SQL logic, as long as the final output is a single result set (table)
Delta Sync (Optional) To enable delta (incremental) synchronization:
Define a storage connection string to track job progress
Specify a schema where progress metadata will be stored
Use a timestamp parameter in your queries to fetch only changed/new records
All delta-related settings are defined in the Delta Fetch section of the configuration.
Example Configuration
Below is a sample JSON configuration for a SQL sync job:
{
"source": "SQL",
"raptorTenantId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"TaxonomyConfig": {
"UseEntitySource": "EXAMPLE"
},
"packageInfo": {
"package": "TEST-PACKAGE",
"source": {
"connectionString": "Server=SRV\\DB;Database=XX;User Id=USR;Password=PASS;"
},
"storage": {
"connectionString": "inherit",
"schema": "raptor-integration"
},
"entities": [
{
"name": "INVOICES",
"select": "
DECLARE @date AS NVARCHAR(50);
IF (@timestamp IS NULL)
SET @date = '';
ELSE
SET @date = CONVERT(varchar, @timestamp, 23);
SELECT
[inv].[id] AS [ID],
[inv].[net amount] AS [AMOUNT],
[inv].[ref] AS [CUSTOMER]
FROM [dbo].[invoice-table] AS [inv]
WHERE [inv].[change] >= @date OR [inv].createdAt >= @date",
"timestampParameter": "timestamp"
},
{
"name": "ORDERS",
"select": "SELECT * FROM [dbo].[ORDERS]"
},
{
"name": "USERS",
"select": "SELECT * FROM [dbo].[user table]",
"timestampParameter": "none"
}
]
}
}Explanation of the Configuration
Entities Exported: The configuration defines three entities:
INVOICES,ORDERS, andUSERS. The job output will be a ZIP file containing three XML files:INVOICES.xmlORDERS.xmlUSERS.xml
Delta Sync Behavior:
The
INVOICESquery uses the@timestampparameter, so only changed or newly created records are fetched.The
ORDERSandUSERSqueries do not filter on timestamp, so they will always return the full table contents.
Column Mapping and Custom Logic: The
INVOICESquery demonstrates key features:Selecting specific columns
Renaming columns using
ASIncorporating conditional logic while ensuring a single
SELECTstatement is returned
Storage Configuration:
connectionString: "inherit"allows the storage connection to be inherited when running in a hosted environment (e.g., 9Altitudes server park).For on-premise execution, you may need to explicitly define this connection string.
The
schemais used to store delta progress and must exist in the database. For cloud deployments, it will be created by 9Altitudes. For on-premise use, ensure the schema exists and the configured login has full access (read/write/create).
Important Notes
Column names must be valid XML tag names.
Column names must match those defined in the Entity Configuration.
You can override the default entity configuration source by setting
TaxonomyConfig.UseEntitySource. In the example above, it uses the configuration from source"EXAMPLE".To perform a full sync instead of a delta sync, you can change the
packagename. This resets the stored timestamp.
Last updated