I am working on a charm for the BI tool called
apache-superset … initially I wrote it to accept
db relations because it should be able to relate to a postgresql DB … BUT I now want to add a 2nd “DB” of sorts… Trino!
my question is… how to I most eloquently add a 2nd DB over the same relation… but with perhaps a different action or interface?
so far I read https://juju.is/docs/sdk/relations#heading--relation-and-interface-naming and tried to see if I had done this before in the past with my other charms but… this is a first
My charm so far
name: apache-superset summary: This charm brings up apache superset maintainers: - emcp <email@example.com> description: | LXD tested only charm tags: - business intelligence subordinate: false series: - focal - jammy requires: db: interface: pgsql optional: true
#!/bin/bash juju-log -l 'WARNING' 'db-relation-created' status-set maintenance "Preparing superset to create connection to new DB $(date +"%H:%M")" relation-set database="mysupersetdb" juju-log -l 'WARNING' "database is set to mysupersetdb on joined"
if I using trino… I need to get info from TRINO … like IP Address… connection info… but will I create a whole new hook if I reuse the
db for the relation?
if I add the 2nd relation
... requires: db: interface: pgsql optional: true db: interface: trino optional: true
how can I differentiate in the bash hook… which one I am relating to?