Skip to content

Schema Registry functions in the Tributary DuckDB extension

Function category

Schema Registry

11 functions

tributary_schema_registry_delete_subject

Table function Schema Registry
Signature
tributary_schema_registry_delete_subject( schema_registry_url: VARCHAR, subject: VARCHAR, permanent: BOOLEAN ) → TABLE
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument subject Type VARCHAR Mode Positional Description Subject name, usually <topic>-value or <topic>-key.
Argument permanent Type BOOLEAN Mode Positional Description false for a soft delete, true for a hard delete of an already soft-deleted subject.
Returns

A table with the following columns:

Column deleted_version Type INTEGER Description A deleted version number.
Description

tributary_schema_registry_delete_subject_version

Table function Schema Registry
Signature
tributary_schema_registry_delete_subject_version( schema_registry_url: VARCHAR, subject: VARCHAR, version: INTEGER, permanent: BOOLEAN ) → TABLE
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument subject Type VARCHAR Mode Positional Description Subject name, usually <topic>-value or <topic>-key.
Argument version Type INTEGER Mode Positional Description Version number to delete.
Argument permanent Type BOOLEAN Mode Positional Description false for a soft delete, true for a hard delete.
Returns

A table with the following columns:

Column deleted_version Type INTEGER Description The deleted version number.
Description

tributary_schema_registry_get_schema_by_guid

Table function Schema Registry
Signature
tributary_schema_registry_get_schema_by_guid(schema_registry_url: VARCHAR, guid: VARCHAR) → TABLE
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument guid Type VARCHAR Mode Positional Description Schema GUID.
Returns

A table with the following columns:

Column schema_type Type VARCHAR Description JSON, AVRO or PROTOBUF.
Column schema Type VARCHAR Description Schema definition text.
Description

tributary_schema_registry_get_schema_by_subject_and_id

Table function Schema Registry
Signature
tributary_schema_registry_get_schema_by_subject_and_id( schema_registry_url: VARCHAR, subject: VARCHAR, schema_id: INTEGER ) → TABLE
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument subject Type VARCHAR Mode Positional Description Subject name, usually <topic>-value or <topic>-key.
Argument schema_id Type INTEGER Mode Positional Description Schema id.
Returns

A table with the following columns:

Column schema_type Type VARCHAR Description JSON, AVRO or PROTOBUF.
Column schema Type VARCHAR Description Schema definition text.
Description

tributary_schema_registry_get_schema_by_version

Table function Schema Registry
Signature
tributary_schema_registry_get_schema_by_version( schema_registry_url: VARCHAR, subject: VARCHAR, version: INTEGER ) → TABLE
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument subject Type VARCHAR Mode Positional Description Subject name, usually <topic>-value or <topic>-key.
Argument version Type INTEGER Mode Positional Description Version number within the subject.
Returns

A table with the following columns:

Column id Type INTEGER Description Schema id.
Column guid Type VARCHAR Description Schema GUID.
Column subject Type VARCHAR Description Subject.
Column version Type INTEGER Description Version number within the subject.
Column schema_type Type VARCHAR Description JSON, AVRO or PROTOBUF.
Column schema Type VARCHAR Description Schema definition text.
Description

tributary_schema_registry_get_schema_latest

Table function Schema Registry
Signature
tributary_schema_registry_get_schema_latest(schema_registry_url: VARCHAR, subject: VARCHAR) → TABLE
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument subject Type VARCHAR Mode Positional Description Subject name, usually <topic>-value or <topic>-key.
Returns

A table with the following columns:

Column id Type INTEGER Description Schema id.
Column guid Type VARCHAR Description Schema GUID.
Column subject Type VARCHAR Description Subject.
Column version Type INTEGER Description Version number within the subject.
Column schema_type Type VARCHAR Description JSON, AVRO or PROTOBUF.
Column schema Type VARCHAR Description Schema definition text.
Description
1 Latest schema of a topic's values
SELECT version, schema_type, schema
FROM tributary_schema_registry_get_schema_latest('https://registry.example.com', 'orders-value');

tributary_schema_registry_get_schema_latest_json_structure

Scalar function Schema Registry
Signature
tributary_schema_registry_get_schema_latest_json_structure(schema_registry_url: VARCHAR, subject: VARCHAR) → VARCHAR
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument subject Type VARCHAR Mode Positional Description Subject name, usually <topic>-value or <topic>-key.
Description

tributary_schema_registry_register_schema

Table function Schema Registry
Signature
tributary_schema_registry_register_schema( schema_registry_url: VARCHAR, subject: VARCHAR, schema_type: VARCHAR, schema: VARCHAR, normalize: BOOLEAN ) → TABLE
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument subject Type VARCHAR Mode Positional Description Subject name, usually <topic>-value or <topic>-key.
Argument schema_type Type VARCHAR Mode Positional Description JSON, AVRO or PROTOBUF.
Argument schema Type VARCHAR Mode Positional Description Schema definition text.
Argument normalize Type BOOLEAN Mode Positional Description Ask the registry to normalize the schema before registering it.
Returns

A table with the following columns:

Column id Type INTEGER Description Schema id.
Column guid Type VARCHAR Description Schema GUID.
Column subject Type VARCHAR Description Subject.
Column version Type INTEGER Description Version number within the subject.
Column schema_type Type VARCHAR Description JSON, AVRO or PROTOBUF.
Column schema Type VARCHAR Description Schema definition text.
Description

tributary_schema_registry_serialize_json

Scalar function Schema Registry
Signature
tributary_schema_registry_serialize_json( schema_registry_url: VARCHAR, schema: JSON, topic: VARCHAR, data: JSON ) → BLOB
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument schema Type JSON Mode Positional Description JSON schema for the value.
Argument topic Type VARCHAR Mode Positional Description Topic the value is meant for (its <topic>-value subject).
Argument data Type JSON Mode Positional Description Value to encode.
Description

tributary_schema_registry_subjects

Table function Schema Registry
Signature
tributary_schema_registry_subjects(schema_registry_url: VARCHAR, deleted: BOOLEAN) → TABLE
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument deleted Type BOOLEAN Mode Positional Description Include soft-deleted subjects.
Returns

A table with the following columns:

Column subject Type VARCHAR Description Subject name.
Description
1 List subjects
SELECT * FROM tributary_schema_registry_subjects('https://registry.example.com', false);

tributary_schema_registry_versions

Table function Schema Registry
Signature
tributary_schema_registry_versions(schema_registry_url: VARCHAR, subject: VARCHAR) → TABLE
Arguments (Positional)
Argument schema_registry_url Type VARCHAR Mode Positional Description Base URL of the Schema Registry. Credentials come from the tributary_schema_registry secret whose scope matches it.
Argument subject Type VARCHAR Mode Positional Description Subject name, usually <topic>-value or <topic>-key.
Returns

A table with the following columns:

Column version Type INTEGER Description Version number.
Description
1 Versions of a subject
SELECT * FROM tributary_schema_registry_versions('https://registry.example.com', 'orders-value');