File tree Expand file tree Collapse file tree 5 files changed +21
-4
lines changed
Expand file tree Collapse file tree 5 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -4,5 +4,8 @@ services:
44 image : cimg/postgres:17.0
55 environment :
66 - POSTGRES_USER=root
7+ - POSTGRES_DATABASE=codegen_test
8+ - POSTGRES_PASSWORD=password
9+ - POSTGRES_SCHEMA=codegen_integration_tests_postgres
710 ports :
811 - " 5432:5432"
Original file line number Diff line number Diff line change 11{%- macro bool_type_value(case_sensitive= False) - %}
22{%- if target .type == " redshift" - %}
3- {% - if case_sensitive - %} BOOLEAN {% - else - %} boolean {% - endif - %}
3+ boolean
44{%- elif target .type == " snowflake" - %}
55 {%- if case_sensitive - %}BOOLEAN {%- else - %}boolean {%- endif - %}
66{%- elif target .type == " bigquery" - %}
7- {%- if case_sensitive - %}BOOL {%- else - %}bool {%- endif - %}
7+ {%- if case_sensitive - %}BOOLEAN {%- else - %}boolean {%- endif - %}
88{%- elif target .type == " postgres" - %}
99 boolean
1010{%- else - %}
Original file line number Diff line number Diff line change 11{%- macro integer_type_value(case_sensitive= False) - %}
2- {%- if target .type == " snowflake" - %}
2+ {%- if target .type == " redshift" - %}
3+ integer
4+ {%- elif target .type == " snowflake" - %}
35 {%- if case_sensitive - %}NUMBER {%- else - %}number {%- endif - %}
46{%- elif target .type == " bigquery" - %}
57 {%- if case_sensitive - %}INT64{%- else - %}int64{%- endif - %}
Original file line number Diff line number Diff line change 11{%- macro text_type_value(case_sensitive= False) - %}
22{%- if target .type == " redshift" - %}
3- {% - if case_sensitive - %}CHARACTER VARYING{% - else - %}character varying{% - endif - %}
3+ text
44{%- elif target .type == " snowflake" - %}
55 {%- if case_sensitive - %}VARCHAR {%- else - %}varchar {%- endif - %}
66{%- elif target .type == " bigquery" - %}
Original file line number Diff line number Diff line change @@ -4,6 +4,18 @@ echo `pwd`
44cd integration_tests
55cp ci/sample.profiles.yml profiles.yml
66
7+ export POSTGRES_HOST=localhost
8+ export POSTGRES_USER=root
9+ export DBT_ENV_SECRET_POSTGRES_PASS=password
10+ export POSTGRES_PORT=5432
11+ export POSTGRES_DATABASE=codegen_test
12+ export POSTGRES_SCHEMA=codegen_integration_tests_postgres
13+
14+ # Create database if it doesn't exist
15+ PGPASSWORD=$DBT_ENV_SECRET_POSTGRES_PASS psql -h $POSTGRES_HOST -U $POSTGRES_USER -d postgres -tc " SELECT 1 FROM pg_database WHERE datname = '$POSTGRES_DATABASE '" | grep -q 1 || \
16+ PGPASSWORD=$DBT_ENV_SECRET_POSTGRES_PASS psql -h $POSTGRES_HOST -U $POSTGRES_USER -d postgres -c " CREATE DATABASE $POSTGRES_DATABASE "
17+
18+ dbt --warn-error clean --target $1 || exit 1
719dbt --warn-error deps --target $1 || exit 1
820dbt --warn-error run-operation create_source_table --target $1 || exit 1
921dbt --warn-error seed --target $1 --full-refresh || exit 1
You can’t perform that action at this time.
0 commit comments