diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 457926e3..47da7d4d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,11 +1,21 @@ { - "name": "Python 3", - "image": "mcr.microsoft.com/devcontainers/python:1-3.10-bookworm", - "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": {} - }, - "postStartCommand": "bash .devcontainer/setup_odbc.sh && bash .devcontainer/install_pyenv.sh && bash .devcontainer/setup_env.sh", - "runArgs": [ - "--env-file", "${localWorkspaceFolder}/.devcontainer/test.env" - ] + "name": "Python 3", + "image": "mcr.microsoft.com/devcontainers/python:1-3.10-bookworm", + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": {} + }, + "postStartCommand": "sudo bash .devcontainer/setup_odbc.sh && bash .devcontainer/install_pyenv.sh && bash .devcontainer/setup_env.sh", + "containerEnv": { + "SQLSERVER_TEST_DRIVER": "ODBC Driver 18 for SQL Server", + "SQLSERVER_TEST_HOST": "127.0.0.1", + "SQLSERVER_TEST_USER": "SA", + "SQLSERVER_TEST_PASS": "L0calTesting!", + "SQLSERVER_TEST_PORT": "1433", + "SQLSERVER_TEST_DBNAME": "TestDB", + "SQLSERVER_TEST_ENCRYPT": "true", + "SQLSERVER_TEST_TRUST_CERT": "true", + "DBT_TEST_USER_1": "DBT_TEST_USER_1", + "DBT_TEST_USER_2": "DBT_TEST_USER_2", + "DBT_TEST_USER_3": "DBT_TEST_USER_3" + } } diff --git a/.devcontainer/setup_env.sh b/.devcontainer/setup_env.sh index b3854530..2b67fe7d 100644 --- a/.devcontainer/setup_env.sh +++ b/.devcontainer/setup_env.sh @@ -1,3 +1,5 @@ +cp test.env.sample test.env + pyenv install 3.10.7 pyenv virtualenv 3.10.7 dbt-sqlserver pyenv activate dbt-sqlserver diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..f9e337fe --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.txt text eol=lf diff --git a/dbt/adapters/sqlserver/__version__.py b/dbt/adapters/sqlserver/__version__.py index a26c3016..582554e8 100644 --- a/dbt/adapters/sqlserver/__version__.py +++ b/dbt/adapters/sqlserver/__version__.py @@ -1 +1 @@ -version = "1.7.3" +version = "1.7.4" diff --git a/dbt/include/sqlserver/macros/materializations/models/table/create_table_as.sql b/dbt/include/sqlserver/macros/materializations/models/table/create_table_as.sql index d8365717..adb420ba 100644 --- a/dbt/include/sqlserver/macros/materializations/models/table/create_table_as.sql +++ b/dbt/include/sqlserver/macros/materializations/models/table/create_table_as.sql @@ -9,7 +9,6 @@ SQL Server doesnt support this, so we use the 'SELECT * INTO XYZ FROM ABC' synta path={"identifier": relation.identifier.replace("#", "") ~ '_temp_view'}, type='view')-%} {% do run_query(fabric__drop_relation_script(tmp_relation)) %} - {% do run_query(fabric__drop_relation_script(relation)) %} {% set contract_config = config.get('contract') %}