Skip to content

Commit

Permalink
feat(#172): add instance and dbname
Browse files Browse the repository at this point in the history
  • Loading branch information
witash committed Jan 30, 2025
1 parent 7bb002b commit 9c23188
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion models/root/document_metadata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
{'columns': ['saved_timestamp']},
{'columns': ['doc_type']},
{'columns': ['_deleted']},
{'columns': ['isntance']},
{'columns': ['dbname']},
]
)
}}
Expand All @@ -17,7 +19,9 @@ SELECT
_id as uuid,
_deleted,
saved_timestamp,
doc->>'type' as doc_type
doc->>'type' as doc_type,
split_part(source, '/', 1) AS instance,
split_part(source, '/', 2) AS dbname
from {{ source('couchdb', env_var('POSTGRES_TABLE')) }} source_table
{% if is_incremental() %}
WHERE source_table.saved_timestamp >= {{ max_existing_timestamp('saved_timestamp') }}
Expand Down
4 changes: 4 additions & 0 deletions models/root/root.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ models:
data_type: string
data-tests:
- not_null
- name: instance
data_type: string
- name: dbname
data_type: string

0 comments on commit 9c23188

Please sign in to comment.