Hi :wave: Is it possible to add a new column to th...
# getting-started
b
Hi 👋 Is it possible to add a new column to the table(s) i'm extracting using tap-mysql with default value in it? maybe in the transform step? like adding a script in the transform folder?
m
Hi, I do it in the transformation step using dbt-postgres. What I do is add a default value for the
synced
column:
Copy code
{{
  config(
    materialized='incremental',
    unique_key='id',
  )
}}

with base as (
  select
    id,
    column1,
    column2,
    created_at
  from {{ source('integration', 'stream') }}
)

select
  id,
  column1 as first_name,
  column2 as last_name,
  created_at
  false as synced
from base

{% if is_incremental() %}
     where created_at > (select max(created_at) from {{ this }})
{% endif %}
u
Yeah I'd also recommend using dbt for this