ETL has a secondary language, called DDL (Data Definition Language) that is used to describe sets of variables that are passed to a template. It's essentially just a sequence of assignments, where you can create strings, integers, arrays, and hashes. Arrays, just like in ETL itself, can hold any type of variable in their elements. Hashes can use anything for their values, but only strings for their keys.
You create strings as follows:
string = "a string"
If you want to include a " inside a string, escape it with a backslash:
string = "a string with a \" in it"
To simply include a backslash in a string you can also escape it:
string = "a string with a \\ in it"
Integers are simply literal numbers:
integer = 47
Arrays are delimited by square brackets, and their contents are separated by commas:
array = [ "foo", "bar", "baz" ]
Hashes are delimited by braces, with equals signs between keys and values, and commas separating values from the following key:
hash = {
"key1" = 1,
"key2" = 2,
}
Notice that a trailing comma is permitted.
Hashes and Arrays can nest, so it's possible to do something like this:
links = [
{ "url" = "http://svn.collab.net/repos/svn/",
"text" = "The original Subversion repository" },
{ "url" = "http://svn.apache.org/repos/asf/",
"text" = "The ASF Subversion repository" }
]
This is a useful technique for creating lists of hashes that can be used like objects in your ETL templates.
DDL files also have the ability to include other DDL files:
%include "another.ddl"
This form of %include pulls the contents of its argument into the current namespace, potentially overwriting data that's already there. If you want to pull the contents of another DDL file into a variable you can use this form:
variable = %include "another.ddl"
That creates a Hash named 'variable' that contains the variables created in "another.ddl".