-
Notifications
You must be signed in to change notification settings - Fork 22
def and deps
sdflysha edited this page Dec 24, 2018
·
10 revisions
#def
and #deps
are used to define dependencies for complex query like A will automatically enables B, when meets certain conditions.
For example:
#def<A, "A text here">
#if(Condition)
{
#deps<A>
Condition text here
}
If Condition
satisfied, deps<A>
will auto enable #def<A>
, and the final result is:
A text here
Condition text here
Otherwise, the final result is(nothing):
- Include in sub-sql(
sql{...}
) cannot be processed:
sql v1
{
#isEqual<A, true, sql { #include<v2> }
}
sql v2
{
#def<K, 'Test'>
#deps<K>
}
When A==true
, should include v2
, but K
Won't be enabled by #deps
.
-
#def
/#deps
can be processed in direct#include<>
:
sql v1 {#include<v2>}
sql v2 {#def<K, 'Test'>#deps<K>}
Will emit: test
See also: