Definition
Information
Section titled “Information”The Dataservices Changelogsource model holds named sources for change-log records. Each entry records a change-source identifier and source name, together with organisation information.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”dataservices.changelog count per dataservices.changelogsource
Section titled “dataservices.changelog count per dataservices.changelogsource”Count related dataservices.changelog records for each dataservices.changelogsource record, joined on changelogsourceid.
SELECT m."changelogsourceid", m."sourcename", COUNT(c."changelogsourceid") AS changelog_countFROM dataservices.changelogsource AS mLEFT JOIN dataservices.changelog AS c ON m."changelogsourceid" = c."changelogsourceid" AND m."organisation" = c."organisation"GROUP BY m."changelogsourceid", m."sourcename"ORDER BY changelog_count DESC;dataservices.changelog records with dataservices.changelogsource details
Section titled “dataservices.changelog records with dataservices.changelogsource details”List dataservices.changelog records with the dataservices.changelogsource values they reference through changelogsourceid.
SELECT c."changelogid", c."logtimestamp", m."changelogsourceid", m."sourcename" AS "changelogsource_sourcename"FROM dataservices.changelog AS cINNER JOIN dataservices.changelogsource AS m ON m."changelogsourceid" = c."changelogsourceid" AND m."organisation" = c."organisation";dataservices.changelogsource records not used by dataservices.changelog
Section titled “dataservices.changelogsource records not used by dataservices.changelog”Find dataservices.changelogsource records that no dataservices.changelog record references.
SELECT m."changelogsourceid", m."sourcename"FROM dataservices.changelogsource AS mWHERE NOT EXISTS ( SELECT 1 FROM dataservices.changelog AS c WHERE m."changelogsourceid" = c."changelogsourceid" AND m."organisation" = c."organisation");