Type | Read/write | Author | Availability |
Data provider | Read | Finbourne | Provided with LUSID |
The Lusid.Relationship.Definition
provider enables you to write a Luminesce SQL query that retrieves relationship types defined in LUSID.
Note: The LUSID user running the query must have sufficient access control permissions to both use the provider and read relationship type data stored in LUSID. This should automatically be the case if you are the domain owner.
See also: Lusid.Relationship.Definition.Writer
Basic usage
select * from Lusid.Relationship.Definition
Query parameters
Lusid.Relationship.Definition
has parameters that help you to filter or refine a query.
To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Lusid.Relationship.Definition' and FieldType = 'Parameter';
Data fields
By default, Lusid.Relationship.Definition
returns a table of data populated with particular fields (columns). You can return a subset of these fields.
To list all fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Lusid.Relationship.Definition' and FieldType = 'Column';
Note: Fields marked 'main' are returned by queries that use a caret character, for example select ^ from Lusid.Relationship.Definition
.
Examples
Note: For more examples, try the Luminesce Github repo.
Example 1: Retrieve all relationship types
select * from Lusid.Relationship.Definition;
Example 2: Retrieve all relationship types for a particular entity type
select * from Lusid.Relationship.Definition where SourceEntityType = 'Portfolio' or TargetEntityType = 'Portfolio'
Example 3: Retrieve time-variant relationship types for particular entity types
select * from Lusid.Relationship.Definition where SourceEntityType in ('Portfolio', 'PortfolioGroup', 'LegalEntity', 'Instrument') and Lifetime = 'TimeVariant' and RelationshipCardinality = 'ManyToMany' limit 20;