Skip to main content

user_defined_functions

Creates, updates, deletes, gets or lists a user_defined_functions resource.

Overview

Nameuser_defined_functions
TypeResource
Idazure.confidential_ledger_dataplane.user_defined_functions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the user defined function.
codestringCode of the user defined function in JavaScript. Required.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_user_defined_functionselectfunction_id, ledger_endpointGets a user defined function. Returns the user defined function in the Confidential Ledger.
list_user_defined_functionsselectledger_endpointRetrieves a list of user defined functions present in the Confidential Ledger. User defined functions stored in the Confidential Ledger.
create_user_defined_functioninsertfunction_id, ledger_endpoint, codeCreates a user defined function. Creates the user defined function in the Confidential Ledger.
delete_user_defined_functiondeletefunction_id, ledger_endpointDeletes a user defined function from the Confidential Ledger. Deletes a user defined function from the Confidential Ledger.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
function_idstringIdentifies a user defined function. Required.
ledger_endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client ledgerEndpoint parameter. (default: )

SELECT examples

Gets a user defined function. Returns the user defined function in the Confidential Ledger.

SELECT
id,
code
FROM azure.confidential_ledger_dataplane.user_defined_functions
WHERE function_id = '{{ function_id }}' -- required
AND ledger_endpoint = '{{ ledger_endpoint }}' -- required
;

INSERT examples

Creates a user defined function. Creates the user defined function in the Confidential Ledger.

INSERT INTO azure.confidential_ledger_dataplane.user_defined_functions (
code,
function_id,
ledger_endpoint
)
SELECT
'{{ code }}' /* required */,
'{{ function_id }}',
'{{ ledger_endpoint }}'
RETURNING
id,
code
;

DELETE examples

Deletes a user defined function from the Confidential Ledger. Deletes a user defined function from the Confidential Ledger.

DELETE FROM azure.confidential_ledger_dataplane.user_defined_functions
WHERE function_id = '{{ function_id }}' --required
AND ledger_endpoint = '{{ ledger_endpoint }}' --required
;