Référence SQL de la configuration de l’appli

Fichier : configuration/app_config.sql

Objets et procédures de la base de données

STATE.APP_CONFIG

Une table interne pour stocker toutes les configurations des connecteurs. Ce tableau suit la structure suivante :

KEY

VALUE

UPDATED_AT

connector_configuration

{warehouse: “wh”, destination_db: “db”, destination_schema: “s”}

TIMESTAMP_NTZ_1

custom_configuration

{journal_table: “j_table_name”}

TIMESTAMP_NTZ_2

connection_configuration

{secret_name: “secret_db.schema.the_secret”}

TIMESTAMP_NTZ_3

{…}

PUBLIC.CONNECTOR_CONFIGURATION

Une vue qui récupère et mappe les données de la table interne APP_CONFIG. Le mappage est le suivant :

  1. KEY (col) → CONFIG_GROUP (col) ;

  2. Clés JSON de la colonne VALUE (clé JSON) → CONFIG_KEY (col)

  3. Valeurs JSON de la colonne VALUE (valeur JSON) → VALUE (col)

  4. UPDATED_AT (col) → UPDATED_AT (col)

Exemple de vue CONNECTOR_CONFIGURATION créée sur l’exemple APP_CONFIG :

CONFIG_GROUP

CONFIG_KEY

VALUE

UPDATED_AT

connector_configuration

entrepôt

wh

<timestamp_ntz>

connector_configuration

destination_db

db

<timestamp_ntz>

custom_configuration

journal_table

j_table_name

<timestamp_ntz>

connection_configuration

secret_name

secret_db.schema.the_secret

<timestamp_ntz>