You must create a relational dataset definition (RDD) to define the schema of a dataset before you can add records to it.
A dataset is equivalent to a table in a relational database. It can have a finite set of columns, a (nominally) infinite set of rows, and a nominated subset of columns that form (part of) the primary key. Anatomy of a dataset.
Methods
Call the CreateRelationalDatasetDefinition API, for example:
curl -X POST 'https://<your-domain>.lusid.com/api/api/relationaldatasetdefinitions'
-H 'Content-Type: application/json-patch+json'
-H 'Authorization: Bearer <your-API-access-token>'
-d '{
"id": {
"scope": "MyDatasets",
"code": "Addresses"
},
"displayName": "Address custom dataset",
"description": "A custom dataset modelling addresses for people and organisations",
"applicableEntityTypes": ["Person","LegalEntity"],
"fieldSchema": [
{
"category": "SeriesIdentifier",
"fieldName": "AddressType",
"displayName": "Address type",
"description": "Whether a correspondence or a registered address",
"dataTypeId": {"scope": "MyCustomDataTypes", "code": "AddressType"},
"required": true,
},
{
"category": "Value",
"fieldName": "Street",
"displayName": "Street",
"description": "Building number/name and street",
"dataTypeId": {"scope": "system","code": "string"},
"required": true,
},
{
"category": "Value",
"fieldName": "City",
"displayName": "Town or city",
"dataTypeId": {"scope": "system","code": "string"},
"required": true,
},
{
"category": "Metadata"
"fieldName": "Email",
"displayName": "Contact email",
"description": "Email address for primary contact",
"dataTypeId": {"scope": "system","code": "string"}
}]
}'Coming soon
Write a Luminesce SQL query using the Lusid.RelationalDataset.Definition.Writer provider and execute it using a tool such as the LUSID web app, for example:

Request fields
This section supplements the API documentation and on-screen help text in the LUSID web app.
A RDD:
Must have a
scopeand acodethat together uniquely identify it.Must have a
displayNameand can have adescription.Must reference at least one of the
applicableEntityTypesin the following list:Portfolio,Instrument,Transaction,Person,LegalEntity,InvestorRecord,InvestmentAccount, or a custom entity. Note each record in the dataset can be associated with one, some, or all entities of a particular type.Must have a
fieldSchemacontaining at least one mandatoryValuefield (see below).
A fieldSchema:
Can have one or more
SeriesIdentifierfields. It may have none. Note that each forms part of the primary key, in conjunction with information about associated entities. While aSeriesIdentifiercan be optional, note that if a user omits a value then part of the key will be missing for that record.Must have at least one mandatory
Valuefield. The remainder can be optional.Can have one or more
Metadatafields, mandatory or optional.
The maximum number of fields is 100, of which no more than 50 can be SeriesIdentifier fields. Each:
Must have a unique
fieldName(no spaces), and can have a verbosedisplayNameanddescription.Must have a category of either
SeriesIdentifier,ValueorMetadata.Can set
requiredtotrue. The default isfalse. At a minimum, oneValuefield must betrue.Must reference the
dataTypeIdof a built-in or custom data type with an underlyingvalueTypeofString,Int,Decimal,DateTimeorBoolean. Note arrays are not supported; if you have a list of values (for example, email addresses) then you can either delimit multiple values in a string using a suitable character, or provide a separate field for each.
Subsequent updates
If no records have yet been added to a RDD, you can update any aspect of it by calling the UpdateRelationalDatasetDefinition API.
If records have been added, do not call this API. Instead, call:
The UpdateRelationalDatasetDetails API to change the
displayNameanddescription, or to add or removeapplicableEntityTypes. Note you cannot remove an entity type if records are associated with it.The UpdateRelationalDatasetFieldSchema API to change the
fieldSchema.
Coming soon
Write a Luminesce SQL query using the Lusid.RelationalDataset.Definition.Writer provider and:
To change any aspect of a RDD that has no records, specify
'Update' as WriteAction.To add or update fields of a RDD that has records, specify
'Update' as WriteAction.To remove fields from a RDD that has records, specify
'RemoveField' as WriteAction.
If records have been added to a RDD, note the following update restrictions to the fieldSchema:
Field type | Add new field? | Remove existing field? | Update existing field? |
|---|---|---|---|
|
|
| |
|
|
| |
|
|
Deleting a relational dataset definition
Note any records added to the dataset are also deleted, and can only be retrieved by rolling back the asAt timeline when querying.
Call the DeleteRelationalDatasetDefinition API and specify the scope and code of the RDD in the URL, for example:
curl -X POST 'https://<your-domain>.lusid.com/api/api/relationaldatasetdefinitions/MyRDDs/Addresses'
-H 'Content-Type: application/json-patch+json'
-H 'Authorization: Bearer <your-API-access-token>'Coming soon
Write a Luminesce SQL query using the Lusid.RelationalDataset.Definition.Writer provider and specify 'Delete' as WriteAction.