How do I create multiple versions of a Luminesce provider?

You can specify the ProviderNameExtension parameter while querying Sys.Admin.Lusid.Provider.Configure to create a new version of a provider.

This allows you to configure multiple versions of the provider with different inlined properties. Your end users can then query their own version of the base provider with only the inlined properties that are relevant to them.

To create a new version of a provider, use the following syntax:

@keysToCatalogue = values
('<key>', '<name>', <boolean>, '<description>');

@config = select column1 as [Key], column2 as Name, column3 as IsMain, column4 as Description from @keysToCatalogue;

select * from Sys.Admin.Lusid.Provider.Configure
where Provider = '<provider-name>'
and Configuration = @config
and ProviderNameExtension = '<extension-name>';
SQL

Read more about the Sys.Admin.Lusid.Provider.Configure syntax.

For example, to ‘inline’ Instrument/Analytic/Yield in a new version of the Lusid.Instrument.Equity provider:

@keysToCatalogue = values
('Instrument/Analytic/Yield', 'Yield', False, 'A property representing the instrument yield');

@config = select column1 as [Key], column2 as Name, column3 as IsMain, column4 as Description from @keysToCatalogue;

select * from Sys.Admin.Lusid.Provider.Configure
where Provider = 'Lusid.Instrument.Equity'
and Configuration = @config
and ProviderNameExtension = 'Yield';
SQL

Once created, the Luminesce catalogue displays your new provider version (note you need to click the Refresh icon to see the new version):

Once published, and providing suitably permissioned, an end user can write a Luminesce SQL query using the new provider version in the same way as any other view or provider in the Luminesce catalogue.

For example, the following query retrieves the first 10 equity instruments with yields above 0.25:

select * from Lusid.Instrument.Equity.Yield where Yield > 0.25
SQL

To remove the provider version from the Luminesce catalogue (which means it will no longer be available for end users to query), use the following syntax with WriteAction = ‘Reset’:

@@keysToCatalogue = select '' as [Key];

select * from Sys.Admin.Lusid.Provider.Configure
where Provider = '<provider-name>'
and Configuration = @@keysToCatalogue
and ProviderNameExtension = '<extension-name>'
and WriteAction = 'Reset';
SQL

For example, to delete the provider version created above:

@@keysToCatalogue = select '' as [Key];

select * from Sys.Admin.Lusid.Provider.Configure
where Provider = 'Lusid.Instrument.Equity'
and Configuration = @@keysToCatalogue
and ProviderNameExtension = 'Yield'
and WriteAction = 'Reset';
SQL