# INACTIVE EXAMPLE — this file ends in .txt so LHP never picks it up.
#
# It demonstrates the ${secret:scope/key} substitution syntax with a JDBC
# load. Secrets resolve at pipeline runtime via dbutils.secrets.get(); they
# never appear as plain text in the generated code.
#
# To activate:
#   1. Create a Databricks secret scope and add the keys referenced below.
#   2. Map the scope alias in substitutions/<env>.yaml:
#        secrets:
#          default_scope: sample-secrets
#          scopes:
#            db_secrets: my-db-secret-scope
#   3. Copy this file to pipelines/01_ingest/jdbc_with_secret.yaml
#      (dropping the .txt suffix) and run `lhp generate` again.
pipeline: sample_ingest
flowgroup: jdbc_with_secret
actions:
  - name: load_external_products
    type: load
    readMode: batch
    source:
      type: jdbc
      url: "jdbc:postgresql://example.com:5432/sample"
      driver: "org.postgresql.Driver"
      user: "${secret:db_secrets/user}"
      password: "${secret:db_secrets/password}"
      table: "public.products"
    target: v_external_products
    description: "Load a products table from an external PostgreSQL via JDBC"
  - name: write_external_products
    type: write
    source: v_external_products
    write_target:
      type: materialized_view
      catalog: "${catalog}"
      schema: "${bronze_schema}"
      table: jdbc_products
