Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-831] Add options clause to create table macro #391

Closed
shenpeiheng opened this issue Jul 12, 2022 · 1 comment
Closed

[CT-831] Add options clause to create table macro #391

shenpeiheng opened this issue Jul 12, 2022 · 1 comment
Labels

Comments

@shenpeiheng
Copy link

Description
Adds an option clause macro which allows for adding options to a table via the config:

#171

But Can Not be used, variable in config options

1、create test model/test.sql
{{
config(
materialized='table',
file_format='jdbc',
options={
'dbtable': 'my_table',
'url': 'jdbc:sqlserver://localhost:1433;databaseName=database;',
'user': 'user',
'password': '{{ var("password"}}'
}
)
}}
select 1

2、Execute command
dbt run --select pg --vars '{"password":"password"}'

@shenpeiheng shenpeiheng added type:bug Something isn't working triage:product labels Jul 12, 2022
@github-actions github-actions bot changed the title Add options clause to create table macro [CT-831] Add options clause to create table macro Jul 12, 2022
@lostmygithubaccount lostmygithubaccount removed their assignment Aug 30, 2022
@lostmygithubaccount
Copy link

hi @shenpeiheng, thanks for reporting! apologies for the unusually slow triage time on this one.

some initial things to try would be removing the {{ ... }}, i.e. adjusting the password line to:

'password': var('password')

this would be because you're already in a Jinja context.

can you let us know if that works? also going to tag @jtcohen6 as he might know better what's going on here

@Fleid Fleid closed this as completed Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants