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

Add option to allow empty parameter value #2419

Closed

Conversation

tonyjiangh
Copy link
Contributor

The problem to tackle

The default value of parameter.
We have this page about default value in knowledge base.
But since we currently don't allow null value, there has to be some value filled in first as an indicator of using default value.

I think using null for that is just more intuitive.

The fix here

Add an 'Allow empty' option to parameter setting

Functionality

Query like this

select case when '{{val}}' = '' then current_date else '{{val}}' end as value

Could work without preset value for parameter now

New challenge

Empty value handling might be difficult and generate a lot of syntax error. We might want a better error message to help editor get the query right.
Also, if this is merged, I'll try to update the website for new example of usage.

@arikfr
Copy link
Member

arikfr commented Jan 3, 2019

This needs to be updated with recent changes to parameters implementation. Also, we would like to properly support optional parameters, as described in #3011.

Considering the above, I'm closing this pull request. Thank you for you effort though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants