Schema Registry functions in the Tributary DuckDB extension
Function category
Schema Registry
11 functionsBrowse and change a Confluent-compatible Schema Registry — subjects, versions and schemas — and encode JSON values in its wire format. Credentials come from a tributary_schema_registry secret.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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 | Type | Description |
|---|---|---|
Column
deleted_version
|
Type
INTEGER
|
Description A deleted version number. |
Description
Delete a subject and return the versions that were deleted.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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 | Type | Description |
|---|---|---|
Column
deleted_version
|
Type
INTEGER
|
Description The deleted version number. |
Description
Delete one version of a subject.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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 | Type | Description |
|---|---|---|
Column
schema_type
|
Type
VARCHAR
|
Description
JSON, AVRO or PROTOBUF.
|
Column
schema
|
Type
VARCHAR
|
Description Schema definition text. |
Description
Fetch a schema by its GUID.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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 | Type | Description |
|---|---|---|
Column
schema_type
|
Type
VARCHAR
|
Description
JSON, AVRO or PROTOBUF.
|
Column
schema
|
Type
VARCHAR
|
Description Schema definition text. |
Description
Fetch a schema by subject and schema id.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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 | Type | Description |
|---|---|---|
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
Fetch one version of a subject's schema.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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 | Type | Description |
|---|---|---|
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
Fetch the latest schema registered under a subject.
SELECT version, schema_type, schema
FROM tributary_schema_registry_get_schema_latest('https://registry.example.com', 'orders-value');
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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
Convert the latest JSON schema of a subject into a DuckDB JSON structure description, for use with json_transform / from_json. Errors when the subject's schema is not a JSON schema.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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 | Type | Description |
|---|---|---|
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
Register a schema under a subject and return the registration.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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
Encode a JSON value with a JSON schema into the Schema Registry wire format, as a BLOB ready to hand to a Kafka producer.
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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 | Type | Description |
|---|---|---|
Column
subject
|
Type
VARCHAR
|
Description Subject name. |
Description
List the registry's subjects, one row per subject.
SELECT * FROM tributary_schema_registry_subjects('https://registry.example.com', false);
Signature
Arguments (Positional)
| Argument | Type | Mode | Description |
|---|---|---|---|
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 | Type | Description |
|---|---|---|
Column
version
|
Type
INTEGER
|
Description Version number. |
Description
List the version numbers registered under a subject.
SELECT * FROM tributary_schema_registry_versions('https://registry.example.com', 'orders-value');