Type | Read/write | Author | Availability |
Write | Finbourne | Provided with LUSID |
The Lusid.Property.Definition.Writer
provider enables you to write a Luminesce SQL query that creates, updates, or deletes one or more property types or derived property types.
Note: The LUSID user running the query must have sufficient access control permissions to both use the provider and interact with property types in LUSID. This should automatically be the case if you are the domain owner.
You must construct a valid table of data to write, one property type per record. Lusid.Property.Definition.Writer
lists the fields (columns) available to populate with values for each record, and has a set of parameters to help you construct a valid table.
Your query can use the WriteAction
field to perform one of the following operations:
Upsert a property type; that is, create a property type if it does not exist, and update certain fields if it does. This is the default operation if you omit
WriteAction
.Insert (create) a property type. This operation fails if the property type already exists.
Update a property type. Note it is only possible to update the
DisplayName
andDescription
fields. This operation fails if the property type does not already exist.Delete a property type.
See also: Lusid.Property.Definition
Basic usage
Query parameters
Lusid.Property.Definition.Writer
has parameters that help you construct a valid table of data to write.
Note: The toWrite parameter is mandatory and used to actually write the table of data into LUSID.
To list available parameters, their data types, default values, and an explanation for each, run the following query using a suitable tool:
Data fields
Lusid.Property.Definition.Writer
lists the fields you can populate in your table of data to write.
Depending on the operation you want to perform, the following fields are mandatory to include in the table of data:
Operation | Mandatory fields |
Upsert |
|
Insert | For standard property types:
|
Update |
|
Delete |
|
To list all available fields, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a suitable tool:
Write errors
We recommend examining the results of every write query using one or more of the WriteError
, WriteErrorCode
and WriteErrorDetail
fields.
For each record in the table of data to write, Lusid.Property.Definition.Writer
returns an error code. If the operation is successful, the error code is 0. If unsuccessful, a positive error code and explanation help you discover why LUSID considers the operation invalid.
For example, the query:
... fails because a DisplayName
is not specified.
Examples
Note: For more example Luminesce SQL queries, visit our Github repo.
Example 1: Create a property type
You can create a property type, such as SIC Code in the Instrument domain, by supplying all mandatory fields and by using 'insert' as WriteAction
.
Example 2: Update a property type with additional details
You can update an existing property type, such as adding a description to the SIC Code property type, by supplying the fields comprising the 3-stage key, the fields you want to update, and by using 'update' as WriteAction
.
Example 3: Delete an existing property type
You can delete an existing property type by supplying the fields comprising the 3-stage key and by using 'delete' as WriteAction
.
Example 4: Create multiple property types at the same time
You can create all your property types at the same time in one Luminesce query. In this example, the query defaults to the 'Upsert' action as no explicit WriteAction
is specified.
Example 5: Create a derived property type
You can create a derived property type with a derivation formula that, in this example, concatenates a SICCode with the text "-derived" using the DerivationFormula
field.