trino-k8s

Trino Server

Channel Revision Published Runs on
latest/stable 39 09 Dec 2024
Ubuntu 22.04
latest/beta 33 03 Oct 2024
Ubuntu 22.04
latest/edge 53 12 Feb 2026
Ubuntu 22.04
juju deploy trino-k8s
Show information

Platform:

charms.trino_k8s.v0.trino_catalog

Library for the trino_catalog relation.

This library provides the TrinoCatalogProvider and TrinoCatalogRequirer classes that handle the provider and the requirer sides of the trino_catalog interface.


class TrinoCatalog

Description

Represents a Trino catalog. None

Methods

TrinoCatalog. __init__( self , name: str , connector: str , description: str )

Initialize a TrinoCatalog.

Arguments

name

Catalog name (e.g., "marketing", "sales")

connector

Optional connector type (e.g., "postgresql", "mysql", "bigquery")

description

Optional description of the catalog

TrinoCatalog. to_dict( self )

Convert to dictionary for serialization.

Returns

Dictionary with name, connector, and description keys

TrinoCatalog. from_dict( cls , data: dict )

Create TrinoCatalog from dictionary.

Arguments

data

Dictionary with name, optional connector, and optional description

Returns

TrinoCatalog instance

TrinoCatalog. __repr__( self )

String representation for debugging.

Returns

String representation of the TrinoCatalog object.

TrinoCatalog. __eq__( self , other )

Compare two catalogs for equality.

Arguments

other

Object to compare with.

Returns

True if catalogs are equal, False otherwise.

class TrinoCatalogProvider

Provider side of the trino_catalog relation.

Description

This library handles the relation lifecycle and data updates. The charm is responsible for providing the actual data (url, catalogs, secret).

Note: The credentials secret is model-owned and must be manually granted to each requirer application using: juju grant-secret <secret> <requirer-app>

Methods

TrinoCatalogProvider. __init__( self , charm: CharmBase , relation_name: str )

Initialize the TrinoCatalogProvider.

Arguments

charm

The charm instance.

relation_name

Name of the relation.

TrinoCatalogProvider. update_relation_data( self , relation , trino_url: str , trino_catalogs , trino_credentials_secret_id: str )

Update relation data for a specific relation.

Arguments

relation

The relation to update

trino_url

Trino URL (e.g., "trino.example.com:443")

trino_catalogs

List of TrinoCatalog objects

trino_credentials_secret_id

Juju secret ID containing Trino users

Returns

True if successful, False otherwise

TrinoCatalogProvider. update_all_relations( self , trino_url: str , trino_catalogs , trino_credentials_secret_id: str )

Update all trino-catalog relations with the provided data.

Arguments

trino_url

Trino URL

trino_catalogs

List of TrinoCatalog objects

trino_credentials_secret_id

Juju secret ID containing Trino users

class TrinoCatalogRequirer

Description

Requirer side of the trino_catalog relation. None

Methods

TrinoCatalogRequirer. __init__( self , charm: CharmBase , relation_name: str )

Initialize the TrinoCatalogRequirer.

Arguments

charm

The charm instance.

relation_name

Name of the relation.

TrinoCatalogRequirer. get_trino_info( self )

Get current Trino connection information.

Returns

Dictionary with trino_url, trino_catalogs (List[TrinoCatalog]), and trino_credentials_secret_id, or None if not available.

TrinoCatalogRequirer. get_credentials( self )

Get Trino credentials to use from the secret.

Returns

Tuple of (username, password) or None if not available.

Description

Note: The requirer application must be granted access to the secret using: juju grant-secret <secret> <requirer-app>. The secret must contain a user matching the format "app-<requirer-charm-name>".